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, returnsNone.draw: (NEW): Draw the circuit via Qiskit QuantumCircuit.drawqiskit_circuit: (NEW): Returns Qiskit QuantumCircuit objectqiskit_job: (NEW): Returns Qiskit Job objectqiskit_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