import sys; sys.path.append("..")
import qusetta as qs

# The first element of the circuit is a column of Hadamards
circuit = "H(0); H(1); H(2); "

# next we have exp(-i z_0 z_1 gamma / 2)
circuit += "CX(0, 1); RZ({gamma})(1); CX(0, 1); "

# now the same for exp(-i z_1 z_2 gamma / 2)
circuit += "CX(1, 2); RZ({gamma})(2); CX(1, 2); "

# now we have a row of x rotations by beta
circuit += "RX({beta})(0); RX({beta})(1); RX({beta})(2)"

def qusetta_qaoa_circuit(beta, gamma):
    return circuit.format(beta=beta, gamma=gamma).split("; ")

print(qusetta_qaoa_circuit("beta", "gamma"))

c = qusetta_qaoa_circuit("PI/2", "PI/4")
print(c)

print(qs.Cirq.from_qusetta(c))

print(qs.Quasar.from_qusetta(c))

print(qs.Qiskit.from_qusetta(c))