I'm looking at this MBQC tutorial where there's an example that shows that a MB and CB single qubit rotations give the same result.
CB version :
dev = qml.device("default.qubit", wires=1)
@qml.qnode(dev)
def RZ(theta, input_state):
# Prepare the input state
qml.QubitStateVector(input_state, wires=0)
# Perform the Rz rotation
qml.RZ(theta, wires=0)
# Return the density matrix of the output state
return qml.density_matrix(wires=[0])
MB version :
mbqc_dev = qml.device("default.qubit", wires=2)
@qml.qnode(mbqc_dev)
def RZ_MBQC(theta, input_state):
# Prepare the input state
qml.QubitStateVector(input_state, wires=0)
# Prepare the cluster state
qml.Hadamard(wires=1)
qml.CZ(wires=[0, 1])
# Measure the first qubit an correct the state
qml.RZ(theta, wires=0)
qml.Hadamard(wires=0)
m = qml.measure(wires=[0])
qml.cond(m == 1, qml.PauliX)(wires=1)
qml.Hadamard(wires=1)
# Return the density matrix of the output state
return qml.density_matrix(wires=[1])
The problem is that RZ_MBQC uses qml.RZ(theta) just like the normal (CB) version. This doesn't seem right...the whole point to me is to implement RZ without using the circuit version...am I missing something?