您可以在下面将此量子运算视为按位运算符quantum,
qubits[0]= a
qubits[1] = y
qubits[2] = z
并让 @ 是按位运算符, x@x = 0 ,任何 p@0 = p
qubits[0] = H(a) = x (superposition state, final x )
CNOT(qubits[0], qubits[1]) = CNOT(x,y) = (x, x @ y) = (x, yy) (final qubits[1]=yy)
CNOT(qubits[0], qubits[2]) = CNOT(x,z) = (x, x @ z) = (x, zz)
CNOT(qubits[1], qubits[2]) = CNOT(yy,zz) = (yy, zz@ yy) = (x@y, x@z@x@y) = (x@y,z@y) (final qubits[2]=z@y)
(x,y,z) = (0,0,0) ==> (qubits[0],qubits[1],qubits[2]) = (0,0,0)
(x,y,z) = (0,0,1) ==> (qubits[0],qubits[1],qubits[2]) = (0,0,1)
(x,y,z) = (0,1,0) ==> (qubits[0],qubits[1],qubits[2]) = (0,1,1)
(x,y,z) = (0,1,1) ==> (qubits[0],qubits[1],qubits[2]) = (0,1,0)
(x,y,z) = (1,0,0) ==> (qubits[0],qubits[1],qubits[2]) = (1,1,0)
(x,y,z) = (1,0,1) ==> (qubits[0],qubits[1],qubits[2]) = (1,1,1)
(x,y,z) = (1,1,0) ==> (qubits[0],qubits[1],qubits[2]) = (1,0,1)
(x,y,z) = (1,1,1) ==> (qubits[0],qubits[1],qubits[2]) = (1,0,0)