Ejemplo n.º 1
0
def test_CY(benchmark, nbit):
    run_bench(benchmark, ops.C(ops.Y), (2, 4), nbit)
Ejemplo n.º 2
0
def test_CZ(benchmark, nbit):
    run_bench(benchmark, ops.C(ops.Z), (2, 4), nbit)
Ejemplo n.º 3
0
def test_CH(benchmark, nbit):
    run_bench(benchmark, ops.C(ops.H), (2, 4), nbit)
Ejemplo n.º 4
0
def test_CY(benchmark, nqubits):
    benchmark.group = "C-Rx(0.5)"
    run_bench(benchmark, ops.C(ops.Rx(0.5)), (2, 3), nqubits)
import numpy as np
np.set_printoptions(precision=2)

# create a main compiler engine
drawing_engine = CircuitDrawer()
eng = MainEngine(drawing_engine)

a = eng.allocate_qubit()
b = eng.allocate_qubit()
c = eng.allocate_qubit()

pi = 3.14
mpi = -3.14

ops.Rz(pi/2) | a
ops.Rx(pi/2) | a
ops.Rx(mpi) | b
ops.C(ops.Z) | (b, a)
ops.Rz(pi/2) | c
ops.Rx(pi/2) | c
ops.C(ops.Z) | (b, c)
ops.Rz(mpi/2) | a
ops.Rz(mpi/2) | b
ops.Rx(mpi/2) | b
ops.Rz(pi/2) | b
ops.Rz(mpi/2) | c


eng.flush()
print(drawing_engine.get_latex())
Ejemplo n.º 6
0
def bCRot(G):
    return lambda qureg: ops.C(G(0.5))|(qureg[2], qureg[5])
Ejemplo n.º 7
0
def bCG(G):
    return lambda qureg: ops.C(G)|(qureg[2], qureg[5])