-
Notifications
You must be signed in to change notification settings - Fork 2.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Prepare 0.20.0 release #7828
Prepare 0.20.0 release #7828
Changes from 21 commits
aa6ac9a
9c139f1
5cfa21f
95cbcba
cac7ce2
d98b1e6
efe4e31
cc1584a
4e36275
40d0d5b
4d0e84f
19e6419
fe03e6a
c6fc57c
33438c1
bfecdd8
f3ec376
c7a35f4
61bfb2a
caa7acc
0ba0592
770c7dd
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
.. _qiskit-qasm3: | ||
|
||
.. automodule:: qiskit.qasm3 | ||
:no-members: | ||
:no-inherited-members: | ||
:no-special-members: |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -23,6 +23,7 @@ Qiskit Terra API Reference | |
scheduler | ||
synthesis | ||
primitives | ||
qasm3 | ||
qasm | ||
qobj | ||
qpy | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -61,6 +61,7 @@ | |
RZZGate | ||
RZXGate | ||
XXPlusYYGate | ||
XXMinusYYGate | ||
ECRGate | ||
SGate | ||
SdgGate | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
--- | ||
features: | ||
- | | ||
Added a new method :meth:`.DAGCircuit.copy_empty_like` | ||
to the :class:`~.DAGCircuit` class. This method is used to create a new | ||
copy of an existing :class:`.DAGCircuit` object with the | ||
same structure but empty of any instructions. This method is the same as | ||
the private method ``_copy_circuit_metadata()``, but instead is now | ||
part of the public API of the class. |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
--- | ||
feature: | ||
- | | ||
The fake backend and fake provider classes which were previously available | ||
in ``qiskit.test.mock`` are now also accessible in a new module: | ||
``qiskit.providers.fake_provider``. This new module supersedes the previous | ||
module ``qiskit.test.mock`` which will be deprecated in Qiskit 0.21.0. |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
--- | ||
fixes: | ||
- | | ||
Added a missing entry from the standard session equivalence library | ||
between :class:`.CXGate` and :class:`.CPhaseGate` as well as between | ||
:class:`~.CXGate` and :class:`~.CRZGate`. |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
--- | ||
|
||
features: | ||
- | | ||
Added a new gate class, :class:`.LinearFunction`, that efficiently encodes | ||
a linear function (i.e. a function that can be represented by a sequence | ||
of :class:`.CXGate` and :class:`.SwapGate` gates). | ||
- | | ||
Added a new transpiler pass :class:`.CollectLinearFunctions` that collects | ||
blocks of consecutive :class:`.CXGate` and :class:`.SwapGate` gates in a | ||
circuit, and replaces each block with a :class:`.LinearFunction` gate. | ||
- | | ||
Added a new transpiler pass :class:`.LinearFunctionsSynthesis` | ||
that synthesizes any :class:`.LinearFunction` gates in using the | ||
`Patel-Markov-Hayes algorithm <https://arxiv.org/abs/quant-ph/0302002>`__. | ||
When combined with the :class:`.CollectLinearFunctions` transpiler pass | ||
this enables to collect blocks of consecutive :class:`.CXGate` and | ||
:class:`.SwapGate` gates in a circuit, and re-synthesize them using the | ||
`Patel-Markov-Hayes algorithm <https://arxiv.org/abs/quant-ph/0302002>`__. | ||
- | | ||
Added a new transpiler pass :class:`.LinearFunctionsToPermutations` that | ||
replaces a :class:`.LinearFunction` gate by a :class:`.Permutation` circuit | ||
whenever possible. | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
|
||
features: | ||
- | | ||
:class:`~.FlowController` classes (such as :class:`~.ConditionalController`) | ||
can now be nested inside a :class:`~.PassManager` instance when using the | ||
:meth:`.PassManager.append` method. This enables the use of nested logic to | ||
control the execution of passes in the :class:`~.PassManager`. For example:: | ||
|
||
from qiskit.transpiler import ConditionalController, PassManager | ||
from qiskit.transpiler.passes import ( | ||
BasisTranslator, GatesInBasis, Optimize1qGatesDecomposition, FixedPoint, Depth | ||
) | ||
from qiskit.circuit.equivalence_library import SessionEquivalenceLibrary as sel | ||
|
||
pm = PassManager() | ||
|
||
def opt_control(property_set): | ||
return not property_set["depth_fixed_point"] | ||
|
||
def unroll_condition(property_set): | ||
return not property_set["all_gates_in_basis"] | ||
|
||
depth_check = [Depth(), FixedPoint("depth")] | ||
opt = [Optimize1qGatesDecomposition(['rx', 'ry', 'rz', 'rxx'])] | ||
unroll = [BasisTranslator(sel, ['rx', 'ry', 'rz', 'rxx'])] | ||
unroll_check = [GatesInBasis(['rx', 'ry', 'rz', 'rxx'])] | ||
flow_unroll = [ConditionalController(unroll, condition=unroll_condition)] | ||
|
||
pm.append(depth_check + opt + unroll_check + flow_unroll, do_while=opt_control) | ||
|
||
The ``pm`` :class:`~.PassManager` object will only execute the | ||
:class:`.BasisTranslator` pass (in the ``unroll`` step) in each loop | ||
iteration if the ``unroll_condition`` is met. |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
--- | ||
features: | ||
- | | ||
The constructors for the :class:`~qiskit.circuit.library.ZFeatureMap` and | ||
:class:`~qiskit.circuit.library.ZZFeatureMap` classes have a new keyword | ||
argument ``parameter_prefix``. This new argument is used to set the prefix | ||
of parameters of the data encoding circuit. For example: | ||
|
||
.. jupyter-execute:: | ||
|
||
from qiskit.circuit.library import ZFeatureMap | ||
|
||
feature_map = ZFeatureMap(feature_dimension=4, parameter_prefix="my_prefix") | ||
feature_map.decompose().draw('mpl') | ||
|
||
the generated :class:`~qiskit.circuit.library.ZFeatureMap` circuit has | ||
prefixed all its internal parameters with the prefix ``"my_prefix"``. |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
--- | ||
features: | ||
- | | ||
The :class:`.DAGOpNode`, :class:`.DAGInNode` and :class:`.DAGOutNode` | ||
classes now define a custom ``__repr__`` method which outputs a | ||
representation. Per the | ||
`Python documentation <https://docs.python.org/3/library/functions.html#repr>`__ | ||
the output is a string representation that is roughly equivalent to the | ||
Python string used to create an equivalent object. |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
--- | ||
features: | ||
- | | ||
The performance of the :meth:`.SparsePauliOp.simplify` method has | ||
greatly improved by replacing the use of ``numpy.unique`` to compute unique | ||
elements of an array by a new similar function implemented in Rust that | ||
doesn't pre-sort the array. | ||
- | | ||
Added a new method :meth:`~qiskit.quantum_info.SparsePauliOp.equiv` to the | ||
:class:`~.SparsePauliOp` class for testing the equivalence of a | ||
:class:`~.SparsePauliOp` with another :class:`.SparsePauliOp` object. | ||
Unlike the ``==`` operator which compares operartors element-wise, | ||
:meth:`~qiskit.quantum_info.SparsePauliOp.equiv` compares whether two | ||
operators are equivalent or not. For example:: | ||
|
||
op = SparsePauliOp.from_list([("X", 1), ("Y", 1)]) | ||
op2 = SparsePauliOp.from_list([("X", 1), ("Y", 1), ("Z", 0)]) | ||
op3 = SparsePauliOp.from_list([("Y", 1), ("X", 1)]) | ||
|
||
print(op == op2) # False | ||
print(op == op3) # False | ||
print(op.equiv(op2)) # True | ||
print(op.equiv(op3)) # True | ||
|
||
fixes: | ||
- | | ||
Fixed an issue where running the ``==`` operator between two | ||
:class:`~.SparsePauliOp` objects would raise an error when the two operators | ||
had different numbers of coefficients. For example:: | ||
|
||
op = SparsePauliOp.from_list([("X", 1), ("Y", 1)]) | ||
op2 = SparsePauliOp.from_list([("X", 1), ("Y", 1), ("Z", 0)]) | ||
print(op == op2) | ||
|
||
This would previously raise a ``ValueError`` instead of returning ``False``. |
Original file line number | Diff line number | Diff line change | ||||
---|---|---|---|---|---|---|
@@ -0,0 +1,13 @@ | ||||||
--- | ||||||
fixes: | ||||||
- | | ||||||
Fixed support in :func:`~qiskit.compiler.transpile` for passing a | ||||||
:class:`~.InstructionScheduleMap` to object to the underlying | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
|
||||||
:class:`~qiskit.transpiler.PassManager` based on the | ||||||
:class:`~qiskit.transpiler.Target` for | ||||||
:class:`~qiskit.providers.backend.BackendV2` based backends. Previously, | ||||||
the :func:`~qiskit.compiler.transpile` function would not do this | ||||||
processing and any transpiler passes which do not support working with | ||||||
a :class:`~.Target` object yet would not have access to the default | ||||||
pulse calibrations for the instructions from a | ||||||
:class:`~qiskit.providers.backend.BackendV2` backend. |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
--- | ||
features: | ||
- | | ||
Added new fake backend classes from snapshots of the IBM Quantum systems | ||
based on the :class:`~.BackendV2` interface and provided a | ||
:class:`~qiskit.transpiler.Target` for each backend. :class:`~.BackendV2` | ||
based versions of all the existing backends are added except for three old | ||
backends ``FakeRueschlikon``, ``FakeTenerife`` and ``FakeTokyo`` as they | ||
do not have snapshots files available which are required for creating | ||
a new fake backend class based on :class:`~.BackendV2`. | ||
|
||
These new V2 fake backends will enable testing and development of new | ||
features introduced by :class:`~qiskit.providers.backend.BackendV2` and | ||
:class:`~qiskit.transpiler.Target` such as improving the transpiler. |
Original file line number | Diff line number | Diff line change | ||||||||
---|---|---|---|---|---|---|---|---|---|---|
@@ -0,0 +1,8 @@ | ||||||||||
--- | ||||||||||
features: | ||||||||||
- | | ||||||||||
Added a new gate gate class :class:`~qiskit.circuit.library.XXMinusYYGate` | ||||||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Ah I just saw Kevin beat me to this correction 😄 |
||||||||||
to the circuit library (:mod:`qiskit.circuit.library`) for the XX-YY | ||||||||||
interaction. This gate can be used to implement the | ||||||||||
`bSwap gate <https://arxiv.org/abs/1208.1287>`__ and its powers. It also | ||||||||||
arises in the simulation of superconducting fermionic models. |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
--- | ||
|
||
features: | ||
- | | ||
Added new gate class, :class:`~qiskit.circuit.library.XXPlusYYGate`, to | ||
the circuit library (:mod:`qiskit.circuit.library`). This gate is a | ||
2-qubit parameterized XX+YY interaction, also known as an XY gate, and is | ||
based on the gate described in https://arxiv.org/abs/1912.04424. |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
--- | ||
features: | ||
- | | ||
The ``FakeBogota``, ``FakeManila``, ``FakeRome``, and ``FakeSantiago`` fake | ||
backends which can be found in the ``qiskit.providers.fake_provider`` module can now be | ||
used as backends in Pulse experiments as they now include a | ||
:class:`~qiskit.providers.models.PulseDefaults` created from a snapshot of | ||
the equivalent IBM Quantum machine's properties. |
Original file line number | Diff line number | Diff line change | ||||
---|---|---|---|---|---|---|
@@ -0,0 +1,36 @@ | ||||||
--- | ||||||
upgrade: | ||||||
- | | ||||||
The previously deprecated ``MSGate`` gate class previously found in | ||||||
:mod:`qiskit.circuit.library` has been removed. It was originally deprecated in the | ||||||
0.16.0 release. Instead the :class:`~qiskit.circuit.library.GMS` class should be used, as | ||||||
this allows you to create an equivalent 2 qubit MS gate in addition to | ||||||
an MSGate for any number of qubits. | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
|
||||||
- | | ||||||
The previously deprecated ``mirror()`` method of the :class:`~qiskit.circuit.Instruction` | ||||||
class has been removed. It was originally deprecated in 0.15.0 release. Instead you should | ||||||
use :meth:`.Instruction.reverse_ops`. | ||||||
- | | ||||||
The previously deprecated ``num_ancilla_qubits()`` method of the | ||||||
:class:`qiskit.circuit.library.PiecewiseLinearPauliRotations` and | ||||||
:class:`qiskit.circuit.library.WeightedAdder` classes has been removed. It was originally | ||||||
deprecated in the 0.16.0 release. Instead the | ||||||
:meth:`.PiecewiseLinearPauliRotations.num_ancillas` and :meth:`.WeightedAdder.num_ancillas` | ||||||
methods should be used. | ||||||
- | | ||||||
The previously deprecated ``reverse`` argument on the constructor for the | ||||||
:class:`~qiskit.circuit.library.PolynomialPauliRotations` class has been removed. It | ||||||
was originally deprecated in the 0.15.0 release. Instead you should use the | ||||||
:meth:`.QuantumCircuit.reverse_bits` method to reverse the | ||||||
:class:`~qiskit.circuit.library.PolynomialPauliRotations` circuit if needed. | ||||||
- | | ||||||
The previously deprecated ``angle`` argument on the constructors for the | ||||||
:class:`~qiskit.circuit.library.C3SXGate` and :class:`~qiskit.circuit.library.C3XGate` | ||||||
gate classes has been removed. It was originally deprecated in the 0.17.0 release. Instead | ||||||
for fractional 3-controlled X gates you can use the :meth:`.C3XGate.power` method. | ||||||
- | | ||||||
Support for using ``np.ndarray`` objects as part of the :attr:`~qiskit.circuit.Gate.params` attribute | ||||||
of a :class:`~qiskit.circuit.Gate` object has been removed. This has been deprecated | ||||||
since Qiskit Terra 0.16.0 and now will no longer work. Instead one should create a new subclass | ||||||
of :class:`~qiskit.circuit.Gate` and explicitly allow a ``np.ndarray`` input by overloading the | ||||||
:meth:`~.Gate.validate_parameter` method. |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
--- | ||
|
||
features: | ||
- | | ||
The :class:`~qiskit.transpiler.passes.ConsolidateBlocks` pass has a new | ||
keyword argument on its constructor, ``target``. This argument is used to | ||
specify a :class:`~qiskit.transpiler.Target` object representing the | ||
compilation target for the pass. If it is specified it supersedes the | ||
``basis_gates`` kwarg. If a target is specified, the pass will respect the | ||
gates and qubits for the instructions defined in the | ||
:class:`~qiskit.transpiler.Target` when deciding which gates to consolidate | ||
into a unitary. | ||
- | | ||
The :class:`~qiskit.transpiler.Target` class has a new method, | ||
:meth:`~qiskit.transpiler.Target.instruction_supported` which is used | ||
to query the target to see if an instruction (the combination of an | ||
operation and the qubit(s) it is executed on) is supported on the backend | ||
modelled by the :class:`~qiskit.transpiler.Target`. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.