Cannot locate the operations I am mixing?

pennylane.qnodes.base.QuantumFunctionError: Continuous and discrete operations are not allowed in the same quantum circuit.

Here is the code (its a modification to mixer and phase ccts for your qaoa maxcut tutorial):

def Um(beta):
	for i, edge in enumerate(Eo):
		t = edge[0]
		c = edge[1]
		for j in c:
			qml.X(wires=j)
		if len(c) > 1:
			qml.Toffoli(wires=c+[n - 1])
		else:
			qml.CNOT(wires=c+[n - 1])
		qml.CRX(2*beta, wires=[n - 1, t])
		for j in c:
			qml.X(wires=j)
		if len(c) > 1:
			qml.Toffoli(wires=c+[n - 1])
		else:
			qml.CNOT(wires=c+[n - 1])


def Up(gamma):
	for i in range(n):
		qml.RZ(-gamma, wires=i)

I am suspicious of the toffoli gate since its not mentioned as an operation in the discrete docs explicitly. However I know its a standard qubit type operator. Let me know if perhaps you need the full code. :slight_smile:

HI @HelloBeastie!

All of your operations here are qubit/discrete operations, except for qml.X, which is a CV observable! It represents the position quadrature observable in continuous variable systems.

In this particular case, are you looking for qml.PauliX?

@josh I did mean qml.PauliX! oops :rofl: Thanks so much :grinning: