Skip to content

Commit 16f9bba

Browse files
committed
Fix conflict
2 parents c564cfe + 0dd2212 commit 16f9bba

File tree

146 files changed

+1308
-679
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

146 files changed

+1308
-679
lines changed

.github/CODEOWNERS

+1-1
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ pulse/ @Qiskit/terra-core @eggerdj @wshanks
3333
synthesis/ @Qiskit/terra-core @alexanderivrii @ShellyGarion
3434
scheduler/ @Qiskit/terra-core @eggerdj @wshanks
3535
visualization/ @Qiskit/terra-core @nonhermitian
36-
primitives/ @Qiskit/terra-core @ikkoham @t-imamichi
36+
primitives/ @Qiskit/terra-core @Qiskit/qiskit-primitives
3737
# Override the release notes directories to have _no_ code owners, so any review
3838
# from somebody with write access is acceptable.
3939
/releasenotes/notes

Cargo.lock

+2-2
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.toml

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
members = ["crates/*"]
33

44
[workspace.package]
5-
version = "0.45.1"
5+
version = "0.45.2"
66
edition = "2021"
77
rust-version = "1.64" # Keep in sync with README.md and rust-toolchain.toml.
88
license = "Apache-2.0"

asv.conf.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818
"dvcs": "git",
1919
"environment_type": "virtualenv",
2020
"show_commit_url": "http://github.com/Qiskit/qiskit-terra/commit/",
21-
"pythons": ["3.8", "3.9", "3.10", "3.11"],
21+
"pythons": ["3.8", "3.9", "3.10", "3.11", "3.12"],
2222
"benchmark_dir": "test/benchmarks",
2323
"env_dir": ".asv/env",
2424
"results_dir": ".asv/results"

docs/apidoc/synthesis_aqc.rst

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1-
.. _qiskit-transpiler-synthesis-aqc:
1+
.. _qiskit-synthesis-unitary-aqc:
22

3-
.. automodule:: qiskit.transpiler.synthesis.aqc
3+
.. automodule:: qiskit.synthesis.unitary.aqc
44
:no-members:
55
:no-inherited-members:
66
:no-special-members:

docs/conf.py

+6-4
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@
2626
# The short X.Y version
2727
version = "0.45"
2828
# The full version, including alpha/beta/rc tags
29-
release = "0.45.1"
29+
release = "0.45.2"
3030

3131
language = "en"
3232

@@ -40,11 +40,13 @@
4040
"sphinx.ext.napoleon",
4141
"sphinx.ext.autodoc",
4242
"sphinx.ext.autosummary",
43-
"sphinx.ext.mathjax",
4443
"sphinx.ext.intersphinx",
4544
"sphinx.ext.doctest",
45+
# This is used by qiskit/documentation to generate links to github.com.
46+
"sphinx.ext.viewcode",
4647
"matplotlib.sphinxext.plot_directive",
4748
"reno.sphinxext",
49+
"sphinxcontrib.katex",
4850
]
4951

5052
templates_path = ["_templates"]
@@ -75,8 +77,8 @@
7577
# ----------------------------------------------------------------------------------
7678

