Blueqat

Latest version: v2.0.4

Safety actively analyzes 630169 Python packages for vulnerabilities to keep your Python projects secure.

Scan your dependencies

Page 5 of 6

0.3.13

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`

0.3.12

Release Date: 20 Jan. 2020

New features
Circuit repr
`Circuit.__repr__` method is implemented.
Now, `Circuit` is printable.

py
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`

0.3.11

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**
py
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**
py
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`

0.3.10

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`

0.3.9

Release Date: 2 Aug. 2019

New features
Implemented Controlled-RX, RY, RZ.

Install
New install
`pip install blueqat`

Update
`pip install -U blueqat`

0.3.8

Release date: 2019 Jul. 29
New features
qgate backend (Thanks to Morino san): New backend for [qgate](https://github.com/shinmorino/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`

Page 5 of 6

© 2024 Safety CLI Cybersecurity Inc. All Rights Reserved.