The gate-sequence defined in my circuit does not match with the sequence printed using circuit.draw().
@qml.qnode(dev) def circuit(params): qml.RZ(params[0,0], wires= 0) qml.RZ(params[0,1], wires= 1) qml.RZ(params[0,2], wires= 2) qml.RZ(params[0,3], wires= 3) qml.CZ(wires=[0,1]) qml.CZ(wires=[0,2]) qml.CZ(wires=[0,3]) qml.CZ(wires=[1,2]) qml.CZ(wires=[1,3]) qml.CZ(wires=[2,3]) return qml.probs(wires=[0,1,2,3]) params= np.array([[0.1, 0.2, 0.5, 0.8], [1.2, 0.01, 2.4, 3.14]]) circuit(params) print(circuit.draw())
My circuit is printed like this:
The operations CZ[wires=[0,3]] and CZ(wires=[1,2]) got swapped in the circuit diagram. Is the diagram wrong, or the circuit being implemented is not as I defined in my qnode function?
However, I think here this won’t effect the final result because CZ operators acting on different pairs of qubits commute.