Skip to content

Blueqat 0.3.11

Choose a tag to compare

@gyu-don gyu-don released this 14 Jan 06:47
· 391 commits to master since this release

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