0.2.0
New Features
-
Adds the
get_qubitmethod to the Circuit class allowing for the retrieval of qubits in the circuit by label.circuit = Circuit() circuit.add_qubit(Qubit("my_qubit")) qubit = circuit.get_qubit("my_qubit")
-
Add support for mid-circuit measurements.
-
Add support for operations conditioned on measurements.
-
Add support for measurement sampling and expectation value calculations.
-
Circuit context returns the classical register together with
QuantumRegister. The two
registers are contained within a tuple and are returned aswith circuit.context as (q, c),
instead ofwith circuit.context as q.circuit = Circuit(2, 2) with circuit.context as (q, c): ops.X(q[0])
-
Add a Windows executable makefile (
make.bat) -
Add
make docsandmake clean-docscommands to the makefile for building and
cleaning/removing the documentation locally.
Upgrade Notes
-
Update context to return a
NamedTupleinstead of a regular tuple, allowing for the registers
to be returned as previously, directly unpacked intoqandc, or as a namedRegisters
tuple and retrieved viaRegisters.qandRegisters.crespectively. -
Update parametric context to return a
NamedTupleinstead of a regular tuple similar to the
non-parametric context upgrade, with the parameter register accessed viaRegisters.p.circuit = ParametricCircuit(2, 2) with circuit.context as reg: ops.RX(reg.p[0], reg.q[0])
-
Check types when adding qubits/bits to a circuit and raise a
TypeErrorif an incorrect type
is passed to the method. -
Rename
labeltonamefor operations.
Bug Fixes
-
Fixes an issue where an error is being raised when subsequent measurements are made on the same
qubit. Instead, any subsequent measurement will replace the former one at simulation runtime. -
Fix inconsistent spacing in primitive object representations.
-
Fix sequential qubit/bit labelling when adding new registers.
-
Update operation representations to use
repr()for hashables. -
Adds
pipinstallation step tomake installcommand. -
Expand installation section in the README to include installation on Windows (using
make.bat) and add details to installation steps.