7779
intersphinx_mapping = {
78-
"rustworkx": ("https://qiskit.org/ecosystem/rustworkx/", None),
79-
"qiskit-ibm-runtime": ("https://qiskit.org/ecosystem/ibm-runtime/", None),
80+
"rustworkx": ("https://www.rustworkx.org/", None),
81+
"qiskit-ibm-runtime": ("https://docs.quantum.ibm.com/api/qiskit-ibm-runtime/", None),
8082
"qiskit-aer": ("https://qiskit.org/ecosystem/aer/", None),
8183
"numpy": ("https://numpy.org/doc/stable/", None),
8284
"matplotlib": ("https://matplotlib.org/stable/", None),

docs/release_notes.rst

+6-6
Original file line numberDiff line numberDiff line change
@@ -4,13 +4,13 @@
44
Release Notes
55
%%%%%%%%%%%%%
66

7-
This page contains the release notes for Qiskit, starting from the point at which the legacy
8-
"elements" structure was completely removed.
7+
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.
8+
9+
..
10+
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.
11+
12+
To change release notes prior to Qiskit 0.45, update the Qiskit/documentation repository directly.
913

1014
.. release-notes::
1115
:earliest-version: 0.45.0
1216
:branch: stable/0.45
13-
14-
.. release-notes::
15-
:earliest-version: 0.25.0
16-
:branch: stable/0.25

qiskit/VERSION.txt

+1-1
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
0.45.1
1+
0.45.2

qiskit/circuit/delay.py

+3-3
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@
1616
import numpy as np
1717
from qiskit.circuit.exceptions import CircuitError
1818
from qiskit.circuit.instruction import Instruction
19+
from qiskit.circuit.gate import Gate
1920
from qiskit.circuit.parameterexpression import ParameterExpression
2021

2122

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

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

33+
broadcast_arguments = Gate.broadcast_arguments
34+
3235
def inverse(self):
3336
"""Special case. Return self."""
3437
return self
3538

36-
def broadcast_arguments(self, qargs, cargs):
37-
yield [qarg for sublist in qargs for qarg in sublist], []
38-
3939
def c_if(self, classical, val):
4040
raise CircuitError("Conditional Delay is not yet implemented.")
4141

qiskit/circuit/library/blueprintcircuit.py

+10
Original file line numberDiff line numberDiff line change
@@ -175,6 +175,16 @@ def num_connected_components(self, unitary_only=False):
175175
self._build()
176176
return super().num_connected_components(unitary_only=unitary_only)
177177

178+
def copy_empty_like(self, name=None):
179+
if not self._is_built:
180+
self._build()
181+
cpy = super().copy_empty_like(name=name)
182+
# The base `copy_empty_like` will typically trigger code that `BlueprintCircuit` treats as
183+
# an "invalidation", so we have to manually restore properties deleted by that that
184+
# `copy_empty_like` is supposed to propagate.
185+
cpy.global_phase = self.global_phase
186+
return cpy
187+
178188
def copy(self, name=None):
179189
if not self._is_built:
180190
self._build()

qiskit/circuit/library/data_preparation/state_preparation.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -419,7 +419,7 @@ def prepare_state(self, state, qubits=None, label=None, normalize=False):
419419
r"""Prepare qubits in a specific state.
420420
421421
This class implements a state preparing unitary. Unlike
422-
:class:`qiskit.extensions.Initialize` it does not reset the qubits first.
422+
:class:`~qiskit.circuit.library.Initialize` it does not reset the qubits first.
423423
424424
Args:
425425
state (str or list or int or Statevector):

qiskit/circuit/library/data_preparation/zz_feature_map.py

+3-3
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818

1919

2020
class ZZFeatureMap(PauliFeatureMap):
21-
"""Second-order Pauli-Z evolution circuit.
21+
r"""Second-order Pauli-Z evolution circuit.
2222
2323
For 3 qubits and 1 repetition and linear entanglement the circuit is represented by:
2424
@@ -32,8 +32,8 @@ class ZZFeatureMap(PauliFeatureMap):
3232
┤ H ├┤ U1(2.0*φ(x[2])) ├──────────────────────────────────┤ X ├┤ U1(2.0*φ(x[1],x[2])) ├┤ X ├
3333
└───┘└─────────────────┘ └───┘└──────────────────────┘└───┘
3434
35-
where ``φ`` is a classical non-linear function, which defaults to ``φ(x) = x`` if and
36-
``φ(x,y) = (pi - x)(pi - y)``.
35+
where :math:`\varphi` is a classical non-linear function, which defaults to :math:`\varphi(x) = x`
36+
if and :math:`\varphi(x,y) = (\pi - x)(\pi - y)`.
3737
3838
Examples:
3939

qiskit/circuit/library/generalized_gates/linear_function.py

+18-11
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,9 @@
1919
from qiskit.synthesis.linear import check_invertible_binary_matrix
2020
from qiskit.circuit.library.generalized_gates.permutation import PermutationGate
2121

22+
# pylint: disable=cyclic-import
23+
from qiskit.quantum_info import Clifford
24+
2225

2326
class LinearFunction(Gate):
2427
r"""A linear reversible circuit on n qubits.
@@ -27,7 +30,7 @@ class LinearFunction(Gate):
2730
as a n x n matrix of 0s and 1s in numpy array format.
2831
2932
A linear function can be synthesized into CX and SWAP gates using the Patel–Markov–Hayes
30-
algorithm, as implemented in :func:`~qiskit.transpiler.synthesis.cnot_synth`
33+
algorithm, as implemented in :func:`~qiskit.synthesis.synth_cnot_count_full_pmh`
3134
based on reference [1].
3235
3336
For efficiency, the internal n x n matrix is stored in the format expected
@@ -62,16 +65,23 @@ class LinearFunction(Gate):
6265
`Online at umich.edu. <https://web.eecs.umich.edu/~imarkov/pubs/jour/qic08-cnot.pdf>`_
6366
"""
6467

65-
def __init__(self, linear, validate_input=False):
68+
def __init__(
69+
self,
70+
linear: list[list]
71+
| np.ndarray[bool]
72+
| QuantumCircuit
73+
| LinearFunction
74+
| PermutationGate
75+
| Clifford,
76+
validate_input: bool = False,
77+
) -> None:
6678
"""Create a new linear function.
6779
6880
Args:
69-
linear (list[list] or ndarray[bool] or QuantumCircuit or LinearFunction
70-
or PermutationGate or Clifford): data from which a linear function
71-
can be constructed. It can be either a nxn matrix (describing the
72-
linear transformation), a permutation (which is a special case of
73-
a linear function), another linear function, a clifford (when it
74-
corresponds to a linear function), or a quantum circuit composed of
81+
linear: data from which a linear function can be constructed. It can be either a
82+
nxn matrix (describing the linear transformation), a permutation (which is a
83+
special case of a linear function), another linear function, a clifford (when
84+
it corresponds to a linear function), or a quantum circuit composed of
7585
linear gates (CX and SWAP) and other objects described above, including
7686
nested subcircuits.
7787
@@ -86,9 +96,6 @@ def __init__(self, linear, validate_input=False):
8696
not correspond to a linear function).
8797
"""
8898

89-
# pylint: disable=cyclic-import
90-
from qiskit.quantum_info import Clifford
91-
9299
original_circuit = None
93100

94101
if isinstance(linear, (list, np.ndarray)):

qiskit/circuit/library/generalized_gates/rv.py

+7-7
Original file line numberDiff line numberDiff line change
@@ -36,14 +36,14 @@ class RVGate(Gate):
3636
3737
.. math::
3838
39-
\newcommand{\th}{|\vec{v}|}
39+
\newcommand{\rotationangle}{|\vec{v}|}
4040
\newcommand{\sinc}{\text{sinc}}
4141
R(\vec{v}) = e^{-i \vec{v}\cdot\vec{\sigma}} =
4242
\begin{pmatrix}
43-
\cos\left(\th\right) -i v_z \sinc\left(\th\right)
44-
& -(i v_x + v_y) \sinc\left(\th\right) \\
45-
-(i v_x - v_y) \sinc\left(\th\right)
46-
& \cos\left(\th\right) + i v_z \sinc\left(\th\right)
43+
\cos\left(\rotationangle\right) -i v_z \sinc\left(\rotationangle\right)
44+
& -(i v_x + v_y) \sinc\left(\rotationangle\right) \\
45+
-(i v_x - v_y) \sinc\left(\rotationangle\right)
46+
& \cos\left(\rotationangle\right) + i v_z \sinc\left(\rotationangle\right)
4747
\end{pmatrix}
4848
"""
4949

