Prepare 0.17.0 release (#6075)

* Prepare 0.17.0 release

To prepare for the upcoming 0.17.0 release this commit moves all the
release notes into a 0.17 subdirectory to keep them separate from future
development notes post-release. It also adds an incomplete release note
to add the prelude section providing the high level overview of the
release. When this merges it should be the commit used to tag the 0.17.0
release.

* Add feature note for aqua migrated modules

* Update release notes abd add piecewise chebyshev to docs and library export

* Update more release notes and add abstract pass classes to docs

* More release note updates

* Update more release notes and add clifford_decompose to api docs

* Add RZXCalibration pass and templates to docs and update release notes

* Update more release notes

* Fix typo in decompose_clifford imports and release notes

* Fix docs build

* Add hellinger_distance to docs

* Add RZXCalibrationBuilder to the docs

* More release note updates

* Fix import error

* Fix RZXCalibrationBuilder docstring

* Finish updating the new feature release notes

* Fix lint

* Apply suggestions from code review

Co-authored-by: Julien Gacon <gaconju@gmail.com>

* Move new release notes to 0.17 dir and update

* Fix RVGate docs and start updating upgrade notes

* Fix PauliGate example circuit visualization

* Fix typo

* More release note updates

* Update meas_map release note again

* Fix whitespace in meas_map release note

* Fix docs build

* Update almost all of the upgrade notes

* Add latex to docs job env

* Revert "Add latex to docs job env"

This reverts commit 8080cb58ea.

* Remove latex drawing from the release notes

Getting the texlive distribution with qcircuit installed in CI is
proving problematic in the interest of time and finishing the other
releasenotes instead of relying on it this just changes the latex drawer
jupyter execute to be a code block and not depend on being able to run
pdftlatex at docs build time.

* Remove fix note for unreleased feature

* Move and update new release notes

* Remove unnecessary upgrade note about internal API changes

* More release note updates

* More release note updates

* Even more release note updates

* Fix syntax error

* Fix docs build

* Move new release notes and fix docs issues from #5609

* Update more release notes

* Move new release notes

* More release note updates

* Finish fixes notes

* Fix docs build

* Update more relaese notes

* Apply suggestions from code review

Co-authored-by: Naoki Kanazawa <nkanazawa1989@gmail.com>

* More note fixes

* Update new release notes

* Apply suggestions from code review

Co-authored-by: Kevin Krsulich <kevin@krsulich.net>

* Move and update new release notes

* Apply suggestions from code review

Co-authored-by: Kevin Krsulich <kevin@krsulich.net>

* cleaning up docs for vqe

* clean up extend

* Fix reno merge commit error

* Revert accidental tox.ini change

* Tweak release note wording

* Move and update new release notes

* Attempt to retrigger azure

Co-authored-by: Julien Gacon <gaconju@gmail.com>
Co-authored-by: Lauren Capelluto <laurencapelluto@gmail.com>
Co-authored-by: Naoki Kanazawa <nkanazawa1989@gmail.com>
Co-authored-by: Kevin Krsulich <kevin@krsulich.net>
Co-authored-by: Jay Gambetta <jay.gambetta@us.ibm.com>
This commit is contained in:
Matthew Treinish 2021-04-01 11:34:13 -04:00 committed by GitHub
parent 49baa6ee52
commit ce15f8a552
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
221 changed files with 1928 additions and 1395 deletions

View File

@ -33,8 +33,8 @@ class QAOA(VQE):
`QAOA <https://arxiv.org/abs/1411.4028>`__ is a well-known algorithm for finding approximate
solutions to combinatorial-optimization problems.
The QAOA implementation directly extends :class:`VQE` and inherits VQE's
general hybrid optimization structure.
The QAOA implementation directly extends :class:`VQE` and inherits VQE's optimization structure.
However, unlike VQE, which can be configured with arbitrary ansatzes,
QAOA uses its own fine-tuned ansatz, which comprises :math:`p` parameterized global
:math:`x` rotations and :math:`p` different parameterizations of the problem hamiltonian.

View File

@ -45,8 +45,8 @@ logger = logging.getLogger(__name__)
class VQE(VariationalAlgorithm, MinimumEigensolver):
r"""The Variational Quantum Eigensolver algorithm.
`VQE <https://arxiv.org/abs/1304.3061>`__ is a hybrid algorithm that uses a
variational technique and interleaves quantum and classical computations in order to find
`VQE <https://arxiv.org/abs/1304.3061>`__ is a quantum algorithm that uses a
variational technique to find
the minimum eigenvalue of the Hamiltonian :math:`H` of a given system.
An instance of VQE requires defining two algorithmic sub-components:

View File

@ -55,6 +55,7 @@ Standard Gates
RCCXGate
RC3XGate
Reset
RGate
RXGate
RXXGate
RYGate
@ -94,6 +95,7 @@ Generalized Gates
GRX
GRY
GRZ
RVGate
Boolean Logic Circuits
======================
@ -136,6 +138,7 @@ Functional Pauli Rotations
PolynomialPauliRotations
PiecewiseLinearPauliRotations
PiecewisePolynomialPauliRotations
PiecewiseChebyshev
Adders
++++++
@ -275,6 +278,44 @@ NCT (Not-CNOT-Toffoli) template circuits
templates.nct.template_nct_9d_9
templates.nct.template_nct_9d_10
Clifford template circuits
==========================
.. autosummary::
:toctree: ../stubs/
clifford_2_1
clifford_2_2
clifford_2_3
clifford_2_4
clifford_3_1
clifford_4_1
clifford_4_2
clifford_4_3
clifford_4_4
clifford_5_1
clifford_6_1
clifford_6_2
clifford_6_3
clifford_6_4
clifford_6_5
clifford_8_1
clifford_8_2
clifford_8_3
RZXGate template circuits
=========================
.. autosummary::
:toctree: ../stubs/
rzx_yz
rzx_xz
rzx_cy
rzx_zz1
rzx_zz2
rzx_zz3
"""
from .standard_gates import *
@ -313,6 +354,7 @@ from .arithmetic import (
WeightedAdder,
QuadraticForm,
LinearAmplitudeFunction,
PiecewiseChebyshev,
)
from .n_local import (
NLocal,

View File

@ -21,3 +21,4 @@ from .polynomial_pauli_rotations import PolynomialPauliRotations
from .weighted_adder import WeightedAdder
from .quadratic_form import QuadraticForm
from .linear_amplitude_function import LinearAmplitudeFunction
from .piecewise_chebyshev import PiecewiseChebyshev

View File

@ -45,7 +45,7 @@ class PiecewiseChebyshev(BlueprintCircuit):
qc = QuantumCircuit(pw_approximation.num_qubits)
qc.h(list(range(num_state_qubits)))
qc.append(pw_approximation.to_instruction(), qc.qubits)
print(qc.draw(output='mpl'))
qc.draw(output='mpl')
References:

View File

@ -18,7 +18,7 @@ from qiskit.circuit.exceptions import CircuitError
class RVGate(Gate):
r"""Rotation around arbitrary rotation axis v where |v| is
r"""Rotation around arbitrary rotation axis :math:`v` where :math:`|v|` is
angle of rotation in radians.
**Circuit symbol:**
@ -33,13 +33,13 @@ class RVGate(Gate):
.. math::
\newcommand{\th}{|\vec{v}|}
\newcommand{\sinc}{\text{sinc}}
R(\vec{v}) = e^{-i \vec{v}\cdot\vec{\sigma}} =
\begin{pmatrix}
\cos{\th} -i v_z \sinc(\th) & -(i v_x + v_y) \sinc(\th) \\
-(i v_x - v_y) \sinc(\th) & \cos(\th) + i v_z \sinc(\th)
\end{pmatrix}
\newcommand{\th}{|\vec{v}|}
\newcommand{\sinc}{\text{sinc}}
R(\vec{v}) = e^{-i \vec{v}\cdot\vec{\sigma}} =
\begin{pmatrix}
\cos{\th} -i v_z \sinc(\th) & -(i v_x + v_y) \sinc(\th) \\
-(i v_x - v_y) \sinc(\th) & \cos(\th) + i v_z \sinc(\th)
\end{pmatrix}
"""
def __init__(self, v_x, v_y, v_z, basis='U'):

View File

@ -75,9 +75,12 @@ from .rzx.rzx_zz3 import rzx_zz3
from .clifford.clifford_2_1 import clifford_2_1
from .clifford.clifford_2_2 import clifford_2_2
from .clifford.clifford_2_3 import clifford_2_3
from .clifford.clifford_2_4 import clifford_2_4
from .clifford.clifford_3_1 import clifford_3_1
from .clifford.clifford_4_1 import clifford_4_1
from .clifford.clifford_4_2 import clifford_4_2
from .clifford.clifford_4_3 import clifford_4_3
from .clifford.clifford_4_4 import clifford_4_4
from .clifford.clifford_5_1 import clifford_5_1
from .clifford.clifford_6_1 import clifford_6_1
from .clifford.clifford_6_2 import clifford_6_2
@ -86,3 +89,4 @@ from .clifford.clifford_6_4 import clifford_6_4
from .clifford.clifford_6_5 import clifford_6_5
from .clifford.clifford_8_1 import clifford_8_1
from .clifford.clifford_8_2 import clifford_8_2
from .clifford.clifford_8_3 import clifford_8_3

View File

@ -103,6 +103,7 @@ Analysis
.. autosummary::
:toctree: ../stubs/
hellinger_distance
hellinger_fidelity
Synthesis
@ -115,6 +116,7 @@ Synthesis
TwoQubitBasisDecomposer
two_qubit_cnot_decompose
Quaternion
decompose_clifford
"""
from .operators import (Operator, ScalarOp, Pauli, Clifford, SparsePauliOp)
@ -139,6 +141,7 @@ from .random import (random_quantum_channel, random_unitary,
random_cnotdihedral)
from .synthesis import (OneQubitEulerDecomposer, TwoQubitBasisDecomposer,
two_qubit_cnot_decompose, Quaternion)
two_qubit_cnot_decompose, Quaternion,
decompose_clifford)
from .analysis import hellinger_fidelity
from .analysis import hellinger_distance, hellinger_fidelity

View File

@ -12,4 +12,4 @@
"""Module for functions for post processing results."""
from .average import average_data
from.distance import hellinger_fidelity
from .distance import hellinger_fidelity, hellinger_distance

View File

@ -15,3 +15,4 @@
from .two_qubit_decompose import TwoQubitBasisDecomposer, two_qubit_cnot_decompose
from .one_qubit_decompose import OneQubitEulerDecomposer
from .quaternion import Quaternion
from .clifford_decompose import decompose_clifford

View File

@ -395,6 +395,15 @@ Fenced Objects
FencedDAGCircuit
FencedPropertySet
Abstract Passes
---------------
.. autosummary::
:toctree: ../stubs/
TransformationPass
AnalysisPass
Exceptions
----------

View File

@ -83,6 +83,7 @@ Scheduling
ALAPSchedule
ASAPSchedule
RZXCalibrationBuilder
Circuit Analysis
================
@ -114,6 +115,8 @@ Additional Passes
CheckMap
CheckCXDirection
CheckGateDirection
CXDirection
GateDirection
MergeAdjacentBarriers
BarrierBeforeFinalMeasurements
@ -179,6 +182,7 @@ from .synthesis import UnitarySynthesis
# circuit scheduling
from .scheduling import ALAPSchedule
from .scheduling import ASAPSchedule
from .scheduling import RZXCalibrationBuilder
from .scheduling import TimeUnitConversion
# additional utility passes

View File

@ -43,8 +43,9 @@ class CommutativeCancellation(TransformationPass):
CommutativeCancellation initializer.
Args:
basis_gates (list[str]): Basis gates to consider, e.g. `['u3', 'cx']`. For the effects
of this pass, the basis is the set intersection between the `basis` parameter
basis_gates (list[str]): Basis gates to consider, e.g.
``['u3', 'cx']``. For the effects of this pass, the basis is
the set intersection between the ``basis_gates`` parameter
and the gates in the dag.
"""
super().__init__()

View File

@ -110,7 +110,8 @@ class RZXCalibrationBuilder(CalibrationCreator):
sample_mult: All pulses must be a multiple of sample_mult.
Returns:
Play: The play instruction with the stretched compressed GaussianSquare pulse.
qiskit.pulse.Play: The play instruction with the stretched compressed
GaussianSquare pulse.
Raises:
QiskitError: if the pulses are not GaussianSquare.

View File

@ -17,7 +17,7 @@ from qiskit.transpiler.passes.utils.check_gate_direction import CheckGateDirecti
class CheckCXDirection(CheckGateDirection):
"""Deprecated: use CheckGateDirection pass."""
"""Deprecated: use :class:`qiskit.transpiler.passes.CheckGateDirection` pass instead."""
def __init__(self, coupling_map):
super().__init__(coupling_map)

View File

@ -17,7 +17,7 @@ from qiskit.transpiler.passes.utils.gate_direction import GateDirection
class CXDirection(GateDirection):
"""Deprecated: use GateDirection pass."""
"""Deprecated: use :class:`qiskit.transpiler.passes.GateDirection` pass instead."""
def __init__(self, coupling_map):
super().__init__(coupling_map)

View File

@ -94,6 +94,14 @@ Single Qubit State Transition Visualizations
visualize_transition
Array/Matrix Visualizations
===========================
.. autosummary::
:toctree: ../stubs/
array_to_latex
Exceptions
==========

View File

@ -207,17 +207,17 @@ def array_to_latex(array, precision=5, prefix="", source=False, max_size=8):
source (bool): If ``False``, will return IPython.display.Latex object. If display is
``True``, will instead return the LaTeX source string.
max_size (list(int) or int): The maximum size of the output Latex array.
* If list(```int```), then the 0th element of the list specifies the maximum
width (including dots characters) and the 1st specifies the maximum height
(also inc. dots characters).
* If a single ```int``` then this value sets the maximum width _and_ maximum
height.
* If list(``int``), then the 0th element of the list specifies the maximum
width (including dots characters) and the 1st specifies the maximum height
(also inc. dots characters).
* If a single ``int`` then this value sets the maximum width _and_ maximum
height.
Returns:
if ``source`` is ``True``:
``str``: LaTeX string representation of the array.
else:
``IPython.display.Latex``: LaTeX representation of the array.
str or IPython.display.Latex: If ``source`` is ``True``, a ``str`` of the LaTeX
representation of the array, else an ``IPython.display.Latex`` representation of
the array.
Raises:
TypeError: If array can not be interpreted as a numerical numpy array.

View File

@ -0,0 +1,17 @@
---
upgrade:
- |
The preset pass managers
:class:`~qiskit.transpiler.preset_passmanagers.level_1_pass_manager`,
:class:`~qiskit.transpiler.preset_passmanagers.level_2_pass_manager`,
and :class:`~qiskit.transpiler.preset_passmanagers.level_3_pass_manager`
(which are used for ``optimization_level`` 1, 2, and 3 in the
:func:`~qiskit.compiler.transpile` and
:func:`~qiskit.execute_function.execute` functions) now unconditionally
use the :class:`~qiskit.transpiler.passes.Optimize1qGatesDecomposition`
pass for 1 qubit gate optimization. Previously, these pass managers would
use the :class:`~qiskit.transpiler.passes.Optimize1qGates` pass if the basis
gates contained ``u1``, ``u2``, or ``u3``. If you want to still use
the old :class:`~qiskit.transpiler.passes.Optimize1qGates` you will need
to construct a custom :class:`~qiskit.transpiler.PassManager` with the
pass.

View File

@ -0,0 +1,24 @@
---
upgrade:
- |
Following transpilation of a parameterized
:class:`~qiskit.circuit.QuantumCircuit`, the
:attr:`~qiskit.circuit.QuantumCircuit.global_phase` attribute of output
circuit may no longer be returned in a simplified form, if the global phase
is a :class:`~qiskit.circuit.ParameterExpression`.
For example::
qc = QuantumCircuit(1)
theta = Parameter('theta')
qc.rz(theta, 0)
qc.rz(-theta, 0)
print(transpile(qc, basis_gates=['p']).global_phase)
previously returned ``0``, but will now return ``-0.5*theta + 0.5*theta``.
This change was necessary was to avoid a large runtime performance
penalty as simplifying symbolic expressions can be quite slow, especially
if there are many :class:`~qiskit.circuit.ParameterExpression` objects
in a circuit.

View File

@ -0,0 +1,15 @@
---
deprecations:
- |
Two new arguments have been added to
:meth:`qiskit.dagcircuit.DAGNode.semantic_eq`, ``bit_indices1`` and
``bit_indices2``, which are expected to map the
:class:`~qiskit.circuit.Bit` instances in each
:class:`~qiskit.dagcircuit.DAGNode` to their index in ``qubits`` or
``clbits`` list of their respective
:class:`~qiskit.dagcircuit.DAGCircuit`. During the deprecation period,
these arguments are optional and when **not** specified the mappings will
be automatically constructed based on the ``register`` and ``index``
properties of each :class:`~qiskit.circuit.Bit` instance. However, in a
future release, they will be required arguments and the mapping will need
to be supplied by the user.

View File

@ -0,0 +1,15 @@
---
fixes:
- |
Fixed an issue where the :func:`~qiskit.execute_function.execute` function
would raise :class:`~qiskit.exceptions.QiskitError` exception when a
:class:`~qiskit.circuit.ParameterVector` object was passed in for the
``parameter_bind`` kwarg. parameter. For example, it is now possible to
call something like::
execute(circuit, backend, parameter_binds=[{pv1: [...], pv2: [...]}])
where ``pv1`` and ``pv2`` are :class:`~qiskit.circuit.ParameterVector`
objects.
Fixed `#5467 <https://github.com/Qiskit/qiskit-terra/issues/5467>`__

View File

@ -0,0 +1,40 @@
---
deprecations:
- |
The :mod:`~qiskit.pulse` builder functions:
* :py:func:`qiskit.pulse.call_circuit`
* :py:func:`qiskit.pulse.call_schedule`
are deprecated and will be removed in a future release.
These functions are unified into :py:func:`qiskit.pulse.call` which should
be used instead.
- |
The :class:`qiskit.pulse.Schedule` method
:py:meth:`qiskit.pulse.Schedule.flatten` method is deprecated and will
be removed in a future release. Instead you can use the
:py:func:`qiskit.pulse.transforms.flatten` function which will perform
the same operation.
features:
- |
The :py:func:`qiskit.pulse.call` function can now take a
:class:`~qiskit.circuit.Parameter` object along with a parameterized
subroutine. This enables assigning different values to the
:class:`~qiskit.circuit.Parameter` objects for each subroutine call.
For example,
.. code-block:: python
from qiskit.circuit import Parameter
from qiskit import pulse
amp = Parameter('amp')
with pulse.build() as subroutine:
pulse.play(pulse.Gaussian(160, amp, 40), DriveChannel(0))
with pulse.build() as main_prog:
pulse.call(subroutine, amp=0.1)
pulse.call(subroutine, amp=0.3)

View File

@ -0,0 +1,8 @@
---
features:
- |
The :class:`qiskit.providers.models.QasmBackendConfiguration` has a new
field ``processor_type`` which can optionally be used to provide
information about a backend's processor in the form:
``{"family": <str>, "revision": <str>, segment: <str>}``. For example:
``{"family": "Canary", "revision": "1.0", segment: "A"}``.

View File

@ -0,0 +1,25 @@
---
features:
- |
The :py:class:`qiskit.pulse.Schedule`,
:py:class:`qiskit.pulse.Instruction`, and :py:class:`qiskit.pulse.Channel`
classes now have a :attr:`~qiiskit.pulse.Schedule.parameter` property
which will return any :class:`~qiskit.circuit.Parameter` objects used
in the object and a :meth:`~qiskit.pulse.Schedule.is_parameterized()`
method which will return ``True`` if any parameters are used in the
object.
For example:
.. jupyter-execute::
from qiskit.circuit import Parameter
from qiskit import pulse
shift = Parameter('alpha')
schedule = pulse.Schedule()
schedule += pulse.SetFrequency(shift, pulse.DriveChannel(0))
assert schedule.is_parameterized() == True
print(schedule.parameters)

View File

@ -0,0 +1,10 @@
---
fixes:
- |
Fixed an issue with the labels of parametric pulses in the
:class:`~qiskit.qobj.PulseQobjInstruction` class were not being properly
set as they are with sampled pulses. This also means that pulse names
that are imported from the :class:`~qiskit.providers.models.PulseDefaults`
returned by a :class:`~qiskit.providers.Backend`, such as ``x90``, ``x90m``,
etc, will properly be set.
Fixed `#5363 <https://github.com/Qiskit/qiskit-terra/issues/5363>`__

View File

@ -0,0 +1,25 @@
---
features:
- |
Added a :class:`~qiskit.circuit.library.PiecewiseChebyshev` to the
:mod:`qiskit.circuit.library` for implementing a piecewise Chebyshev
approximation of an input function. For a given function :math:`f(x)`
and degree :math:`d`, this class class implements
a piecewise polynomial Chebyshev approximation on :math:`n` qubits
to :math:`f(x)` on the given intervals. All the polynomials in the
approximation are of degree :math:`d`.
For example:
.. jupyter-execute::
import numpy as np
from qiskit import QuantumCircuit
from qiskit.circuit.library.arithmetic.piecewise_chebyshev import PiecewiseChebyshev
f_x, degree, breakpoints, num_state_qubits = lambda x: np.arcsin(1 / x), 2, [2, 4], 2
pw_approximation = PiecewiseChebyshev(f_x, degree, breakpoints, num_state_qubits)
pw_approximation._build()
qc = QuantumCircuit(pw_approximation.num_qubits)
qc.h(list(range(num_state_qubits)))
qc.append(pw_approximation.to_instruction(), qc.qubits)
qc.draw(output='mpl')

View File

@ -4,7 +4,3 @@ features:
The :py:class:`~qiskit.providers.models.BackendProperties` class now
has a :meth:`~qiskit.providers.models.BackendProperties.readout_length`
method, which returns the readout length [sec] of the given qubit.
other:
- |
Snapshots of all fake backends are updated to reflect recent changes,
especially the addition of `readout_length` in the qubits properties.

View File

@ -0,0 +1,59 @@
---
features:
- |
A new class, :py:class:`~qiskit.pulse.ScheduleBlock`, has been added to
the :class:`qiskit.pulse` module. This class provides a new representation
of a pulse program. This representation is best suited for the pulse
builder syntax and is based on relative instruction ordering.
This representation takes ``alignment_context`` instead of specifying
starting time ``t0`` for each instruction. The start time of instruction is
implicitly allocated with the specified transformation and relative
position of instructions.
The :py:class:`~qiskit.pulse.ScheduleBlock` allows for lazy instruction
scheduling, meaning we can assign arbitrary parameters to the duration of
instructions.
For example:
.. code-block:: python
from qiskit.pulse import ScheduleBlock, DriveChannel, Gaussian
from qiskit.pulse.instructions import Play, Call
from qiskit.pulse.transforms import AlignRight
from qiskit.circuit import Parameter
dur = Parameter('rabi_duration')
block = ScheduleBlock(alignment_context=AlignRight())
block += Play(Gaussian(dur, 0.1, dur/4), DriveChannel(0))
block += Call(measure_sched) # subroutine defined elsewhere
this code defines an experiment scanning a Gaussian pulse's duration
followed by a measurement ``measure_sched``, i.e. a Rabi experiment.
You can reuse the ``block`` object for every scanned duration
by assigning a target duration value.
deprecations:
- |
The :meth:`~qiskit.pulse.channels.Channel.assign_parameters` for the
following classes:
* :py:class:`qiskit.pulse.channels.Channel`,
* :py:class:`qiskit.pulse.library.Pulse`,
* :py:class:`qiskit.pulse.instructions.Instruction`,
and all their subclasses is now deprecated and will be removed in a future
release. This functionality has been subsumed
:py:class:`~qiskit.pulse.ScheduleBlock` which is the future direction for
constructing parameterized pulse programs.
- |
The :attr:`~qiskit.pulse.channels.Channel.parameters` attribute for
the following clasess:
* :py:class:`~qiskit.pulse.channels.Channel`
* :py:class:`~qiskit.pulse.instructions.Instruction`.
is deprecated and will be removed in a future release. This functionality
has been subsumed :py:class:`~qiskit.pulse.ScheduleBlock` which is the
future direction for constructing parameterized pulse programs.

View File

@ -1,8 +1,9 @@
---
features:
- |
Can now use :func:`array_to_latex()` to represent vectors and matrices as
human-friendly LaTeX.
Added a new function :func:`~qiskit.visualization.array_to_latex` to
the :mod:`qiskit.visualization` module that can be used to represent
and visualize vectors and matrices with LaTeX.
.. jupyter-execute::

View File

@ -0,0 +1,29 @@
---
features:
- |
The :class:`~qiskit.quantum_info.Statevector` and
:class:`~qiskit.quantum_info.DensityMatrix` classes now have
:meth:`~qiskit.quantum_info.StateVector.draw` methods which allow objects
to be drawn as either text matrices, IPython Latex objects, Latex source,
Q-spheres, Bloch spheres and Hinton plots. By default the output type
is the equivalent output from ``__repr__`` but this default can be changed
in a user config file by setting the ``state_drawer`` option. For example:
.. jupyter-execute::
from qiskit.quantum_info import DensityMatrix
dm = DensityMatrix.from_label('r0')
dm.draw('latex')
.. jupyter-execute::
from qiskit.quantum_info import Statevector
sv = Statevector.from_label('+r')
sv.draw('qsphere')
Additionally, the :meth:`~qiskit.quantum_info.DensityMatrix.draw` method
is now used for the ipython display of these classes, so if you change the
default output type in a user config file then when a
:class:`~qiskit.quantum_info.Statevector` or a
:class:`~qiskit.quantum_info.DensityMatrix` object are displayed in
a jupyter notebook that output type will be used for the object.

View File

@ -0,0 +1,37 @@
---
features:
- |
Pulse :class:`qiskit.pulse.Instruction` objects and
parametric pulse objects (eg :class:`~qiskit.pulse.library.Gaussian` now
support using :class:`~qiskit.circuit.Parameter` and
:class:`~qiskit.circuit.ParameterExpression` objects for the ``duration``
parameter. For example:
.. code-block:: python
from qiskit.circuit import Parameter
from qiskit.pulse import Gaussian
dur = Parameter('x_pulse_duration')
double_dur = dur * 2
rx_pulse = Gaussian(dur, 0.1, dur/4)
double_rx_pulse = Gaussian(double_dir, 0.1, dur/4)
Note that while we can create an instruction with a parameterized
``duration`` adding an instruction with unbound parameter ``duration``
to a schedule is supported only by the newly introduced representation
:class:`~qiskit.pulse.ScheduleBlock`. See the known issues release notes
section for more details.
issues:
- |
Attempting to add an :class:`qiskit.pulse.Instruction` object
with a parameterized ``duration`` (ie the value of ``duration`` is
an unbound :class:`~qiskit.circuit.Parameter` or
:class:`~qiskit.circuit.ParameterExpression` object) to a
:class:`qiskit.pulse.Schedule` is not supported. Attempting to do
so will result in ``UnassignedDurationError``
:class:`~qiskit.pulse.PulseError` being raised. This is a limitation of
how the :class:`~qiskit.pulse.Instruction` overlap constraints are
evaluated currently. This is supported by :class:`~qiskit.pulse.ScheduleBlock`,
in which the overlap constraints are evaluated just before the execution.

View File

@ -36,3 +36,14 @@ upgrade:
:meth:`~qiskit.providers.basicaer.QasmSimulatorPy.run` with something that
will run in a seperate thread or process like ``futures.ThreadPoolExecutor``
or ``futures.ProcessPoolExecutor``.
- |
The ``allow_sample_measuring`` option for the
BasicAer simulator :class:`~qiskit.providers.basicaer.QasmSimulatorPy` has
changed from a default of ``False`` to ``True``. This was done to better
reflect the actual default behavior of the simulator, which would use
sample measuring if the input circuit supported it (even if it was not
enabled). If you are running a circuit that doesn't support sample
measurement (ie it has :class:`~qiskit.circuit.Reset` operations or if
there are operations after a measurement on a qubit) you should make sure
to explicitly set this option to ``False`` when you call
:meth:`~qiskit.providers.basicaer.QasmSimulatorPy.run`.

View File

@ -0,0 +1,24 @@
---
features:
- |
The :class:`~qiskit.transpiler.passes.CommutativeCancellation` transpiler
pass has a new optional kwarg on the constructor ``basis_gates``, which
takes the a list of the names of basis gates for the target backend.
When specified the pass will only use gates in the ``basis_gates`` kwarg.
Previously, the pass would automatically replace consecutive gates which
commute with :class:`~qiskit.circuit.library.ZGate` with the
:class:`~qiskit.circuit.library.U1Gate` unconditionally. The ``basis_gates``
kwarg enables you to specify which z-rotation gates are present in
the target basis to avoid this.
upgrade:
- |
The :class:`~qiskit.transpiler.passes.CommutativeCancellation` transpiler
pass is now aware of the target basis gates, which means it will only
use gates in the specified basis. Previously, the pass would unconditionally
replace consecutive gates which commute with
:class:`~qiskit.circuit.library.ZGate` with the
:class:`~qiskit.circuit.library.U1Gate`. However, now that the pass is
basis aware and has a kwarg, ``basis_gates``, for specifying the target
basis there is a potential change in behavior if the kwarg is not set.
When the ``basis_gates`` kwarg is not used and there are no variable
z-rotation gates in the circuit then no commutative cancellation will occur.

View File

@ -0,0 +1,9 @@
---
fixes:
- |
Fixed an issue where unbound parameters only occurring in
the :attr:`~qiskit.circuit.QuantumCircuit.global_phase` attribute of
a :class:`~qiskit.circuit.QuantumCircuit` object would not
show in the :attr:`~qiskit.circuit.QuantumCircuit.parameters` attribute
and could not be bound.
Fixed `#5806 <https://github.com/Qiskit/qiskit-terra/issues/5806>`__

View File

@ -4,4 +4,5 @@ features:
The constructors of the :class:`~qiskit.circuit.Bit` class and subclasses,
:class:`~qiskit.circuit.Qubit`, :class:`~qiskit.circuit.Clbit`, and
:class:`~qiskit.circuit.AncillaQubit`, have been updated such that their
two parameters, ``register`` and ``index`` are now optional.
two parameters, ``register`` and ``index`` are now optional. This enables
the creation of bit objects that are independent of a register.

View File

@ -1,13 +1,18 @@
---
upgrade:
- |
:class:`~qiskit.circuit.Register` and :class:`~qiskit.circuit.Bit` objects
:class:`~qiskit.circuit.Register` (which is the parent class for
:class:`~qiskit.circuit.QuantumRegister` and
:class:`~qiskit.circuit.ClassicalRegister` and
:class:`~qiskit.circuit.Bit` (which is the parent class for
:class:`~qiskit.circuit.Qubit` and :class:`~qiskit.circuit.Clbit`) objects
are now immutable. In previous releases it was possible to adjust the value
of a :attr:`~qiskit.circuit.Register.size` or
:attr:`~qiskit.circuit.Register.name` attributes of a
of a :attr:`~qiskit.circuit.QuantumRegister.size` or
:attr:`~qiskit.circuit.QuantumRegister.name` attributes of a
:class:`~qiskit.circuit.Register` object and the
:attr:`~qiskit.circuit.Bit.index` or :attr:`~qiskit.circuit.Bit.register`
attributes of a :class:`~qiskit.circuit.Bit` object after it was initially
:attr:`~qiskit.circuit.Qubit.index` or
:attr:`~qiskit.circuit.Qubit.register` attributes of a
:class:`~qiskit.circuit.Bit` object after it was initially
created. However this would lead to unsound behavior that would corrupt
container structure that rely on a hash (such as a `dict`) since these
attributes are treated as immutable properties of a register or bit (see
@ -15,5 +20,5 @@ upgrade:
details). To avoid this unsound behavior this attributes of a
:class:`~qiskit.circuit.Register` and :class:`~qiskit.circuit.Bit` are
no longer settable after initial creation. If you were previously adjusting
the objects at runtime you will now need to create a new ``Register`
the objects at runtime you will now need to create a new ``Register``
or ``Bit`` object with the new values.

View File

@ -1,9 +1,10 @@
---
features:
- |
New gate-like class
:class:`qiskit.circuit.classicalfunction.boolean_expression.BooleanExpression`
allows creating an oracles a from a Python boolean expression.
A new class,
:class:`~qiskit.circuit.classicalfunction.BooleanExpression`, has been
added to the :mod:`qiskit.circuit.classicalfunction` module. This class
allows for creating an oracle from a Python boolean expression. For example:
.. jupyter-execute::
@ -18,18 +19,24 @@ features:
circuit.decompose().draw('mpl')
- |
The new method
:meth:`qiskit.circuit.classicalfunction.boolean_expression.BooleanExpression.from_dimacs_file`
allows loading formulas described in the DIMACS-CNF format.
The :class:`~qiskit.circuit.classicalfunction.BooleanExpression` also
includes a method,
:meth:`~qiskit.circuit.classicalfunction.BooleanExpression.from_dimacs_file`,
which allows loading formulas described in the
`DIMACS-CNF <https://people.sc.fsu.edu/~jburkardt/data/cnf/cnf.html>`__
format. For example::
.. code-block::
from qiskit.circuit import BooleanExpression, QuantumCircuit
boolean_exp = BooleanExpression.from_dimacs_file("simple_v3_c2.cnf")
circuit = QuantumCircuit(boolean_exp.num_qubits)
circuit.append(boolean_exp, range(boolean_exp.num_qubits))
circuit.draw('text')
.. parsed-literal::
┌───────────────────┐
q_0: ┤0 ├
│ │
@ -40,7 +47,12 @@ features:
q_3: ┤3 ├
└───────────────────┘
.. code-block::
circuit.decompose().draw('text')
.. parsed-literal::
q_0: ──o────o────────────
│ │
q_1: ──■────o────■───────
@ -51,18 +63,19 @@ features:
└───┘└───┘└───┘└───┘
- |
The new class
:class:`qiskit.circuit.library.phase_oracle.PhaseOracle`
allows to construct phase oracle circuits from Python boolean expressions.
Added a new class, :class:`~qiskit.circuit.library.PhaseOracle`, has been
added to the :mod:`qiskit.circuit.library` module. This class enables the
construction of phase oracle circuits from Python boolean expressions.
.. jupyter-execute::
from qiskit.circuit.library.phase_oracle import PhaseOracle
oracle = PhaseOracle('x1 & x2 & (not x3)')
oracle.draw('mpl')
These phase oracles can be used, for example, in
:class:`qiskit.algorithms.amplitude_amplifiers.amplification_problem.AmplificationProblem`.
These phase oracles can be used as part of a larger algorithm, for example
with :class:`qiskit.algorithms.AmplificationProblem`:
.. jupyter-execute::
@ -76,16 +89,20 @@ features:
result = grover.amplify(problem)
result.top_measurement
- |
The new method
:meth:`qiskit.circuit.library.phase_oracle.PhaseOracle.from_dimacs_file`
allows to construct a phase oracle from a file describing a formula in the DIMACS-CNF format.
The :class:`~qiskit.circuit.library.PhaseOracle` class also includes a
:meth:`~qiskit.circuit.library.PhaseOracle.from_dimacs_file` method which
enables constructing a phase oracle from a file describing a formula in the
`DIMACS-CNF <https://people.sc.fsu.edu/~jburkardt/data/cnf/cnf.html>`__
format.
.. code-block::
from qiskit.circuit.library.phase_oracle import PhaseOracle
oracle = PhaseOracle.from_dimacs_file("simple_v3_c2.cnf")
oracle.draw('text')
.. parsed-literal::
state_0: ─o───────o──────────────
│ ┌───┐ │ ┌───┐

View File

@ -0,0 +1,10 @@
---
fixes:
- |
The :attr:`~qiskit.circuit.QuantumCircuit.calibrations` attribute
of :class:`~qiskit.circuit.QuantumCircuit` objects are now preserved when
the ``+=`` (ie the :meth:`~qiskit.circuit.QuantumCircuit.extend`
method) and the ``+`` (ie the :meth:`~qiskit.circuit.QuantumCircuit.combine`
method) are used.
Fixed `#5930 <https://github.com/Qiskit/qiskit-terra/pull/5930>`__ and
`#5908 <https://github.com/Qiskit/qiskit-terra/issues/5908>`__

View File

@ -1,13 +1,15 @@
---
features:
- |
A new quick way to call a pass is being introduced for convenience. Now it is possible to direcly call a
:class:`~qiskit.transpiler.BasePass` instance with a :class:`~qiskit.circuit.quantumcircuit.QuantumCircuit`
instance as a parameter to run the pass on the given circuit.
All transpiler passes (ie any instances of
:class:`~qiskit.transpiler.BasePass`) are now directly callable.
Calling a pass provides a convenient interface for running the pass
on a :class:`~qiskit.circuit.QuantumCircuit` object.
For example, in case a transformation pass such as :class:`~qiskit.transpiler.passes.BasisTranslator`:
For example, running a single transformation pass, such as
:class:`~qiskit.transpiler.passes.BasisTranslator`, can be done with:
.. code-block::
.. jupyter-execute::
from qiskit import QuantumCircuit
from qiskit.transpiler.passes import BasisTranslator
@ -18,11 +20,14 @@ features:
pass_instance = BasisTranslator(sel, ['rx', 'rz', 'cx'])
result = pass_instance(circuit)
result.draw(output='mpl')
For the case of an analysis pass, a property set (as `dict` or as :class:`~qiskit.transpiler.propertyset.PropertySet`)
needs to be added as a parameter and it might be modified "in-place":
When running an analysis pass, a property set (as ``dict`` or as
:class:`~qiskit.transpiler.PropertySet`)
needs to be added as a parameter and it might be modified "in-place".
For example:
.. code-block::
.. jupyter-execute::
from qiskit import QuantumCircuit
from qiskit.transpiler.passes import Depth

View File

@ -0,0 +1,14 @@
---
fixes:
- |
The :attr:`~qiskit.circuit.Register.name` setter method of class
:class:`~qiskit.circuit.Register` (which is the parent class of
:class:`~qiskit.circuit.QuantumRegister` and
:class:`~qiskit.circuit.ClassicalRegister`) previously did not check if
the assigned string was a valid register name as per the
`OpenQASM specification <https://arxiv.org/pdf/1707.03429v2.pdf>`__.
This check was previously only performed when the name was specified in the
constructor, this has now been fixed so that setting the ``name``
attribute directly with an invalid value will now also raise an
exception.
Fixed `#5461 <https://github.com/Qiskit/qiskit-terra/issues/5461>`__

View File

@ -0,0 +1,11 @@
---
features:
- |
The :class:`~qiskit.qobj.QasmQobjConfig` class now has an optional
kwarg for ``meas_level`` and ``meas_return``. These fields can be used
to enable generating :class:`~qiskit.qobj.QasmQobj` job payloads that
support ``meas_level=1`` (kerneled data) for circuit jobs (previously
this was only exposed for :class:`~qiskit.qobj.PulseQobj` objects).
The :func:`~qiskit.compiler.assemble` function has been updated
to set this field for :class:`~qiskit.qobj.QasmQobj` objects it
generates.

View File

@ -0,0 +1,20 @@
---
features:
- |
A new :meth:`~qiskit.circuit.QuantumCircuit.tensor` method has been
added to the :class:`~qiskit.circuit.QuantumCircuit` class. This
method enables tensoring another circuit with an existing circuit.
This method works analogously to
:meth:`qiskit.quantum_info.Operator.tensor`
and is consistent with the little-endian convention of Qiskit.
For example:
.. jupyter-execute::
from qiskit import QuantumCircuit
top = QuantumCircuit(1)
top.x(0);
bottom = QuantumCircuit(2)
bottom.cry(0.2, 0, 1);
bottom.tensor(top).draw(output='mpl')

View File

@ -0,0 +1,9 @@
---
features:
- |
Add a new operator class :class:`~qiskit.quantum_info.CNOTDihedral` has
been added to the :mod:`qiskit.quantum_info` module. This class is
used to represent the CNOT-Dihedral group, which is generated by the
quantum gates :class:`~qiskit.circuit.library.CXGate`,
:class:`~qiskit.circuit.library.TGate`,
and :class:`~qiskit.circuit.library.XGate`.

View File

@ -0,0 +1,12 @@
---
fixes:
- |
Fixed an issue with the :func:`qiskit.visualization.circuit_drawer` function
and :meth:`qiskit.circuit.QuantumCircuit.draw` method when visualizing a
:class:`~qiskit.circuit.QuantumCircuit` with a
:class:`~qiskit.circuit.Gate` that has a classical condition
after a :class:`~qiskit.circuit.Measure` that used the same
:class:`~qiskit.circuit.ClassicalRegister`, it was possible
for the conditional :class:`~qiskit.circuit.Gate` to be displayed to the
left of the :class:`~qiskit.circuit.Measure`.
Fixed `#5387 <https://github.com/Qiskit/qiskit-terra/issues/5387>`__

View File

@ -0,0 +1,11 @@
---
fixes:
- |
In the transpiler pass :class:`qiskit.transpiler.passes.CSPLayout` a bias
towards lower numbered qubits could be observed. This undesireable bias has
been fixed by shuffling the candidates to randomize the results.
Furthermore, the usage of the :class:`~qiskit.transpiler.passes.CSPLayout`
pass in the :mod:`~qiskit.transpiler.preset_passmanagers` (for level 2 and
3) has been adjusted to use a configured seed if the ``seed_transpiler``
kwarg is set when :func:`~qiskit.compiler.transpile` is called.
Fixed `#5990 <https://github.com/Qiskit/qiskit-terra/issues/5990>`__

View File

@ -0,0 +1,28 @@
---
upgrade:
- |
The ``DAGCircuit.__eq__`` method (which is used by the ``==`` operator),
which is used to check structural equality of
:class:`~qiskit.dagcircuit.DAGCircuit` and
:class:`~qiskit.circuit.QuantumCircuit` instances, will now
include the :attr:`~qiskit.circuit.QuantumCircuit.global_phase` and
:attr:`~qiskit.circuit.QuantumCircuit.calibrations` attributes in the
fields checked for equality. This means that circuits which would have
evaluated as equal in prior releases may not anymore if the
``global_phase`` or ``calibrations`` differ between the circuits. For
example, in previous releases this would return ``True``::
import math
from qiskit import QuantumCircuit
qc1 = QuantumCircuit(1)
qc1.x(0)
qc2 = QuantumCircuit(1, global_phase=math.pi)
qc2.x(0)
print(qc2 == qc1)
However, now because the ``global_phase`` attribute of the circuits differ
this will now return ``False``.

View File

@ -0,0 +1,22 @@
---
upgrade:
- |
The previously deprecated ``qubits()`` and ``clbits()`` methods on the
:class:`~qiskit.dagcircuit.DAGCircuit` class, which were deprecated in the
0.15.0 Terra release, have been removed. Instead you should use the
:attr:`~qiskit.dagcircuit.DAGCircuit.qubits` and
:attr:`~qiskit.dagcircuit.DAGCircuit.clbits` attributes of the
:class:`~qiskit.dagcircuit.DAGCircuit` class. For example, if you were
running::
from qiskit.dagcircuit import DAGCircuit
dag = DAGCircuit()
qubits = dag.qubits()
That would be replaced by::
from qiskit.dagcircuit import DAGCircuit
dag = DAGCircuit()
qubits = dag.qubits

View File

@ -0,0 +1,37 @@
---
deprecations:
- |
Two :class:`~qiskit.circuit.QuantumCircuit` methods
:meth:`~qiskit.circuit.QuantumCircuit.combine` and
:meth:`~qiskit.circuit.QuantumCircuit.extend` along with their corresponding
Python operators ``+`` and ``+=`` are deprecated and will be removed in a
future release. Instead the :class:`~qiskit.circuit.QuantumCircuit` method
:meth:`~qiskit.circuit.QuantumCircuit.compose` should be used.
The :meth:`~qiskit.circuit.QuantumCircuit.compose` method allows more
flexibility in composing two circuits that do not have matching registers.
It does not, however, automatically add qubits/clbits unlike the deprecated
methods. To add a circuit on new qubits/clbits, the
:meth:`qiskit.circuit.QuantumCircuit.tensor` method can be used. For
example::
from qiskit.circuit import QuantumRegister, QuantumCircuit
a = QuantumRegister(2, 'a')
circuit_a = QuantumCircuit(a)
circuit_a.cx(0, 1)
b = QuantumRegister(2, 'b')
circuit_b = QuantumCircuit(b)
circuit_b.cz(0, 1)
# same as circuit_a + circuit_b (or combine)
added_with_different_regs = circuit_b.tensor(circuit_a)
# same as circuit_a + circuit_a (or combine)
added_with_same_regs = circuit_a.compose(circuit_a)
# same as circuit_a += circuit_b (or extend)
circuit_a = circuit_b.tensor(circuit_a)
# same as circuit_a += circuit_a (or extend)
circuit_a.compose(circuit_a, inplace=True)

View File

@ -0,0 +1,9 @@
---
deprecations:
- |
Support for passing :class:`~qiskit.circuit.Qubit` instances to the
``qubits`` kwarg of the :meth:`qiskit.transpiler.InstructionDurations.get`
method has been deprecated and will be removed in a future release.
Instead, you should call the
:meth:`~qiskit.transpiler.InstructionDurations.get` method with the integer
indices of the desired qubits.

View File

@ -0,0 +1,50 @@
---
features:
- |
Adds a ``&`` (``__and__``) binary operator to ``BaseOperator`` subclasses
(eg :class:`qiskit.quantum_info.Operator`) in the
:mod:`qiskit.quantum_info` module. This is shorthand to call the
classes :meth:`~qiskit.quantum_info.compose` method
(ie ``A & B == A.compose(B)``).
For example:
.. code:: python
import qiskit.quantum_info as qi
qi.Pauli('X') & qi.Pauli('Y')
- |
Adds a ``&`` (``__and__``) binary operator to
:class:`qiskit.quantum_info.Statevector` and
:class:`qiskit.quantum_info.DensityMatrix` classes. This is shorthand to
call the classes :meth:`~qiskit.quantum_info.Statevector.evolve` method
(ie ``psi & U == psi.evolve(U)``).
For example:
.. code:: python
import qiskit.quantum_info as qi
qi.Statevector.from_label('0') & qi.Pauli('X')
deprecations:
- |
Using ``@`` (``__matmul__``) for invoking the ``compose`` method
of ``BaseOperator`` subclasses (eg :class:`~qiskit.quantum_info.Operator`)
is deprecated and will be removed in a future release. The
:meth:`qiskit.quantum_info.Operator.compose` method can be used directly or
also invoked using the ``&`` (``__and__``) operator.
- |
Using ``*`` (``__mul__``) for calling the
:meth:`~qiskit.quantum_info.Operator.dot` method of ``BaseOperator``
subclasses (eg :class:`qiskit.quantum_info.Operator`) is deprecated and
will be removed in a future release. Instead you can just call the
:meth:`~qiskit.quantum_info.Operator.dot` directly.
- |
Using ``@`` (``__matmul__``) for invoking the
:meth:`~qiskit.quantum_info.Statevector.evolve` method
of the :class:`qiskit.quantum_info.Statevector` and
:class:`qiskit.quantum_info.DensityMatrix` classes is deprecated and will
be removed in a future release.. The ``evolve`` method can be used directly
or also invoked using the ``&`` (``__and__``) operator.

View File

@ -0,0 +1,23 @@
---
deprecations:
- |
The ``qiskit.pulse.schedule.ParameterizedSchedule`` class has been
deprecated and will be removed in a future release. Instead you can
directly parameterize pulse :class:`~qiskit.pulse.Schedule` objects with
a :class:`~qiskit.circuit.Parameter` object, for example::
from qiskit.circuit import Parameter
from qiskit.pulse import Schedule
from qiskit.pulse import ShiftPhase, DriveChannel
theta = Parameter('theta')
target_schedule = Schedule()
target_schedule.insert(0, ShiftPhase(theta, DriveChannel(0)), inplace=True)
upgrade:
- |
The :class:`~qiskit.providers.models.PulseDefaults` returned by the fake
pulse backends :py:class:`qiskit.test.mock.FakeOpenPulse2Q` and
:py:class:`qiskit.test.mock.FakeOpenPulse3Q` have been updated to have
more realistic pulse sequence definitions. If you are using these fake
backend classes you may need to update your usage because of these changes.

View File

@ -0,0 +1,13 @@
---
deprecations:
- |
The :class:`qiskit.pulse.ScheduleComponent` class in the
:mod:`qiskit.pulse` module has been deprecated and will be removed in a
future release. Its usage should be replaced either using a
:class:`qiskit.pulse.Schedule` or :class:`qiskit.pulse.Instruction`
directly. Additionally, the primary purpose of the ``ScheduleComponent``
class was as a common base class for both :class:`~qiskit.pulse.Schedule`
and :class:`~qiskit.pulse.Instruction` for any place that was explicitly
type checking or documenting accepting a ``ScheduleComponent`` input
should be updated to accept :class:`~qiskit.pulse.Instruction` or
:class:`~qiskit.pulse.Schedule`.

View File

@ -1,7 +1,7 @@
---
deprecations:
- |
The JSONschema files and usage for the IBMQ API payloads are deprecated
The JSON Schema files and usage for the IBMQ API payloads are deprecated
and will be removed in a future release. This includes everything under
the :mod:`qiskit.schemas` module and the :mod:`qiskit.validation` module.
This also includes the ``validate`` kwargs for

View File

@ -0,0 +1,53 @@
---
features:
- |
A new a new 2-qubit gate, :class:`~qiskit.circuit.library.ECRGate`,
the echo cross-resonance (ECR), has been added to the
:mod:`qiskit.circuit.library` module along with a corresponding method,
:meth:`~qiskit.circuit.QuantumCircuit.ecr` for the
:class:`~qiskit.circuit.QuantumCircuit` class. The ECR gate is two
:math:`CR(\frac{π,4})` pulses with an
:class:`~qiskit.circuit.library.XGate` between them for the echo. This gate
is locally equivalent to a :class:`~qiskit.circuit.library.CXGate` (can
convert to a CNOT with local pre- or post-rotation). It is the native gate
on current IBM hardware and compiling to it allows the pre-/post-rotations
to be merged into the rest of the circuit.
- |
A new kwarg ``approximation_degree`` has been added to the
:func:`~qiskit.compiler.transpile` function for enabling
approximate compilation. Valid values range from 0 to 1, and higher
means less approximation. This is a heuristic dial
to experiment with circuit approximations. The concrete interpretation
of this number is left to each pass, which may use it to perform
some approximate version of the pass. Specific examples include
unitary synthesis or translators to discrete gate sets.
If a pass does not support this option, it implies exact transformation.
- |
Two new transpiler passess, :class:`~qiskit.transpiler.GateDirection` and
class:`qiskit.transpiler.CheckGateDirection`, were added to the
:mod:`qiskit.transpiler.passes` module. These new passes are inteded to
be more general replacements for
:class:`~qiskit.transpiler.passes.CXDirection` and
:class:`~qiskit.transpiler.passes.CheckCXDirection` (which are both now
deprecated, see the deprecation notes for more details) that perform the
same function but work with other gates beside just
:class:`~qiskit.circuit.library.CXGate`.
deprecations:
- |
The :class:`~qiskit.transpiler.passes.CXDirection` transpiler pass in the
:mod:`qiskit.transpiler.passes` module has been deprecated and will be
removed in a future release. Instead the
:class:`~qiskit.transpiler.GateDirection` should be used. It behaves
identically to the :class:`~qiskit.transpiler.passes.CXDirection` except
that it now also supports transforming a circuit with
:class:`~qiskit.circuit.library.ECRGate` gates in addition to
:class:`~qiskit.circuit.library.CXGate` gates.
- |
The :class:`~qiskit.transpiler.passes.CheckCXDirection` transpiler pass in
the :mod:`qiskit.transpiler.passes` module has been deprecated and will be
removed in a future release. Instead the
:class:`~qiskit.transpiler.CheckGateDirection` pass should be used.
It behaves identically to the
:class:`~qiskit.transpiler.passes.CheckCXDirection` except
that it now also supports checking the direction of all 2-qubit gates, not
just :class:`~qiskit.circuit.library.CXGate` gates.

View File

@ -0,0 +1,60 @@
---
features:
- |
When running on Windows, parallel execution with the
:func:`~qiskit.tools.parallel_map` function can now be enabled (it is
still disabled by default). To do this you can either set
``parallel = True`` in a user config file, or set the ``QISKIT_PARALLEL``
environment variable to ``TRUE`` (this will also effect
:func:`~qiskit.compiler.transpile` and :func:`~qiskit.compiler.assemble`
which both use :func:`~qiskit.tools.parallel_map` internally). It is
important to note that when enabling parallelism on Windows there are
limitations around how Python launches processes for Windows, see the
Known Issues section below for more details on the limitations with
parallel execution on Windows.
issues:
- |
On Windows systems when parallel execution is enabled for
:func:`~qiskit.tools.parallel_map` parallelism may not work when called
from a script running outside of a ``if __name__ == '__main__':`` block.
This is due to how Python launches parallel processes on Windows. If a
``RuntimeError`` or ``AttributeError`` are raised by scripts that call
:func:`~qiskit.tools.parallel_map` (including using functions that use
``parallel_map()`` internally like :func:`~qiskit.compiler.transpile`)
with Windows and parallelism enabled you can try embedding the script
calls inside ``if __name__ == '__main__':`` to workaround the issue.
For example::
from qiskit import QuantumCircuit, QiskitError
from qiskit import execute, Aer
qc1 = QuantumCircuit(2, 2)
qc1.h(0)
qc1.cx(0, 1)
qc1.measure([0,1], [0,1])
# making another circuit: superpositions
qc2 = QuantumCircuit(2, 2)
qc2.h([0,1])
qc2.measure([0,1], [0,1])
execute([qc1, qc2], Aer.get_backend('qasm_simulator'))
should be changed to::
from qiskit import QuantumCircuit, QiskitError
from qiskit import execute, Aer
def main():
qc1 = QuantumCircuit(2, 2)
qc1.h(0)
qc1.cx(0, 1)
qc1.measure([0,1], [0,1])
# making another circuit: superpositions
qc2 = QuantumCircuit(2, 2)
qc2.h([0,1])
qc2.measure([0,1], [0,1])
execute([qc1, qc2], Aer.get_backend('qasm_simulator'))
if __name__ == '__main__':
main()
if any errors are encountered with parallelism on Windows.

View File

@ -0,0 +1,8 @@
---
fixes:
- |
Fixes a bug where the ``channels`` field for a
:class:`~qiskit.providers.models.PulseBackendConfiguration` object was
not being included in the output of the
:class:`qiskit.providers.models.PulseBackendConfiguration.to_dict` method.
Fixed `#5579 <https://github.com/Qiskit/qiskit-terra/issues/5579>`__

View File

@ -1,8 +1,10 @@
---
fixes:
- |
Fix the ``'circular'`` entanglement in the :class:`qiskit.circuit.library.n_local.n_local.NLocal` circuit class for the edge
Fixed the ``'circular'`` entanglement in the
:class:`qiskit.circuit.library.NLocal` circuit class for the edge
case where the circuit has the same size as the entanglement block (e.g. a two-qubit
circuit and CZ entanglement gates). In this case there should only be one entanglement
gate, but there was accidentially added a second one in the inverse direction as the
first.
Fixed `Qiskit/qiskit-aqua#1452 <https://github.com/Qiskit/qiskit-aqua/issues/1452>`__

View File

@ -0,0 +1,10 @@
---
fixes:
- |
Fixed the handling of breakpoints in the
:class:`~qiskit.circuit.library.PiecewisePolynomialPauliRotations` class
in the :mod:`qiskit.circuit.library`. Now for ``n`` intervals,
``n+1`` breakpoints are allowed. This enables specifying another end
interval other than :math:`2^\text{num qubits}`. This is important because
from the end of the last interval to :math:`2^\text{num qubits}` the function
is the identity.

View File

@ -0,0 +1,6 @@
---
features:
- |
A new function, :func:`~qiskit.quantum_info.hellinger_distance`, for
computing the Hellinger distance between two counts distributions has
been added to the :mod:`qiskit.quantum_info` module.

View File

@ -0,0 +1,8 @@
---
fixes:
- |
Fixed an issue in the :class:`qiskit.circuit.library.Permutation` circuit
class where some permutations would not be properly generated. This issue
could also effect :class:`qiskit.circuit.library.QuantumVolume` if it were
called with `classical_permutation=False``.
Fixed `#5812 <https://github.com/Qiskit/qiskit-terra/issues/5812>`__

View File

@ -0,0 +1,19 @@
---
fixes:
- |
Fixed an issue where generating QASM output with the
:meth:`~qiskit.circuit.QuantumCircuit.qasm` method for a
:class:`~qiskit.circuit.QuantumCircuit` object that has a
:class:`~qiskit.circuit.ControlledGate` with an open control the output
would be as if all controls were closed independent of the specified
control state. This would result in a different circuit being created
from :meth:`~qiskit.circuit.QuantumCircuit.from_qasm_str` if
parsing the generated QASM.
This was fixed by updating the QASM output from
:meth:`~qiskit.circuit.QuantumCircuit.qasm` by defining a composite gate
which uses :class:`~qiskit.circuit.XGate` to implement the open controls.
The composite gate is named like ``<original_gate_name>_o<ctrl_state>``
where ``o`` stands for open control and ``ctrl_state`` is the integer value
of the control state.
Fixed `#5443 <https://github.com/Qiskit/qiskit-terra/issues/5443>`__

View File

@ -0,0 +1,20 @@
---
fixes:
- |
Fixed an issue where binding :class:`~qiskit.circuit.Parameter` objects
in a :class:`~qiskit.circuit.QuantumCircuit` with the ``parameter_binds``
in the :class:`~qiskit.execute_function.execute` function would cause all
the bound :class:`~qiskit.circuit.QuantumCircuit` objects would have the
same :attr:`~qiskit.circuit.QuantumCircuit.name`, which meant the
result names were also not unique. This fix causes
the :meth:`~qiskit.circuit.QuantumCircuit.bind_parameters` and
:meth:`~qiskit.circuit.QuantumCircuit.assign_parameters` to assign a unique
circuit name when ``inplace=False`` as::
<base name>-<class instance no.>[-<pid name>]
where ``<base name>`` is the name supplied by the "name" kwarg,
otherwise it defaults to "circuit". The class instance number gets
incremented every time an instance of the class is generated. ``<pid name>``
is appended if called outside the main process.
Fixed `#5185 <https://github.com/Qiskit/qiskit-terra/issues/5185>`__

View File

@ -0,0 +1,7 @@
---
fixes:
- |
Fixed an issue with the :func:`~qiskit.compiler.scheduler` function where
it would raise an exception if an input circuit contained an unbound
:class:`~qiskit.circuit.QuantumCircuit` object.
Fixed `#5304 <https://github.com/Qiskit/qiskit-terra/issues/5304>`__

View File

@ -0,0 +1,11 @@
---
fixes:
- |
Fixed an issue in the :class:`qiskit.transpiler.passes.TemplateOptimization`
transpiler passes where template circuits that contained unbound
:class:`~qiskit.circuit.Parameter` objects would crash under some scenarios
if the parameters could not be bound during the template matching.
Now, if the :class:`~qiskit.circuit.Parameter` objects can not be bound
templates with unbound :class:`~qiskit.circuit.Parameter` are discarded and
ignored by the :class:`~qiskit.transpiler.passes.TemplateOptimization` pass.
Fixed `#5533 <https://github.com/Qiskit/qiskit-terra/issues/5533>`__

View File

@ -0,0 +1,16 @@
---
fixes:
- |
Fixed an issue with the :func:`qiskit.visualization.timeline_drawer`
function where classical bits were inproperly handled.
Fixed `#5361 <https://github.com/Qiskit/qiskit-terra/issues/5361>`__
- |
Fixed an issue in the :func:`qiskit.visualization.circuit_drawer` function
and the :meth:`qiskit.circuit.QuantumCircuit.draw` method where
:class:`~qiskit.circuit.Delay` instructions in a
:class:`~qiskit.circuit.QuantumCircuit` object were not being correctly
treated as idle time. So when the ``idle_wires`` kwarg was set to
``False`` the wires with the :class:`~qiskit.circuit.Delay` objects would
still be shown. This has been fixed so that the idle wires are removed from
the visualization if there are only :class:`~qiskit.circuit.Delay` objects
on a wire.

View File

@ -0,0 +1,11 @@
---
fixes:
- |
Previously, when the option ``layout_method`` kwarg was provided to
the :func:`~qiskit.compiler.transpile` function and the
``optimization_level`` kwarg was set to >= 2 so that the pass
:class:`qiskit.transpiler.passes.CSPLayout` would run, if
:class:`~qiskit.transpiler.passes.CSPLayout` found a solution then
the method in ``layout_method`` was not executed. This has been fixed so
that if specified, the ``layout_method`` is always honored.
Fixed `#5409 <https://github.com/Qiskit/qiskit-terra/issues/5409>`__

View File

@ -0,0 +1,23 @@
---
features:
- |
The :func:`~qiskit.quantum_info.decompose_clifford` function in the
:mod:`~qiskit.quantum_info` module (which gets used internally by the
:meth:`qiskit.quantum_info.Clifford.to_circuit` method) has a new kwarg
``method`` which enables selecting the synthesis method used by either
setting it to ``'AG'`` or ``'greedy'``. By default for more than three
qubits it is set to ``'greedy'`` which uses a non-optimal greedy compilation
routine for Clifford elements synthesis, by Bravyi et. al., which typically
yields better CX cost compared to the previously used Aaronson-Gottesman
method (for more than two qubits). You can use the ``method`` kwarg to revert
to the previous default Aaronson-Gottesman method by setting ``method='AG'``.
upgrade:
- |
The default synthesis method used by
:func:`~qiskit.quantum_info.decompose_clifford` function in the
:mod:`~qiskit.quantum_info` module (which gets used internally by the
:meth:`qiskit.quantum_info.Clifford.to_circuit` method) for more than
3 qubits now uses a non-optimal greedy compilation routine for Clifford
elements synthesis, by Bravyi et. al., which typically yields better CX
cost compared to the old default. If you need to revert to the previous
Aaronson-Gottesman method this can be done by setting ``method='AG'``.

View File

@ -0,0 +1,40 @@
---
fixes:
- |
When the argument ``coupling_map=None`` (either set explicitly, set
implicitly as the default value, or via the ``backend`` kwarg), the
transpiling process was not "embedding" the circuit. That is, even when an
``initial_layout`` was specified, the virtual qubits were not assigned to
physical qubits. This has been fixed so that now, the
:func:`qiskit.compiler.transpile` function honors the ``initial_layout``
argument by embedding the circuit:
.. jupyter-execute::
from qiskit import QuantumCircuit, QuantumRegister
from qiskit.compiler import transpile
qr = QuantumRegister(2, name='qr')
circ = QuantumCircuit(qr)
circ.h(qr[0])
circ.cx(qr[0], qr[1])
transpile(circ, initial_layout=[1, 0]).draw(output='mpl')
If the ``initial_layout`` refers to more qubits than in the circuit, the
transpiling process will extended the circuit with ancillas.
.. jupyter-execute::
from qiskit import QuantumCircuit, QuantumRegister
from qiskit.compiler import transpile
qr = QuantumRegister(2, name='qr')
circ = QuantumCircuit(qr)
circ.h(qr[0])
circ.cx(qr[0], qr[1])
transpile(circ, initial_layout=[4, 2], coupling_map=None).draw()
Fixed `#5345 <https://github.com/Qiskit/qiskit-terra/issues/5345>`__

View File

@ -0,0 +1,19 @@
---
features:
- |
The :class:`~qiskit.extensions.Initialize` class in the
:mod:`qiskit.extensions` module can now be constructed using an integer.
The '1' bits of the integer will insert a :class:`~qiskit.circuit.Reset`
and an :class:`~qiskit.circuit.library.XGate` into the circuit for the
corresponding qubit. This will be done using the standard little-endian
convention is qiskit, ie the rightmost bit of the integer will set qubit
0. For example, setting the parameter in
:class:`~qiskit.extensions.Initialize` equal to ``5`` will set qubits 0
and 2 to value 1.
.. jupyter-execute::
from qiskit.extensions import Initialize
initialize = Initialize(13)
initialize.definition.draw('mpl')

View File

@ -0,0 +1,18 @@
---
features:
- |
The :class:`~qiskit.extensions.Initialize` class in the
:mod:`qiskit.extensions` module now supports constructing directly from
a Pauli label (analogous to the
:meth:`qiskit.quantum_info.Statevector.from_label` method). The Pauli label
refer to basis states of the Pauli eigenstates Z, X, Y. These labels use
Qiskit's standard little-endian notation, for example a label of ``'01'``
would initialize qubit 0 to :math:`|1\rangle` and qubit 1 to
:math:`|0\rangle`.
.. jupyter-execute::
from qiskit.extensions import Initialize
initialize = Initialize("10+-lr")
initialize.definition.draw('mpl')

View File

@ -0,0 +1,24 @@
---
upgrade:
- |
The previously deprecated module ``qiskit.visualization.interactive``,
which was deprecated in the 0.15.0 release, has now been removed. Instead
you should use the matplotlib based visualizations:
.. list-table::
:header-rows: 1
* - Removed Interactive function
- Equivalent matplotlib function
* - ``iplot_bloch_multivector``
- :func:`qiskit.visualization.plot_bloch_multivector`
* - ``iplot_state_city``
- :func:`qiskit.visualization.plot_state_city`
* - ``iplot_state_qsphere``
- :func:`qiskit.visualization.plot_state_qsphere`
* - ``iplot_state_hinton``
- :func:`qiskit.visualization.plot_state_hinton`
* - ``iplot_histogram``
- :func:`qiskit.visualization.plot_histogram`
* - ``iplot_state_paulivec``
- :func:`qiskit.visualization.plot_state_paulivec`

View File

@ -0,0 +1,12 @@
---
fixes:
- |
A new kwarg, ``user_cost_dict`` has been added to the constructor for the
:class:`qiskit.transpiler.passes.TemplateOptimization` transpiler pass.
This enables users to providing a custom cost dictionary for the gates to
the underlying template matching algorithm. For example::
from qiskit.transpiler.passes import TemplateOptimization
cost_dict = {'id': 0, 'x': 1, 'y': 1, 'z': 1, 'h': 1, 't': 1}
pass = TemplateOptimization(user_cost_dict=cost_dict)

View File

@ -0,0 +1,11 @@
---
features:
- |
The kwarg, ``template_list``, for the constructor of the
:class:`qiskit.transpiler.passes.TemplateOptimization` transpiler pass
now supports taking in a list of both
:class:`~qiskit.circuit.QuantumCircuit` and
:class:`~qiskit.dagcircuit.DAGDependency` objects. Previously, only
:class:`~qiskit.circuit.QuantumCircuit` were accepted (which were internally
converted to :class:`~qiskit.dagcircuit.DAGDependency` objects) in the
input list.

View File

@ -0,0 +1,21 @@
---
features:
- |
A new transpiler pass,
:py:class:`qiskit.transpiler.passes.RZXCalibrationBuilder`, capable
of generating calibrations and adding them to a quantum circuit has been
introduced. This pass takes calibrated
:class:`~qiskit.circuit.library.CXGate` objects and creates the
calibrations for :class:`qiskit.circuit.library.RZXGate` objects with an
arbitrary rotation angle. The schedules are created by stretching and
compressing the :class:`~qiskit.pulse.GaussianSquare` pulses of the
echoed-cross resonance gates.
- |
New template circuits for using :class:`qiskit.circuit.library.RZXGate`
are added to the :mod:`qiskit.circuit.library` module (eg
:class:`~qiskit.circuit.library.rzx_yz`). This enables pairing
the :class:`~qiskit.transpiler.passes.TemplateOptimization` pass with the
:py:class:`qiskit.transpiler.passes.RZXCalibrationBuilder` pass to
automatically find and replace gate sequences, such as
``CNOT - P(theta) - CNOT``, with more efficent circuits based on
:class:`qiskit.circuit.library.RZXGate` with a calibration.

View File

@ -2,7 +2,7 @@
upgrade:
- |
The ``qiskit.Aer`` and ``qiskit.IBMQ`` top level attributes are now lazy
loaded. This means that the objects will always now exist and warnings will
loaded. This means that the objects will now always exist and warnings will
no longer be raised on import if ``qiskit-aer`` or ``qiskit-ibmq-provider``
are not installed (or can't be found by Python). If you were checking for
the presence of ``qiskit-aer`` or ``qiskit-ibmq-provider`` using these
@ -52,6 +52,6 @@ upgrade:
- |
The user config file option ``suppress_packaging_warnings`` option in the
user config file and the ``QISKIT_SUPPRESS_PACKAGING_WARNINGS`` environment
variable no longer has any effect and will be silently ignored. These
warnings have been removed and will no longer be emitted at import time
from the qiskit module.
variable no longer has any effect and will be silently ignored. The warnings
this option controlled have been removed and will no longer be emitted at
import time from the ``qiskit`` module.

View File

@ -0,0 +1,22 @@
---
features:
- |
The matplotlib output type for the
:func:`~qiskit.visualization.circuit_drawer` and
the :meth:`~qiskit.circuit.QuantumCircuit.draw` method for the
:class:`~qiskit.circuit.QuantumCircuit` class now supports configuration
files for setting the visualization style. In previous releases, there was
basic functionality that allowed users to pass in a ``style`` kwarg that
took in a ``dict`` to customize the colors and other display features of
the ``mpl`` drawer. This has now been expanded so that these dictionaries
can be loaded from JSON files directly without needing to pass a dictionary.
This enables users to create new style files and use that style for
visualizations by passing the style filename as a string to the ``style``
kwarg.
To leverage this feature you must set the ``circuit_mpl_style_path``
option in a user config file. This option should be set to the path you
want qiskit to search for style JSON files. If specifying multiple path
entries they should be separated by ``:``. For example, setting
``circuit_mpl_style_path = ~/.qiskit:~/user_styles`` in a user config
file will look for JSON files in both ``~/.qiskit`` and ``~/user_styles``.

View File

@ -0,0 +1,28 @@
---
features:
- |
A new kwarg, ``format_marginal`` has been added to the function
:func:`~qiskit.result.utils.marginal_counts` which when set to ``True``
formats the counts output according to the
:attr:`~qiskit.circuit.QuantumCircuit.cregs` in the circuit and missing
indices are represented with a ``_``. For example:
.. jupyter-execute::
from qiskit import QuantumCircuit, execute, BasicAer, result
from qiskit.result.utils import marginal_counts
qc = QuantumCircuit(5, 5)
qc.x(0)
qc.measure(0, 0)
result = execute(qc, BasicAer.get_backend('qasm_simulator')).result()
print(marginal_counts(result.get_counts(), [0, 2, 4], format_marginal=True))
fixes:
- |
An issue when passing the :class:`~qiskit.result.Counts` object
returned by :meth:`~qiskit.result.Result.get_counts` to
:func:`~qiskit.result.marginal_counts` would produce an improperly
formatted :class:`~qiskit.result.Counts` object with certain inputs has
been fixed. Fixes
`#5424 <https://github.com/Qiskit/qiskit-terra/issues/5424>`__

View File

@ -0,0 +1,9 @@
---
upgrade:
- |
The previously deprecated ``condition`` kwarg for
:class:`qiskit.dagcircuit.DAGNode` constructor has been removed.
It was deprecated in the 0.15.0 release. Instead you should now be setting
the classical condition on the :class:`~qiskit.circuit.Instruction` object
passed into the :class:`~qiskit.dagcircuit.DAGNode` constructor when
creating a new ``op`` node.

View File

@ -0,0 +1,13 @@
---
upgrade:
- |
When creating a new :class:`~qiskit.circuit.Register` (which is the parent
class for :class:`~qiskit.circuit.QuantumRegister` and
:class:`~qiskit.circuit.ClassicalRegister`) or
:class:`~qiskit.circuit.QuantumCircuit` object with a number of bits (eg
``QuantumCircuit(2)``), it is now required that number of bits are
specified as an integer or another type which is castable to unambiguous
integers(e.g. ``2.0``). Non-integer values will now raise an error as the
intent in those cases was unclear (you can't have fractional bits). For
more, information on why this was changed refer to:
`#4855 <https://github.com/Qiskit/qiskit-terra/issues/4885>`__

View File

@ -0,0 +1,13 @@
---
upgrade:
- |
`networkx <https://networkx.org/>`__ is no longer a requirement for
qiskit-terra. All the networkx usage inside qiskit-terra has been removed
with the exception of 3 methods:
* :class:`qiskit.dagcircuit.DAGCircuit.to_networkx`
* :class:`qiskit.dagcircuit.DAGCircuit.from_networkx`
* :class:`qiskit.dagcircuit.DAGDependency.to_networkx`
If you are using any of these methods you will need to manually install
networkx in your environment to continue using them.

View File

@ -0,0 +1,22 @@
---
deprecations:
- |
The :class:`~qiskit.circuit.library.WeightedAdder` method
:meth:`~qiskit.circuit.library.WeightedAdder.num_ancilla_qubits` is
deprecated and will be removed in a future release. It has been replaced
with the :attr:`qiskit.circuit.library.WeightedAdder.num_ancillas` attribute
which is consistent with other circuit libraries' APIs.
fixes:
- |
Improved the allocation of helper qubits in
:class:`~qiskit.circuit.library.PolynomialPauliRotations` and
:class:`~qiskit.circuit.library.PiecewiseLinearPauliRotations` which makes
the implementation of these circuit more efficient.
Fixed `#5320 <https://github.com/Qiskit/qiskit-terra/issues/5320>`__ and
`#5322 <https://github.com/Qiskit/qiskit-terra/issues/5322>`__
- |
Fix the usage of the allocated helper qubits in the
:class:`~qiskit.circuit.library.MCXGate` in the
:class:`~qiskit.circuit.library.WeightedAdder` class. These were previously
allocated but not used prior to this fix.
Fixed `#5321 <https://github.com/Qiskit/qiskit-terra/issues/5321>`__

View File

@ -0,0 +1,8 @@
---
features:
- |
Improved the performance of
:meth:`qiskit.quantum_info.Statevector.expectation_value` and
:meth:`qiskit.quantum_info.DensityMatrix.expectation_value` when the
argument operator is a :class:`~qiskit.quantum_info.Pauli` or
:class:`~qiskit.quantum_info.SparsePauliOp` operator.

View File

@ -24,12 +24,13 @@ features:
config file.
upgrade:
- |
By default on macOS with Python >=3.8 :func:`~qiskit.tools.parallel_map` will
no longer run in multiple processes. This is a change from previous releases
where the default behavior was that :func:`~qiskit.tools.parallel_map` would
launch multiple processes. This change was made because with newer versions of
macOS with Python 3.8 and 3.9 multiprocessing is either unreliable or adds
significant overhead because of the change in Python 3.8 to launch new
processes with ``spawn`` instead of ``fork``. To re-enable parallel execution on
macOS with Python >= 3.8 you can use the user config file ``parallel` option or
set the environment variable ``QISKIT_PARALLEL`` to ``True``.
By default on macOS with Python >=3.8 :func:`~qiskit.tools.parallel_map`
will no longer run in multiple processes. This is a change from previous
releases where the default behavior was that
:func:`~qiskit.tools.parallel_map` would launch multiple processes. This
change was made because with newer versions of macOS with Python 3.8 and
3.9 multiprocessing is either unreliable or adds significant overhead
because of the change in Python 3.8 to launch new processes with ``spawn``
instead of ``fork``. To re-enable parallel execution on macOS with
Python >= 3.8 you can use the user config file ``parallel`` option or set
the environment variable ``QISKIT_PARALLEL`` to ``True``.

View File

@ -0,0 +1,7 @@
---
features:
- |
A new method, :meth:`~qiskit.circuit.ParameterExpression.gradient`, has
been added to the :class:`~qiskit.circuit.ParameterExpression` class. This
method is used to evaluate the gradient of a
:class:`~qiskit.circuit.ParameterExpression` object.

View File

@ -0,0 +1,16 @@
---
features:
- |
The ``__eq__`` method (ie what is called when the ``==`` operator is used)
for the :class:`~qiskit.circuit.ParameterExpression` now allows for the
comparison with a numeric value. Previously, it was only possible
to compare two instances of
:class:`~qiskit.circuit.ParameterExpression` with ``==``. For example::
from qiskit.circuit import Parameter
x = Parameter("x")
y = x + 2
y = y.assign(x, -1)
assert y == 1

View File

@ -0,0 +1,12 @@
---
features:
- |
The :class:`~qiskit.circuit.library.PauliFeatureMap` class in the
:mod:`qiskit.circuit.library` module now supports adjusting the rotational
factor, :math:`\alpha`, by either setting using the kwarg ``alpha`` on
the constructor or setting the
:attr:`~qiskit.circuit.library.PauliFeatureMap.alpha` attribute after
creation. Previously this value was fixed at ``2.0``. Adjusting this
attribute allows for better control of decision boundaries and provides
additional flexibility handling the input features without needing
to explicitly scale them in the data set.

View File

@ -0,0 +1,12 @@
---
features:
- |
A new :class:`~qiskit.circuit.Gate` class,
:class:`~qiskit.circuit.library.PauliGate`, has been added
the :class:`qiskit.circuit.library` module and corresponding method,
:meth:`~qiskit.circuit.QuantumCircuit.pauli`, was added to the
:class:`~qiskit.circuit.QuantumCircuit` class. This new gate class enables
applying several individual pauli gates to different qubits at the
simultaneously. This is primarily useful for simulators which can use this
new gate to more efficiently implement multiple simultaneous Pauli gates.

View File

@ -22,7 +22,8 @@ features:
P2 = Pauli('YZX')
P1.dot(P2)
Pauli's can also be directly appended to ``QuantumCircuit`` objects
Pauli's can also be directly appended to
:class:`~qiskit.circuit.QuantumCircuit` objects
.. jupyter-execute::
@ -31,19 +32,21 @@ features:
circ = QuantumCircuit(3)
circ.append(Pauli('XYZ'), [0, 1, 2])
print(circ.draw())
circ.draw(output='mpl')
Additional methods allow computing when two Pauli's
:meth:`~qiskit.quantum_info.Pauli.commute` or
:meth:`~qiskit.quantum_info.Pauli.anticommute`, and computing the Pauli
resulting from Clifford conjugation :math:`P^\prime = C.P.C^\dagger`
Additional methods allow computing when two Pauli's commute (using the
:meth:`~qiskit.quantum_info.Pauli.commutes` method) or anticommute
(using the :meth:`~qiskit.quantum_info.Pauli.anticommutes` method), and
computing the Pauli resulting from Clifford conjugation
:math:`P^\prime = C.P.C^\dagger`
using the :meth:`~qiskit.quantum_info.Pauli.evolve` method.
See the API documentation of the :class:`~qiskit.quantum_info.Pauli` class
for additional information.
- |
Adds :func:`qiskit.quantum_info.random_pauli` function for generating a
random element of the N-qubit Pauli group.
A new function, :func:`~qiskit.quantum_info.random_pauli`, for generating a
random element of the N-qubit Pauli group has been added to the
:mod:`qiskit.quantum_info` module.
deprecations:
- |
The following legacy methods of the :class:`qiskit.quantum_info.Pauli` class

View File

@ -0,0 +1,29 @@
---
features:
- |
A new class,
:class:`~qiskit.circuit.library.PiecewisePolynomialPauliRotations`, has
been added to the :mod:`qiskit.circuit.library` module. This circuit library
element is used for mapping a piecewise polynomial function, :math:`f(x)`,
which is defined through breakpoints and coefficients, on qubit amplitudes.
The breakpoints :math:`(x_0, ..., x_J)` are a subset of :math:`[0, 2^n-1]`,
where :math:`n` is the number of state qubits. The corresponding
coefficients :math:`[a_{j,1},...,a_{j,d}]`, where :math:`d` is the highest
degree among all polynomials. Then :math:`f(x)` is defined as:
.. math::
f(x) = \begin{cases}
0, x < x_0 \\
\sum_{i=0}^{i=d}a_{j,i} x^i, x_j \leq x < x_{j+1}
\end{cases}
where we implicitly assume :math:`x_{J+1} = 2^n`. And the mapping applied
to the amplitudes is given by
.. math::
F|x\rangle |0\rangle = \cos(p_j(x))|x\rangle |0\rangle + \sin(p_j(x))|x\rangle |1\rangle
This mapping is based on controlled Pauli Y-rotations and constructed using
the :class:`~qiskit.circuit.library.PolynomialPauliRotations`.

View File

@ -0,0 +1,33 @@
---
upgrade:
- |
The previously deprecated kwarg ``callback`` on the constructor for the
:class:`~qiskit.transpiler.PassManager` class has been removed. This
kwarg has been deprecated since the 0.13.0 release (April, 9th 2020).
Instead you can pass the ``callback`` kwarg to the
:meth:`qiskit.transpiler.PassManager.run` method directly. For example,
if you were using::
from qiskit.circuit.random import random_circuit
from qiskit.transpiler import PassManager
qc = random_circuit(2, 2)
def callback(**kwargs)
print(kwargs['pass_'])
pm = PassManager(callback=callback)
pm.run(qc)
this can be replaced with::
from qiskit.circuit.random import random_circuit
from qiskit.transpiler import PassManager
qc = random_circuit(2, 2)
def callback(**kwargs)
print(kwargs['pass_'])
pm = PassManager()
pm.run(qc, callback=callback)

View File

@ -0,0 +1,28 @@
---
prelude: |
The Qiskit Terra 0.17.0 includes many new features and bug fixes. The major
new feature for this release is the introduction of the
:mod:`qiskit.algorithms` and :mod:`qiskit.opflow` modules which were
migrated and adapted from the :mod:`qiskit.aqua` project.
features:
- |
A new module :mod:`qiskit.algorithms` has been introduced. This module
contains functionality equivalent to what has previously been
provided by the :mod:`qiskit.aqua.algorithms` module (which is now
deprecated) and provides the building blocks for constructing quantum
algorithms. For details on migrating from ``qiskit-aqua`` to this new
module please refer to the migration guide "INSERT LINK HERE"
- |
A new module :mod:`qiskit.opflow` has been introduced. This module
contains functionality equivalent to what has previously been
provided by the :mod:`qiskit.aqua.operators` module (which is now
deprecated) and provides the operators and state functions which are
used to build quantum algorithms. For details on migrating from
``qiskit-aqua`` to this new module please refer to the migration guide
"INSERT LINK HERE"
- |
This is the first release that includes precompiled binary wheels for
the for Linux aarch64 systems. If you are running a manylinux2014
compatible aarch64 Linux system there are now precompiled wheels available
on PyPI, you are no longer required to build from source to install
qiskit-terra.

View File

@ -0,0 +1,11 @@
---
upgrade:
- |
It is now no longer possible to instantiate a base channel without
a prefix such as :class:`qiskit.pulse.Channel` or
:class:`qiskit.pulse.PulseChannel`. These classes are designed to be
parent classes for different user facing channel classes, such
as :class:`qiskit.pulse.DriveChannel`, and not something directly used.
When instantiated directly they were not actually usable. If you were
previously directly instantiate either :class:`qiskit.pulse.Channel` or
:class:`qiskit.pulse.PulseChannel` this no longer works.

View File

@ -0,0 +1,31 @@
---
features:
- |
The :func:`qiskit.quantum_info.process_fidelity` function is now able to be
used with a non-unitary target channel. In this case the returned value is
equivalent to the :func:`qiskit.quantum_info.state_fidelity` of the
normalized :class:`qiskit.quantum_info.Choi` matrices for the channels.
Note that the :func:`qiskit.quantum_info.average_gate_fidelity` and
:func:`qiskit.quantum_info.gate_error` functions still require the target
channel to be unitary and will raise an exception if it is not.
deprecations:
- |
Using a ``list`` or ``numpy.ndarray`` as the ``channel`` or ``target``
argument for the :func:`qiskit.quantum_info.process_fidelity`,
:func:`qiskit.quantum_info.average_gate_fidelity`,
:func:`qiskit.quantum_info.gate_error`, and
:func:`qiskit.quantum_info.diamond_norm` functions has been
deprecated and will not be supported in a future release. The inputs should
instead be a :class:`~qiskit.circuit.Gate` or a ``BaseOperator`` subclass
object (eg. :class:`~qiskit.quantum_info.Operator`,
:class:`~qiskit.quantum_info.Choi`, etc.)
upgrade:
- |
When the ``require_cp`` and/or ``require_tp`` kwargs of
:func:`qiskit.quantum_info.process_fidelity`,
:func:`qiskit.quantum_info.average_gate_fidelity`,
:func:`qiskit.quantum_info.gate_error` are ``True``, they will now only log a
warning rather than the previous behavior of raising a
:class:`~qiskit.exceptions.QiskitError` exception if the input channel is
non-CP or non-TP respectively.

View File

@ -1,7 +1,7 @@
---
features:
- |
Added a new pulse builder function, :func:`pulse.macro`.
Added a new pulse builder function, :func:`qiskit.pulse.macro`.
This enables normal Python functions to be decorated as macros.
This enables pulse builder functions to be used within the decorated
function. The builder macro can then be called from within a pulse
@ -15,7 +15,8 @@ features:
@pulse.macro
def measure(qubit: int):
pulse.play(pulse.GaussianSquare(16384, 256, 15872), pulse.MeasureChannel(qubit))
pulse.play(pulse.GaussianSquare(16384, 256, 15872),
pulse.MeasureChannel(qubit))
mem_slot = pulse.MemorySlot(0)
pulse.acquire(16384, pulse.AcquireChannel(0), mem_slot)
return mem_slot

View File

@ -0,0 +1,18 @@
---
upgrade:
- |
The :class:`~qiskit.circuit.library.QFT` class in the
:mod:`qiskit.circuit.library` module now computes the Fourier transform
using a little-endian representation of tensors, i.e. the state
:math:`|1\rangle` maps to :math:`|0\rangle - |1\rangle + |2\rangle - ..`
assuming the computational basis correspond to little-endian bit ordering
of the integers. :math:`|0\rangle = |000\rangle, |1\rangle = |001\rangle`,
etc. This was done to make it more consistent with the rest of Qiskit,
which uses a little-endian convention for bit order. If you were depending
on the previous bit order you can use the
:meth:`~qiskit.circuit.library.QFT.reverse_bits` method to revert to the
previous behavior. For example::
from qiskit.circuit.library import QFT
qft = QFT(5).reverse_bits()

Some files were not shown because too many files have changed in this diff Show More