Quantum Computer Library for Everyone
Updated basic CPU and GPU TN backend
beta version of cuTensorNet is available to run .run(backend="cuTN")
bug fixed on qaoa
from blueqat.utils import qaoa
from blueqat import Circuit
from blueqat.pauli import qubo_bit as q
from blueqat.pauli import X,Y,Z,I
hamiltonian = (15-(1+2*q(0)+4*q(1))*(1+2*q(2)))**2
step = 1
init = Circuit().h[0].cx[0,1].x[0]
mixer = (X[0]*X[1]+Y[0]*Y[1])*0.5
result = qaoa(hamiltonian, step, init, mixer)
result.circuit.run(backend="quimb", shots=1000)
Bug fixed
The backend of blueqat will be changed to tensor network in the near future. Now try specifying the back end as "quimb".
from blueqat import Circuit
Circuit(50).h[:].run(backend="quimb")
Circuit(4).h[:].run(backend="quimb", amplitude="0101")
Circuit(4).h[:].run(backend="quimb", shots=100)
from blueqat.pauli import Z
hamiltonian = 1*Z[0]+1*Z[1]
Circuit(4).x[:].run(backend="quimb", hamiltonian=hamiltonian)
from blueqat import photonqat as pq
import numpy as np
import matplotlib.pyplot as plt
# mode number = 2, cutoff dimension = 15
F = pq.Fock(2, cutoff = 15)
alpha = (1 + 1j)
r = -0.5
F.D(0, alpha) # Displacement to mode 0
F.S(1, r) # Squeezeng to mode 1
F.run()
# Plot Wigner fucntion for mode 0 using matplotlib
(x, p, W) = F.Wigner(0, plot = 'y', xrange = 5.0, prange = 5.0)
Circuit.h[0].cx[0,1].run(backend="draw")