Skip to content

Commit

Permalink
Prepare release notes for Qiskit Terra 0.19 (#7329)
Browse files Browse the repository at this point in the history
* Move 0.19 release notes into subdirectory

* Add missing objects to imports and API docs

A few objects added in new features for the 0.19 cycle did not get added
into higher-level `__init__` files, either as imports or documentation
links.  This adds several documentation links in, and fixes some
cyclic imports that were previously hidden due to the objects not being
fully imported.

* Update incorrect deprecation notice

These deprecation notices were written in a PR that was originally
targetted for the 0.18 release but later got shifted to 0.19.

* Reorganise pulse documentation to avoid duplication

Previously, autosummary documentation files were being generated for
most objects in `qiskit.pulse` in two namespaces: `qiskit.pulse` and
(e.g.) `qiskit.pulse.library`.  In other cases, the module-level
documentation was not being generated at all.  This moves the
responsibility for defining all the definitions into the respective
submodules, and turns the `qiskit.pulse` docstring into a series of
`.. automodule::` calls.  The relevant module docstrings are merged
with any content that was already in the `qiskit.pulse` docstring, to
ensure that the displayed documentation on the `qiskit.pulse` page is
almost identical to what it was before.

Various Sphinx crossreferences within the `pulse` module (and referring
to it from elsewhere) were previously broken, in part because of the
duplication.  It should be more reliable when creating crossreferences
now.  The abstract base classes are also added in `.. autoclass::` calls
in suitable locations, since they are a common source of failed Sphinx
crossreferences elsewhere.

(It's easy to accidentally get the duplication when using `autosummary`.
If it does need to be used on more than one page, then only the
canonical path should use the `:toctree:` directive.  Pulse also had
more of this than other places because it's generally a bit more
thoroughly documented.)

* Reformat 0.19 release notes

This reformats the release notes for Terra 0.19, canonicalising the
style and ensuring that all Sphinx crossreferences link correctly.  In
some cases there is no suitable target for documentation (especially in
the case of removals), so these are left as simple monospaced font.

* Fix typo

Co-authored-by: Matthew Treinish <mtreinish@kortar.org>

* Clarify ExactReciprocal documentation

* Fix docs warning

* Move backend V2 note

* Move RZX calibration release note

* Revert restrictions filetypes in text drawer

These were added in gh-6487.  In general, there is no reason to enforce
that text must go into a file with a `.txt` extension; the extension is
a rather Windows-specific convention, and not necessary.

* Remove release notes already included in 0.18 backports

* Correct future warning in pauli_basis

* Rewrite release notes

Also rejig a type hint that Sphinx always attempted to resolve.

Co-authored-by: Matthew Treinish <mtreinish@kortar.org>

* Add 0.19 release prelude

* Remove unused import

* Updated grover reno

* Update releasenotes/notes/0.19/qaoa-parameters-49e4524ed2d3e875.yaml

* Update release notes

Co-authored-by: Matthew Treinish <mtreinish@kortar.org>

* Move another merged release note

* spelling

* Fix typos in documentation

Co-authored-by: Luciano Bello <bel@zurich.ibm.com>

* Reformat new release notes

* Update QASM3 note with new features

This adds some information on how the QASM 3 exporter works with the new
control-flow constructs, and removes the line saying it works with
``defcal``.  The latter is because we do not actually support this; we
can recognise "opaque" gates, but we can't emit anything sensible for
them, so we currently just fail loudly with a suitable error.

* Add BaseReadoutMitigator to documentation

* Updates from Luciano

Co-authored-by: Luciano Bello <bel@zurich.ibm.com>

* Update BasisTranslator release note

* Add an invisible code block

* Rewrite PulseGate pass release note

* Update release notes

Co-authored-by: Matthew Treinish <mtreinish@kortar.org>

* Remove note about type hints

* Fix PulseGate typos

* Revert default import of rzx_templates

This was made in order to simplify some import paths, but as a side
effect it caused ten `QuantumCircuit`s to be created on import of
`qiskit`, which spoiled the QPY backwards compatibility tests and likely
had import performance implications.

The import of this likely should not need to create circuits, but for
now, we revert its import rather than making a change this close to
release.

Co-authored-by: Matthew Treinish <mtreinish@kortar.org>
Co-authored-by: Abby-Mitchell <abby.mitchell@btinternet.com>
Co-authored-by: Luciano Bello <bel@zurich.ibm.com>
  • Loading branch information
4 people authored Dec 6, 2021
1 parent efd8b13 commit d5094ee
Show file tree
Hide file tree
Showing 234 changed files with 1,887 additions and 1,732 deletions.
6 changes: 6 additions & 0 deletions docs/apidocs/synthesis.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
.. _qiskit-synthesis:

.. automodule:: qiskit.synthesis
:no-members:
:no-inherited-members:
:no-special-members:
6 changes: 6 additions & 0 deletions docs/apidocs/synthesis_aqc.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
.. _qiskit-transpiler-synthesis-aqc:

.. automodule:: qiskit.transpiler.synthesis.aqc
:no-members:
:no-inherited-members:
:no-special-members:
2 changes: 2 additions & 0 deletions docs/apidocs/terra.rst
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ Qiskit Terra API Reference
providers_models
pulse
scheduler
synthesis
qasm
qobj
qpy
Expand All @@ -32,6 +33,7 @@ Qiskit Terra API Reference
transpiler_passes
transpiler_preset
transpiler_plugins
transpiler_builtin_plugins
utils
utils_mitigation
opflow
Expand Down
10 changes: 10 additions & 0 deletions docs/apidocs/transpiler_builtin_plugins.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
.. _qiskit-transpiler-builtin-plugins:

=====================================
Built-in Transpiler Synthesis Plugins
=====================================

.. toctree::
:maxdepth: 2

synthesis_aqc
10 changes: 10 additions & 0 deletions qiskit/circuit/library/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -187,6 +187,15 @@
QuadraticForm
Other arithmetic functions
--------------------------
.. autosummary::
:toctree: ../stubs/
:template: autosummary/class_no_inherited_members.rst
ExactReciprocal
Amplitude Functions
===================
Expand Down Expand Up @@ -393,6 +402,7 @@
PiecewiseChebyshev,
HRSCumulativeMultiplier,
RGQFTMultiplier,
ExactReciprocal,
)

