Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merge 0.45.2 contents into stable/0.46.0 branch #11620

Merged
merged 26 commits into from
Jan 22, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
26 commits
Select commit Hold shift + click to select a range
4ee4481
Update DAGCircuit.draw() docstring with current requirements (#11337)…
mergify[bot] Nov 29, 2023
a2de351
Add Python 3.12 to ASV conf. (#11342) (#11343)
mergify[bot] Nov 30, 2023
908e555
Don't substitute ideal gates in target with Optimize1qGatesDecomposit…
mergify[bot] Dec 1, 2023
ef21b50
Pin `z3-solver` on macOS VMs (#11408) (#11409)
mergify[bot] Dec 14, 2023
7a32041
Fixed bug in OptimizeSwapBeforeMeasure (#11413) (#11415)
mergify[bot] Dec 14, 2023
16ff633
Fix a bug is StabilizerState repr (#11368) (#11416)
mergify[bot] Dec 14, 2023
695733a
Remove non-API docs and tutorials (Cherry-pick of #11352) (#11398) (#…
Eric-Arellano Dec 18, 2023
2ce42e2
Update pauli.py documentation (#11427) (#11429)
mergify[bot] Dec 18, 2023
4da5716
Add parameter documentation for Pauli Two-Design (#11424) (#11430)
mergify[bot] Dec 18, 2023
e2f2a2a
Fix LaTeX equations for KaTeX (#11435) (#11438)
mergify[bot] Dec 20, 2023
9a67d80
Remove Qiskit Terra 0.25 from release_notes.rst (#11436) (#11457)
mergify[bot] Dec 21, 2023
00cc01d
Fix text overwriting end of box for empty default case in mpl drawer …
mergify[bot] Jan 2, 2024
fb84ca2
Fix global-phase of copied `BlueprintCircuit`s (#11456) (#11485)
mergify[bot] Jan 3, 2024
a60aa1d
Relax CI constraint on `jsonschema` (#11489) (#11491)
mergify[bot] Jan 4, 2024
b335df5
Small fixes docs (#11459) (#11503)
mergify[bot] Jan 7, 2024
7fb6acc
Fix broadcasting of `QuantumCircuit.delay` (#11447) (#11523)
mergify[bot] Jan 9, 2024
b4e74ed
Add other primitives team members to CODEOWNERS (#11525) (#11530)
mergify[bot] Jan 9, 2024
56fc27d
Reactive the viewcode extension for docs (#11548) (#11569)
mergify[bot] Jan 15, 2024
0055340
Exclude non-rc pre-releases from qpy backwards compat tests (#11572) …
mergify[bot] Jan 16, 2024
92d589f
Fix a bug of missing pulse library entry in PulseQobj parsing (backpo…
mergify[bot] Jan 17, 2024
1029797
Fix qpy support for Cliffords (#11495) (#11582)
mergify[bot] Jan 17, 2024
0ab44e3
Prepare release 0.45.2 (#11590)
hunterkemeny Jan 18, 2024
b371041
Fix cibuildwheel config for building 32bit Python 3.12 wheels (#11595)
mtreinish Jan 18, 2024
f078b64
Add clifford circuit name in test_qpy (#11597) (#11601)
mergify[bot] Jan 19, 2024
341ad69
Update intersphinx URLs (#11605) (#11612)
mergify[bot] Jan 22, 2024
d4331db
Merge remote-tracking branch 'origin/stable/0.45' into merge-0.45.2
mtreinish Jan 22, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/CODEOWNERS
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ pulse/ @Qiskit/terra-core @eggerdj @wshanks
synthesis/ @Qiskit/terra-core @alexanderivrii @ShellyGarion
scheduler/ @Qiskit/terra-core @eggerdj @wshanks
visualization/ @Qiskit/terra-core @nonhermitian
primitives/ @Qiskit/terra-core @ikkoham @t-imamichi
primitives/ @Qiskit/terra-core @Qiskit/qiskit-primitives
# Override the release notes directories to have _no_ code owners, so any review
# from somebody with write access is acceptable.
/releasenotes/notes
4 changes: 2 additions & 2 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
members = ["crates/*"]

[workspace.package]
version = "0.45.1"
version = "0.45.2"
edition = "2021"
rust-version = "1.64" # Keep in sync with README.md and rust-toolchain.toml.
license = "Apache-2.0"
Expand Down
2 changes: 1 addition & 1 deletion asv.conf.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
"dvcs": "git",
"environment_type": "virtualenv",
"show_commit_url": "http://github.com/Qiskit/qiskit-terra/commit/",
"pythons": ["3.8", "3.9", "3.10", "3.11"],
"pythons": ["3.8", "3.9", "3.10", "3.11", "3.12"],
"benchmark_dir": "test/benchmarks",
"env_dir": ".asv/env",
"results_dir": ".asv/results"
Expand Down
10 changes: 6 additions & 4 deletions docs/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
# The short X.Y version
version = "0.45"
# The full version, including alpha/beta/rc tags
release = "0.45.1"
release = "0.45.2"

language = "en"

Expand All @@ -40,11 +40,13 @@
"sphinx.ext.napoleon",
"sphinx.ext.autodoc",
"sphinx.ext.autosummary",
"sphinx.ext.mathjax",
"sphinx.ext.intersphinx",
"sphinx.ext.doctest",
# This is used by qiskit/documentation to generate links to github.com.
"sphinx.ext.viewcode",
"matplotlib.sphinxext.plot_directive",
"reno.sphinxext",
"sphinxcontrib.katex",
]

templates_path = ["_templates"]
Expand Down Expand Up @@ -75,8 +77,8 @@
# ----------------------------------------------------------------------------------

intersphinx_mapping = {
"rustworkx": ("https://qiskit.org/ecosystem/rustworkx/", None),
"qiskit-ibm-runtime": ("https://qiskit.org/ecosystem/ibm-runtime/", None),
"rustworkx": ("https://www.rustworkx.org/", None),
"qiskit-ibm-runtime": ("https://docs.quantum.ibm.com/api/qiskit-ibm-runtime/", None),
"qiskit-aer": ("https://qiskit.org/ecosystem/aer/", None),
"numpy": ("https://numpy.org/doc/stable/", None),
"matplotlib": ("https://matplotlib.org/stable/", None),
Expand Down
12 changes: 6 additions & 6 deletions docs/release_notes.rst
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,13 @@
Release Notes
%%%%%%%%%%%%%

This page contains the release notes for Qiskit, starting from the point at which the legacy
"elements" structure was completely removed.
This page contains the release notes for Qiskit, starting from Qiskit 0.45, the first time that Qiskit and Qiskit Terra had the same versions.

..
These release notes get converted into Markdown files via the infrastructure at https://github.com/Qiskit/documentation, which then gets deployed to https://docs.quantum.ibm.com/api/qiskit/release-notes. Changes to these release notes will update those release notes the next time the API docs are generated.

To change release notes prior to Qiskit 0.45, update the Qiskit/documentation repository directly.

.. release-notes::
:earliest-version: 0.45.0
:branch: stable/0.45

.. release-notes::
:earliest-version: 0.25.0
:branch: stable/0.25
2 changes: 1 addition & 1 deletion qiskit/VERSION.txt
Original file line number Diff line number Diff line change
@@ -1 +1 @@
0.45.1
0.45.2
6 changes: 3 additions & 3 deletions qiskit/circuit/delay.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
import numpy as np
from qiskit.circuit.exceptions import CircuitError
from qiskit.circuit.instruction import Instruction
from qiskit.circuit.gate import Gate
from qiskit.circuit.parameterexpression import ParameterExpression


Expand All @@ -29,13 +30,12 @@ def __init__(self, duration, unit="dt"):

super().__init__("delay", 1, 0, params=[duration], unit=unit)

broadcast_arguments = Gate.broadcast_arguments

def inverse(self):
"""Special case. Return self."""
return self

def broadcast_arguments(self, qargs, cargs):
yield [qarg for sublist in qargs for qarg in sublist], []

def c_if(self, classical, val):
raise CircuitError("Conditional Delay is not yet implemented.")

Expand Down
10 changes: 10 additions & 0 deletions qiskit/circuit/library/blueprintcircuit.py
Original file line number Diff line number Diff line change
Expand Up @@ -175,6 +175,16 @@ def num_connected_components(self, unitary_only=False):
self._build()
return super().num_connected_components(unitary_only=unitary_only)

def copy_empty_like(self, name=None):
if not self._is_built:
self._build()
cpy = super().copy_empty_like(name=name)
# The base `copy_empty_like` will typically trigger code that `BlueprintCircuit` treats as
# an "invalidation", so we have to manually restore properties deleted by that that
# `copy_empty_like` is supposed to propagate.
cpy.global_phase = self.global_phase
return cpy

def copy(self, name=None):
if not self._is_built:
self._build()
Expand Down
6 changes: 3 additions & 3 deletions qiskit/circuit/library/data_preparation/zz_feature_map.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@


class ZZFeatureMap(PauliFeatureMap):
"""Second-order Pauli-Z evolution circuit.
r"""Second-order Pauli-Z evolution circuit.

For 3 qubits and 1 repetition and linear entanglement the circuit is represented by:

Expand All @@ -32,8 +32,8 @@ class ZZFeatureMap(PauliFeatureMap):
┤ H ├┤ U1(2.0*φ(x[2])) ├──────────────────────────────────┤ X ├┤ U1(2.0*φ(x[1],x[2])) ├┤ X ├
└───┘└─────────────────┘ └───┘└──────────────────────┘└───┘

where ``φ`` is a classical non-linear function, which defaults to ``φ(x) = x`` if and
``φ(x,y) = (pi - x)(pi - y)``.
where :math:`\varphi` is a classical non-linear function, which defaults to :math:`\varphi(x) = x`
if and :math:`\varphi(x,y) = (\pi - x)(\pi - y)`.

Examples:

Expand Down
27 changes: 17 additions & 10 deletions qiskit/circuit/library/generalized_gates/linear_function.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,9 @@
from qiskit.synthesis.linear import check_invertible_binary_matrix
from qiskit.circuit.library.generalized_gates.permutation import PermutationGate

# pylint: disable=cyclic-import
from qiskit.quantum_info import Clifford


class LinearFunction(Gate):
r"""A linear reversible circuit on n qubits.
Expand Down Expand Up @@ -62,16 +65,23 @@ class LinearFunction(Gate):
`Online at umich.edu. <https://web.eecs.umich.edu/~imarkov/pubs/jour/qic08-cnot.pdf>`_
"""

def __init__(self, linear, validate_input=False):
def __init__(
self,
linear: list[list]
| np.ndarray[bool]
| QuantumCircuit
| LinearFunction
| PermutationGate
| Clifford,
validate_input: bool = False,
) -> None:
"""Create a new linear function.

Args:
linear (list[list] or ndarray[bool] or QuantumCircuit or LinearFunction
or PermutationGate or Clifford): data from which a linear function
can be constructed. It can be either a nxn matrix (describing the
linear transformation), a permutation (which is a special case of
a linear function), another linear function, a clifford (when it
corresponds to a linear function), or a quantum circuit composed of
linear: data from which a linear function can be constructed. It can be either a
nxn matrix (describing the linear transformation), a permutation (which is a
special case of a linear function), another linear function, a clifford (when
it corresponds to a linear function), or a quantum circuit composed of
linear gates (CX and SWAP) and other objects described above, including
nested subcircuits.

Expand All @@ -86,9 +96,6 @@ def __init__(self, linear, validate_input=False):
not correspond to a linear function).
"""

# pylint: disable=cyclic-import
from qiskit.quantum_info import Clifford

original_circuit = None

if isinstance(linear, (list, np.ndarray)):
Expand Down
10 changes: 5 additions & 5 deletions qiskit/circuit/library/generalized_gates/rv.py
Original file line number Diff line number Diff line change
Expand Up @@ -36,14 +36,14 @@ class RVGate(Gate):

.. math::

\newcommand{\th}{|\vec{v}|}
\newcommand{\rotationangle}{|\vec{v}|}
\newcommand{\sinc}{\text{sinc}}
R(\vec{v}) = e^{-i \vec{v}\cdot\vec{\sigma}} =
\begin{pmatrix}
\cos\left(\th\right) -i v_z \sinc\left(\th\right)
& -(i v_x + v_y) \sinc\left(\th\right) \\
-(i v_x - v_y) \sinc\left(\th\right)
& \cos\left(\th\right) + i v_z \sinc\left(\th\right)
\cos\left(\rotationangle\right) -i v_z \sinc\left(\rotationangle\right)
& -(i v_x + v_y) \sinc\left(\rotationangle\right) \\
-(i v_x - v_y) \sinc\left(\rotationangle\right)
& \cos\left(\rotationangle\right) + i v_z \sinc\left(\rotationangle\right)
\end{pmatrix}
"""

Expand Down
9 changes: 3 additions & 6 deletions qiskit/circuit/library/n_local/excitation_preserving.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,12 +30,12 @@ class ExcitationPreserving(TwoLocal):

.. math::

\newcommand{\th}{\theta/2}
\newcommand{\rotationangle}{\theta/2}

\begin{pmatrix}
1 & 0 & 0 & 0 \\
0 & \cos\left(\th\right) & -i\sin\left(\th\right) & 0 \\
0 & -i\sin\left(\th\right) & \cos\left(\th\right) & 0 \\
0 & \cos\left(\rotationangle\right) & -i\sin\left(\rotationangle\right) & 0 \\
0 & -i\sin\left(\rotationangle\right) & \cos\left(\rotationangle\right) & 0 \\
0 & 0 & 0 & e^{-i\phi}
\end{pmatrix}

Expand Down Expand Up @@ -116,9 +116,6 @@ def __init__(
See the Examples section of :class:`~qiskit.circuit.library.TwoLocal` for more
detail.
initial_state: A `QuantumCircuit` object to prepend to the circuit.
skip_unentangled_qubits: If True, the single qubit gates are only applied to qubits
that are entangled with another qubit. If False, the single qubit gates are applied
to each qubit in the Ansatz. Defaults to False.
skip_unentangled_qubits: If True, the single qubit gates are only applied to qubits
that are entangled with another qubit. If False, the single qubit gates are applied
to each qubit in the Ansatz. Defaults to False.
Expand Down
10 changes: 10 additions & 0 deletions qiskit/circuit/library/n_local/pauli_two_design.py
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,16 @@ def __init__(
insert_barriers: bool = False,
name: str = "PauliTwoDesign",
):
"""
Args:
num_qubits: The number of qubits of the Pauli Two-Design circuit.
reps: Specifies how often a block consisting of a rotation layer and entanglement
layer is repeated.
seed: The seed for randomly choosing the axes of the Pauli rotations.
insert_barriers: If ``True``, barriers are inserted in between each layer. If ``False``,
no barriers are inserted. Defaults to ``False``.

"""
from qiskit.circuit.library import RYGate # pylint: disable=cyclic-import

# store a random number generator
Expand Down
3 changes: 0 additions & 3 deletions qiskit/circuit/library/n_local/real_amplitudes.py
Original file line number Diff line number Diff line change
Expand Up @@ -144,9 +144,6 @@ def __init__(
See the Examples section of :class:`~qiskit.circuit.library.TwoLocal` for more
detail.
initial_state: A `QuantumCircuit` object to prepend to the circuit.
skip_unentangled_qubits: If True, the single qubit gates are only applied to qubits
that are entangled with another qubit. If False, the single qubit gates are applied
to each qubit in the Ansatz. Defaults to False.
skip_unentangled_qubits: If True, the single qubit gates are only applied to qubits
that are entangled with another qubit. If False, the single qubit gates are applied
to each qubit in the Ansatz. Defaults to False.
Expand Down
2 changes: 1 addition & 1 deletion qiskit/circuit/library/phase_estimation.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ class PhaseEstimation(QuantumCircuit):

In the Quantum Phase Estimation (QPE) algorithm [1, 2, 3], the Phase Estimation circuit is used
to estimate the phase :math:`\phi` of an eigenvalue :math:`e^{2\pi i\phi}` of a unitary operator
:math:`U`, provided with the corresponding eigenstate :math:`|psi\rangle`.
:math:`U`, provided with the corresponding eigenstate :math:`|\psi\rangle`.
That is

.. math::
Expand Down
8 changes: 4 additions & 4 deletions qiskit/circuit/library/standard_gates/r.py
Original file line number Diff line number Diff line change
Expand Up @@ -40,12 +40,12 @@ class RGate(Gate):

.. math::

\newcommand{\th}{\frac{\theta}{2}}
\newcommand{\rotationangle}{\frac{\theta}{2}}

R(\theta, \phi) = e^{-i \th \left(\cos{\phi} x + \sin{\phi} y\right)} =
R(\theta, \phi) = e^{-i \rotationangle \left(\cos{\phi} x + \sin{\phi} y\right)} =
\begin{pmatrix}
\cos\left(\th\right) & -i e^{-i \phi} \sin\left(\th\right) \\
-i e^{i \phi} \sin\left(\th\right) & \cos\left(\th\right)
\cos\left(\rotationangle\right) & -i e^{-i \phi} \sin\left(\rotationangle\right) \\
-i e^{i \phi} \sin\left(\rotationangle\right) & \cos\left(\rotationangle\right)
\end{pmatrix}
"""

Expand Down
20 changes: 10 additions & 10 deletions qiskit/circuit/library/standard_gates/rx.py
Original file line number Diff line number Diff line change
Expand Up @@ -41,12 +41,12 @@ class RXGate(Gate):

.. math::

\newcommand{\th}{\frac{\theta}{2}}
\newcommand{\rotationangle}{\frac{\theta}{2}}

RX(\theta) = \exp\left(-i \th X\right) =
RX(\theta) = \exp\left(-i \rotationangle X\right) =
\begin{pmatrix}
\cos\left(\th\right) & -i\sin\left(\th\right) \\
-i\sin\left(\th\right) & \cos\left(\th\right)
\cos\left(\rotationangle\right) & -i\sin\left(\rotationangle\right) \\
-i\sin\left(\rotationangle\right) & \cos\left(\rotationangle\right)
\end{pmatrix}
"""

Expand Down Expand Up @@ -133,15 +133,15 @@ class CRXGate(ControlledGate):

.. math::

\newcommand{\th}{\frac{\theta}{2}}
\newcommand{\rotationangle}{\frac{\theta}{2}}

CRX(\theta)\ q_0, q_1 =
I \otimes |0\rangle\langle 0| + RX(\theta) \otimes |1\rangle\langle 1| =
\begin{pmatrix}
1 & 0 & 0 & 0 \\
0 & \cos\left(\th\right) & 0 & -i\sin\left(\th\right) \\
0 & \cos\left(\rotationangle\right) & 0 & -i\sin\left(\rotationangle\right) \\
0 & 0 & 1 & 0 \\
0 & -i\sin\left(\th\right) & 0 & \cos\left(\th\right)
0 & -i\sin\left(\rotationangle\right) & 0 & \cos\left(\rotationangle\right)
\end{pmatrix}

.. note::
Expand All @@ -160,15 +160,15 @@ class CRXGate(ControlledGate):

.. math::

\newcommand{\th}{\frac{\theta}{2}}
\newcommand{\rotationangle}{\frac{\theta}{2}}

CRX(\theta)\ q_1, q_0 =
|0\rangle\langle0| \otimes I + |1\rangle\langle1| \otimes RX(\theta) =
\begin{pmatrix}
1 & 0 & 0 & 0 \\
0 & 1 & 0 & 0 \\
0 & 0 & \cos\left(\th\right) & -i\sin\left(\th\right) \\
0 & 0 & -i\sin\left(\th\right) & \cos\left(\th\right)
0 & 0 & \cos\left(\rotationangle\right) & -i\sin\left(\rotationangle\right) \\
0 & 0 & -i\sin\left(\rotationangle\right) & \cos\left(\rotationangle\right)
\end{pmatrix}
"""

Expand Down
12 changes: 6 additions & 6 deletions qiskit/circuit/library/standard_gates/rxx.py
Original file line number Diff line number Diff line change
Expand Up @@ -41,14 +41,14 @@ class RXXGate(Gate):

.. math::

\newcommand{\th}{\frac{\theta}{2}}
\newcommand{\rotationangle}{\frac{\theta}{2}}

R_{XX}(\theta) = \exp\left(-i \th X{\otimes}X\right) =
R_{XX}(\theta) = \exp\left(-i \rotationangle X{\otimes}X\right) =
\begin{pmatrix}
\cos\left(\th\right) & 0 & 0 & -i\sin\left(\th\right) \\
0 & \cos\left(\th\right) & -i\sin\left(\th\right) & 0 \\
0 & -i\sin\left(\th\right) & \cos\left(\th\right) & 0 \\
-i\sin\left(\th\right) & 0 & 0 & \cos\left(\th\right)
\cos\left(\rotationangle\right) & 0 & 0 & -i\sin\left(\rotationangle\right) \\
0 & \cos\left(\rotationangle\right) & -i\sin\left(\rotationangle\right) & 0 \\
0 & -i\sin\left(\rotationangle\right) & \cos\left(\rotationangle\right) & 0 \\
-i\sin\left(\rotationangle\right) & 0 & 0 & \cos\left(\rotationangle\right)
\end{pmatrix}

**Examples:**
Expand Down
Loading