Skip to content

Releases: Qaqarot/qaqarot

Blueqat 0.3.16

20 May 07:59
4d4d618
Compare
Choose a tag to compare

This is hotfix of 0.3.15 bug.
Sorry for inconvenient.

Changes

Vqe() class

When sampler is default, make sparse matrix and calculate expectation directly.
This is for performance improvement.
(If you're using default sampler, your VQE code is speed-up without any changes.)

VQE is still under refactoring process and this API may be changed in future release, however, because this feature is very important, I want to merge this feature in the master.

Many cases of VQEs, this change makes fantastic speed-ups.
However, some cases, this change makes slow down.

To make previous default behaviour, specify sampler as previous default sampler.

from blueqat.vqe import Vqe, non_sampling_sampler
hamiltonian = ...
Vqe(hamiltonian, sampler=non_sampling_sampler)

pauli.to_matrix() qubit order is reordered.

Previous: X[0] * Y[1] is X ⊗ Y
New: X[0] * Y[1] is Y ⊗ X

New behavior is equivalent with Blueqat circuit's statevector order.

Blueqat 0.3.15

20 May 04:50
Compare
Choose a tag to compare

This version contains critical bug. Please use 0.3.16 or later version.

Changes

Vqe() class

When sampler is default, make sparse matrix and calculate expectation directly.
This is for performance improvement.
(If you're using default sampler, your VQE code is speed-up without any changes.)

VQE is still under refactoring process and this API may be changed in future release, however, because this feature is very important, I want to merge this feature in the master.

Many cases of VQEs, this change makes fantastic speed-ups.
However, some cases, this change makes slow down.

To make previous default behaviour, specify sampler as previous default sampler.

from blueqat.vqe import Vqe, non_sampling_sampler
hamiltonian = ...
Vqe(hamiltonian, sampler=non_sampling_sampler)

Blueqat 0.3.14

12 May 09:05
Compare
Choose a tag to compare

Release Date: 12 May. 2020

Features

  • Add new gates, rxx, ryy, rzz, cswap.
  • Add Circuit.dagger. Circuit().rx(0.1)[0].cx[0, 1].t[0].dagger() is Circuit().tdg[0].cx[0, 1].rx(-0.1)[0].
  • Add mixer argument for QaoaAnsatz. (This feature may be changed in the future.) This is for Quantum Alternative Operator Ansatz.
  • Add sparse option for pauli.Expr.to_unitary. It returns scipy's sparse matrix. (X[0] + Y[3]).to_matrix(sparse='csc') # csc matrix The performance for larger qubits expr is better than (default's) dense matrix, but still not fast.

Experimental

Add blueqat.experimental.utils.circuit_to_unitary. It returns unitary matrix instead of statevector.
Blueqat already has to_unitary method for sympy's unitary gate.
However, this function runs the circuit with a backend which returns statevector.
This feature is useful for debugging the circuit, and it's too heavy for larger circuit.

Install

New install
pip install blueqat

Update
pip install -U blueqat

Blueqat 0.3.13

28 Jan 03:30
Compare
Choose a tag to compare

Release Date: 28 Jan. 2020

Bug Fix

To avoiding qgate 0.2.1 bug, Blueqat had implementation of workaround.
However, Blueqat workaround has bug.

Now, bug fixed version qgate 0.2.2 was released.
So, workaround was removed. It works well!

Experimental

Experimental feature is available in "blueqat.experimental" module.
This is unstable features. It may modified or deleted.

Install

New install
pip install blueqat

Update
pip install -U blueqat

Blueqat 0.3.12

20 Jan 12:54
Compare
Choose a tag to compare

Release Date: 20 Jan. 2020

New features

Circuit repr

Circuit.__repr__ method is implemented.
Now, Circuit is printable.

c = Circuit().x[0].rz(1.2)[1]
c.cx[0, 1]
print(c)
# => Circuit(2).x[0].rz(1.2)[1].cx[0, 1]

Modifications

Adjust global phase

These are Blueqat standard implementation of global phase.

RZ and U1 gate:

[e^-iθ/2, 0],
[0, e^iθ/2]

Phase gate (, S gate [θ=π/2], S† gate [θ=-π/2], T gate [θ=π/4], T† gate [θ=-π/4]):

[1, 0],
[0, e^iθ]

U3 gate (, U2 gate [θ=π/2] ):

[e^-i(φ+λ)/2 cos θ/2, -e^-i(φ-λ)/2 sin θ/2],
[e^i(φ-λ)/2 sin θ/2, e^i(φ+λ)/2 cos θ/2]

CRZ gate:

[1, 0, 0, 0],
[0, 1, 0, 0],
[0, 0, e^-iθ/2, 0],
[0, 0, 0, e^iθ/2]

CPhase, CU1 gate:

[1, 0, 0, 0],
[0, 1, 0, 0],
[0, 0, 1, 0],
[0, 0, 0, e^iθ]

CU3 gate (, CU2 gate [θ=π/2] ):

[1, 0, 0, 0],
[0, 1, 0, 0],
[0, 0, e^-i(φ+λ)/2 cos θ/2, -e^-i(φ-λ)/2 sin θ/2],
[0, 0, e^i(φ-λ)/2 sin θ/2, e^i(φ+λ)/2 cos θ/2]

Note that the phase of U1 and CU1 are not corresponded.
This is due to OpenQASM's qelib1.inc implementations.
We recommend to use RZ/CRZ and PHASE/CPHASE instead of U1/CU1 gate if the circuit is not ported from Qiskit/OpenQASM.

Bug Fix

numba backend

Correct bugs in controlled gate of numba backend

Install

New install
pip install blueqat

Update
pip install -U blueqat

Blueqat 0.3.11

14 Jan 06:47
Compare
Choose a tag to compare

Release Date: 14 Jan. 2020

New features

Enhance IBM Q backend "returns" option

Add some Circuit().run_with_ibmq(returns=...) options:

  • shots: (default) Returns measurement result
  • _exception: If error occurs during importing qiskit, returns exception. otherwise, returns None.
  • draw: (NEW): Draw the circuit via Qiskit QuantumCircuit.draw
  • qiskit_circuit: (NEW): Returns Qiskit QuantumCircuit object
  • qiskit_job: (NEW): Returns Qiskit Job object
  • qiskit_result: (NEW) Returns Qiskit Result object

Usage of draw option

# For command line console
print(Circuit().h[0].cx[0, 1].m[:].run_with_ibmq(returns='draw'))

# For Jupyter Notebook (matplotlib required)
%matplotlib inline
Circuit().h[0].cx[0, 1].m[:].run_with_ibmq(returns='draw', output='mpl')

Modifications

Adjust global phase

Adjust global phase for some gates.

Add gates

Add cy (controlled-y), ch (controlled-h), phase, cphase gates.
phase gate is as same as rz gate except global phase.

rz:
[ e^-iθ/2, 0]
[0, e^iθ/2]

phase:
[1, 0]
[0, e^iθ]

cphase gate is controlled-phase gate.
This gate is useful for QFT.

rz gate and phase gate are same gates without global phase,
however, crz (controlled-rz) gate and cphase gates are different gate.

Usage of phase/cphase gate

from math import pi
# phase gate
Circuit().phase(pi)[0]
# This is also phase gate
Circuit().r(pi)[0]

# cphase gate
Circuit().cphase(pi)[0]
# This is also cphase gate
Circuit().cr(pi)[0]

Bug Fix

numba backend

Correct bugs in cnot gate and cz gate of numba backend

Install

New install
pip install blueqat

Update
pip install -U blueqat

Blueqat 0.3.10

19 Sep 12:09
Compare
Choose a tag to compare

Release Date: 19 Sep. 2019

New features

ignore_global option for numpy and numba backend.

Blueqat ignores global phase of statevectors.
But it makes debugging difficult.
We added ignore_global option to disable ignoring global phase.

Circuit().x[0].phase(0.123)[0].run()
=> array([0.+0.j, 1.+0.j]) Global phase is ignored.

Circuit().x[0].phase(0.123)[0].run(ignore_global=False)
=> array([0. +0.j , 0.99244503+0.12269009j]) Global phase is not ignored.

Related to this change, we will modify global phases for some gates in future release.

Modifications

Modify IBMQ backend for new qiskit

Modify for qiskit~=0.11.1

Modify scipy requirements version

Now, required scipy version is scipy>1.1.0

Install

New install
pip install blueqat

Update
pip install -U blueqat

Blueqat 0.3.9

02 Aug 06:21
09096a4
Compare
Choose a tag to compare

Release Date: 2 Aug. 2019

New features

Implemented Controlled-RX, RY, RZ.

Install

New install
pip install blueqat

Update
pip install -U blueqat

Blueqat 0.3.8

29 Jul 06:13
Compare
Choose a tag to compare

Release date: 2019 Jul. 29

New features

qgate backend (Thanks to Morino san): New backend for qgate.

qgate is required for this backend.

Usage: Circuit().h[:10].run(backend='qgate', shots=1000) or Circuit().h[:10].run(backend='qgate', runtime='cuda', shots=1000)

numba backend: New backend using numba.

Usage: Circuit().h[:10].run(backend='numba')

Add test for other backends

To add backend, run python -m pytest ./test --add-backend numba --add-backend qgate.

Small modifications and debugging

Installation

pip install blueqat