from .n_local import (
Expand Down
1 change: 1 addition & 0 deletions qiskit/circuit/library/arithmetic/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,3 +24,4 @@
from .adders import VBERippleCarryAdder, CDKMRippleCarryAdder, DraperQFTAdder
from .piecewise_chebyshev import PiecewiseChebyshev
from .multipliers import HRSCumulativeMultiplier, RGQFTMultiplier
from .exact_reciprocal import ExactReciprocal
19 changes: 11 additions & 8 deletions qiskit/circuit/library/arithmetic/exact_reciprocal.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,15 +31,18 @@ def __init__(
r"""
Args:
num_state_qubits: The number of qubits representing the value to invert.
scaling: Scaling factor of the reciprocal function, i.e. to compute
::math:: `scaling / x`.
neg_vals: Whether x might represent negative values. In this case the first qubit is
the sign, with |1> for negative and |0> for positive. For the negative case it is
assumed that the remaining string represents 1 - x. This is because
::math:: `e^{-2 \pi i x} = e^{2 \pi i (1 - x)}` for ::math:: `x \in [0,1)`.
scaling: Scaling factor :math:`s` of the reciprocal function, i.e. to compute
:math:`s / x`.
neg_vals: Whether :math:`x` might represent negative values. In this case the first
qubit is the sign, with :math:`|1\rangle` for negative and :math:`|0\rangle` for
positive. For the negative case it is assumed that the remaining string represents
:math:`1 - x`. This is because :math:`e^{-2 \pi i x} = e^{2 \pi i (1 - x)}` for
:math:`x \in [0,1)`.
name: The name of the object.
Note:
It is assumed that the binary string x represents a number < 1.
.. note::
It is assumed that the binary string :math:`x` represents a number < 1.
"""
qr_state = QuantumRegister(num_state_qubits, "state")
qr_flag = QuantumRegister(1, "flag")
Expand Down
6 changes: 2 additions & 4 deletions qiskit/circuit/library/basis_change/qft.py
Original file line number Diff line number Diff line change
Expand Up @@ -111,11 +111,9 @@ def num_qubits(self) -> int:
Returns:
The number of qubits in the circuit.
Note:
This method needs to be overwritten to allow adding the setter for num_qubits while
still complying to pylint.
"""
# This method needs to be overwritten to allow adding the setter for num_qubits while still
# complying to pylint.
return super().num_qubits

@num_qubits.setter
Expand Down
3 changes: 2 additions & 1 deletion qiskit/extensions/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@
UnitaryGate
HamiltonianGate
SingleQubitUnitary
Simulator Extensions
====================
Expand All @@ -47,7 +48,7 @@
from qiskit.circuit.library.standard_gates import *
from qiskit.circuit.barrier import Barrier

from .quantum_initializer.initializer import Initialize
from .quantum_initializer import Initialize, SingleQubitUnitary
from .unitary import UnitaryGate
from .hamiltonian_gate import HamiltonianGate
from .simulator import Snapshot
1 change: 1 addition & 0 deletions qiskit/extensions/quantum_initializer/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,3 +19,4 @@
from .diagonal import DiagonalGate
from .uc import UCGate
from .isometry import Isometry
from .initializer import Initialize
4 changes: 3 additions & 1 deletion qiskit/extensions/quantum_initializer/initializer.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,6 @@
from qiskit.circuit.library.standard_gates.ry import RYGate
from qiskit.circuit.library.standard_gates.rz import RZGate
from qiskit.circuit.reset import Reset
from qiskit.quantum_info import Statevector

_EPS = 1e-10 # global variable used to chop very small numbers to zero

Expand Down Expand Up @@ -61,6 +60,9 @@ def __init__(self, params, num_qubits=None):
and params is 3. This allows qubits 0 and 1 to be initialized to `|1>` and the
remaining 3 qubits to be initialized to `|0>`.
"""
# pylint: disable=cyclic-import
from qiskit.quantum_info import Statevector

if isinstance(params, Statevector):
params = params.data

Expand Down
Loading

0 comments on commit d5094ee

Please sign in to comment.