Releases: Qaqarot/qaqarot
Releases · Qaqarot/qaqarot
blueqat 2.0.4 - 2023-04-02
New cuQuantum Backend both on cuStateVec and cuTensorNet
limited gate support with cusv and cutn backend.
blueqat 2.0.0 - 2022-05-22
New default backend based on Tensor Network
The back end has been changed to the tensor network. The previous backend environment can still be used with .run(backend="numpy").
New QAOA function
QAOA function is changed to the tensornetwork based.
blueqat 1.0.4 - 2022-05-14
bug fixed on qaoa
blueqat 1.0.3 - 2022-05-14
QAOA with Tensornetwork
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)
blueqat 1.0.2 - 2022-05-14
Bug fixed
blueqat 1.0.0 - 2022-05-06
Added backend for tensor network
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")
Get the single amplitude
Circuit(4).h[:].run(backend="quimb", amplitude="0101")
Get the sample
Circuit(4).h[:].run(backend="quimb", shots=100)
Get the expectation value of hamiltonian
from blueqat.pauli import Z
hamiltonian = 1*Z[0]+1*Z[1]
Circuit(4).x[:].run(backend="quimb", hamiltonian=hamiltonian)
blueqat 0.6.0 - 2022-04-18
Photonics Continuous Variable Programming Integrated
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)
blueqat 0.5.0 - 2022-04-17
Circuit Drawing
- Circuit drawing function with networkx
Circuit.h[0].cx[0,1].run(backend="draw")
blueqat 0.4.9 - 2022-02-08
Debug
- Correct
TGate.matrix()
,TDagGate.matrix()
,IGate.matrix()
Experimental Feature
- New sampling feature is available in the numpy backend. This feature may effective for mid-circuit measurement.
# Specify `m(key="keyname")` in the measurement and `run(shots=..., returns="samples").
Circuit().x[1].m(key="key1")[0, 1].x[0].m(key="key2")[0, 1].run(shots=5, returns="samples")
# It returns
[{'key1': [0, 1], 'key2': [1, 1]},
{'key1': [0, 1], 'key2': [1, 1]},
{'key1': [0, 1], 'key2': [1, 1]},
{'key1': [0, 1], 'key2': [1, 1]},
{'key1': [0, 1], 'key2': [1, 1]}]
# You get 5 samples for each measured keys.
# When run(returns="sample"), measured result without the key is omitted.
# If the key is duplicated, another option is needed, "replace" or "append".
# "replace" pattern
Circuit().x[0].m(key="a")[:].x[0].m(key="a", duplicated="replace")[0].run(shots=2, returns="samples")
# It returns
[{'a': [0]}, {'a': [0]}]
# So, the first measured result of key "a" is omitted and replaced to second one.
# "append" pattern
Circuit().x[0].m(key="a")[:].x[0].m(key="a", duplicated="append")[0].run(shots=2, returns="samples")
# It returns
[{'a': [1, 0]}, {'a': [1, 0]}]
# So, the second measured result is appended to first one.
Changes
- Circuit JSON scheme is updated due to experimental features.
Internal Changes
Implementation of gates are changed
blueqat 0.4.8 - 2021-10-15
New feature
- Builtin-macros
mcx_with_ancilla(ctrl: list[int], target: int, ancilla: int) -> Circuit
mcz_with_ancilla(ctrl: list[int], target: int, ancilla: int) -> Circuit
Major changes
- Remove wq module
- We recommend using dwave-ocean-sdk library for annealing task.
wq.pauli
function (It translates QUBO to pauli matrix for QAOA) is moved topauli.to_qubo
function.
Minor changes
- Internal implementation of Circuit
- It cheats type-checker likes pyright for suppressing errors.