예제 #1
0
 def two_qubit_gate_2(self, q):
     Gates.CZ(q, 0, 1)
예제 #2
0
    print q
    Gates.CNOT(q, iy, ix)
    print q
    m = Measurement.measure(q, ix)
    print m, q
    Gates.CNOT(q, iy, ix)
    print m, q
    Gates.H(q, iy)
    print m, q
    Gates.H(q, ix)
    print m, q


def mZX(q, ix, iy):
    Gates.H(q, iy)
    Gates.CNOT(q, iy, ix)
    m = Measurement.measure(q, ix)
    Gates.CNOT(q, iy, ix)
    Gates.H(q, iy)
    print m, q


q = Qubits(2)
Gates.H(q, 0)
Gates.H(q, 1)
Gates.CY(q, 1, 0)
Gates.CZ(q, 0, 1)
Gates.Z(q, 0)
Gates.Z(q, 1)

print(q)