@@ -55,10 +55,10 @@ def __init__(self, v_x, v_y, v_z, basis="U"):
5555
v_y (float): y-component
5656
v_z (float): z-component
5757
basis (str, optional): basis (see
58-
:class:`~qiskit.quantum_info.synthesis.one_qubit_decompose.OneQubitEulerDecomposer`)
58+
:class:`~qiskit.synthesis.one_qubit.one_qubit_decompose.OneQubitEulerDecomposer`)
5959
"""
6060
# pylint: disable=cyclic-import
61-
from qiskit.quantum_info.synthesis.one_qubit_decompose import OneQubitEulerDecomposer
61+
from qiskit.synthesis.one_qubit.one_qubit_decompose import OneQubitEulerDecomposer
6262

6363
super().__init__("rv", 1, [v_x, v_y, v_z])
6464
self._decomposer = OneQubitEulerDecomposer(basis=basis)

qiskit/circuit/library/generalized_gates/uc.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@
3535
from qiskit.exceptions import QiskitError
3636

3737
# pylint: disable=cyclic-import
38-
from qiskit.quantum_info.synthesis.one_qubit_decompose import OneQubitEulerDecomposer
38+
from qiskit.synthesis.one_qubit.one_qubit_decompose import OneQubitEulerDecomposer
3939

4040
from .diagonal import Diagonal
4141

qiskit/circuit/library/generalized_gates/unitary.py

+3-3
Original file line numberDiff line numberDiff line change
@@ -28,8 +28,8 @@
2828
from qiskit.quantum_info.operators.predicates import is_unitary_matrix
2929

3030
# pylint: disable=cyclic-import
31-
from qiskit.quantum_info.synthesis.one_qubit_decompose import OneQubitEulerDecomposer
32-
from qiskit.quantum_info.synthesis.two_qubit_decompose import two_qubit_cnot_decompose
31+
from qiskit.synthesis.one_qubit.one_qubit_decompose import OneQubitEulerDecomposer
32+
from qiskit.synthesis.two_qubit.two_qubit_decompose import two_qubit_cnot_decompose
3333

3434
from .isometry import Isometry
3535

@@ -148,7 +148,7 @@ def _define(self):
148148
elif self.num_qubits == 2:
149149
self.definition = two_qubit_cnot_decompose(self.to_matrix())
150150
else:
151-
from qiskit.quantum_info.synthesis.qsd import ( # pylint: disable=cyclic-import
151+
from qiskit.synthesis.unitary.qsd import ( # pylint: disable=cyclic-import
152152
qs_decomposition,
153153
)
154154

qiskit/circuit/library/n_local/excitation_preserving.py

+3-6
Original file line numberDiff line numberDiff line change
@@ -30,12 +30,12 @@ class ExcitationPreserving(TwoLocal):
3030
3131
.. math::
3232
33-
\newcommand{\th}{\theta/2}
33+
\newcommand{\rotationangle}{\theta/2}
3434
3535
\begin{pmatrix}
3636
1 & 0 & 0 & 0 \\
37-
0 & \cos\left(\th\right) & -i\sin\left(\th\right) & 0 \\
38-
0 & -i\sin\left(\th\right) & \cos\left(\th\right) & 0 \\
37+
0 & \cos\left(\rotationangle\right) & -i\sin\left(\rotationangle\right) & 0 \\
38+
0 & -i\sin\left(\rotationangle\right) & \cos\left(\rotationangle\right) & 0 \\
3939
0 & 0 & 0 & e^{-i\phi}
4040
\end{pmatrix}
4141
@@ -116,9 +116,6 @@ def __init__(
116116
See the Examples section of :class:`~qiskit.circuit.library.TwoLocal` for more
117117
detail.
118118
initial_state: A `QuantumCircuit` object to prepend to the circuit.
119-
skip_unentangled_qubits: If True, the single qubit gates are only applied to qubits
120-
that are entangled with another qubit. If False, the single qubit gates are applied
121-
to each qubit in the Ansatz. Defaults to False.
122119
skip_unentangled_qubits: If True, the single qubit gates are only applied to qubits
123120
that are entangled with another qubit. If False, the single qubit gates are applied
124121
to each qubit in the Ansatz. Defaults to False.

qiskit/circuit/library/n_local/pauli_two_design.py

+10
Original file line numberDiff line numberDiff line change
@@ -75,6 +75,16 @@ def __init__(
7575
insert_barriers: bool = False,
7676
name: str = "PauliTwoDesign",
7777
):
78+
"""
79+
Args:
80+
num_qubits: The number of qubits of the Pauli Two-Design circuit.
81+
reps: Specifies how often a block consisting of a rotation layer and entanglement
82+
layer is repeated.
83+
seed: The seed for randomly choosing the axes of the Pauli rotations.
84+
insert_barriers: If ``True``, barriers are inserted in between each layer. If ``False``,
85+
no barriers are inserted. Defaults to ``False``.
86+
87+
"""
7888
from qiskit.circuit.library import RYGate # pylint: disable=cyclic-import
7989

8090
# store a random number generator

qiskit/circuit/library/n_local/real_amplitudes.py

-3
Original file line numberDiff line numberDiff line change
@@ -144,9 +144,6 @@ def __init__(
144144
See the Examples section of :class:`~qiskit.circuit.library.TwoLocal` for more
145145
detail.
146146
initial_state: A `QuantumCircuit` object to prepend to the circuit.
147-
skip_unentangled_qubits: If True, the single qubit gates are only applied to qubits
148-
that are entangled with another qubit. If False, the single qubit gates are applied
149-
to each qubit in the Ansatz. Defaults to False.
150147
skip_unentangled_qubits: If True, the single qubit gates are only applied to qubits
151148
that are entangled with another qubit. If False, the single qubit gates are applied
152149
to each qubit in the Ansatz. Defaults to False.

qiskit/circuit/library/pauli_evolution.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919

2020
from qiskit.circuit.gate import Gate
2121
from qiskit.circuit.parameterexpression import ParameterExpression
22-
from qiskit.synthesis import EvolutionSynthesis, LieTrotter
22+
from qiskit.synthesis.evolution import EvolutionSynthesis, LieTrotter
2323
from qiskit.quantum_info import Pauli, SparsePauliOp
2424

2525

qiskit/circuit/library/phase_estimation.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ class PhaseEstimation(QuantumCircuit):
2424
2525
In the Quantum Phase Estimation (QPE) algorithm [1, 2, 3], the Phase Estimation circuit is used
2626
to estimate the phase :math:`\phi` of an eigenvalue :math:`e^{2\pi i\phi}` of a unitary operator
27-
:math:`U`, provided with the corresponding eigenstate :math:`|psi\rangle`.
27+
:math:`U`, provided with the corresponding eigenstate :math:`|\psi\rangle`.
2828
That is
2929
3030
.. math::

0 commit comments

Comments
 (0)