Requirement already up-to-date: blueqat in /opt/conda/lib/python3.8/site-packages (0.4.1)
Requirement already satisfied, skipping upgrade: numpy~=1.12 in /opt/conda/lib/python3.8/site-packages (from blueqat) (1.19.1)
Requirement already satisfied, skipping upgrade: scipy>=1.1.0 in /opt/conda/lib/python3.8/site-packages (from blueqat) (1.4.1)
Copy
from blueqat import vqe
from blueqat.pauli import qubo_bit as q
h = 2*q(1)-4*q(0)*q(1)
step = 2
result = vqe.Vqe(vqe.QaoaAnsatz(h, step)).run()
print(result.most_common(12))
from blueqat import Circuit
from blueqat.pauli import X, Y, Z, I
#mixer and init state
mixer = 0.5*X[0]*X[1] + 0.5*Y[0]*Y[1]
init = Circuit().h[0].cx[0,1].x[0]
h = 2*q(1)-4*q(0)*q(1)
step=2
result = vqe.Vqe(vqe.QaoaAnsatz(h, step, init, mixer)).run()
print(result.most_common(12))
c = Circuit(2).rzz(28.48504526568177)[0,1].rz(-28.48504526568177)[0].rxx(-13.395826737916892)[0,1].rx(-1.5707963267948966)[0].rx(-1.5707963267948966)[1].rzz(-13.395826737916892)[0,1].rx(1.5707963267948966)[0].rx(1.5707963267948966)[1].rzz(29.964021341813513)[0,1].rz(-29.964021341813513)[0].rxx(-9.00039424636803)[0,1].rx(-1.5707963267948966)[0].rx(-1.5707963267948966)[1].rzz(-9.00039424636803)[0,1].rx(1.5707963267948966)[0].rx(1.5707963267948966)[1].m[:]
c.run(shots=1000, initial=vec)