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

Move PendingDeprecations to Deprecations in the circuit library #13604

Draft
wants to merge 1 commit into
base: stable/1.4
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
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
3 changes: 1 addition & 2 deletions qiskit/circuit/library/arithmetic/adders/adder.py
Original file line number Diff line number Diff line change
Expand Up @@ -43,14 +43,13 @@ class Adder(QuantumCircuit):
"""

@deprecate_func(
since="1.3",
since="1.4",
additional_msg=(
"Use the adder gates provided in qiskit.circuit.library.arithmetic instead. "
"The gate type depends on the adder kind: fixed, half, full are represented by "
"ModularAdderGate, HalfAdderGate, FullAdderGate, respectively. For different adder "
"implementations, see https://docs.quantum.ibm.com/api/qiskit/synthesis.",
),
pending=True,
)
def __init__(self, num_state_qubits: int, name: str = "Adder") -> None:
"""
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -47,13 +47,12 @@ class Multiplier(QuantumCircuit):
"""

@deprecate_func(
since="1.3",
since="1.4",
additional_msg=(
"Use the MultiplierGate provided in qiskit.circuit.library.arithmetic instead. "
"For different multiplier implementations, see "
"https://docs.quantum.ibm.com/api/qiskit/synthesis.",
),
pending=True,
)
def __init__(
self,
Expand Down
3 changes: 1 addition & 2 deletions qiskit/circuit/library/basis_change/qft.py
Original file line number Diff line number Diff line change
Expand Up @@ -73,12 +73,11 @@ class QFT(BlueprintCircuit):
"""

@deprecate_func(
since="1.3",
since="1.4",
additional_msg=(
"Use qiskit.circuit.library.QFTGate or qiskit.synthesis.qft.synth_qft_full instead, "
"for access to all previous arguments.",
),
pending=True,
)
def __init__(
self,
Expand Down
3 changes: 1 addition & 2 deletions qiskit/circuit/library/boolean_logic/inner_product.py
Original file line number Diff line number Diff line change
Expand Up @@ -63,9 +63,8 @@ class InnerProduct(QuantumCircuit):
"""

@deprecate_func(
since="1.3",
since="1.4",
additional_msg="Use qiskit.circuit.library.InnerProductGate instead.",
pending=True,
)
def __init__(self, num_qubits: int) -> None:
"""Return a circuit to compute the inner product of 2 n-qubit registers.
Expand Down
3 changes: 1 addition & 2 deletions qiskit/circuit/library/boolean_logic/quantum_and.py
Original file line number Diff line number Diff line change
Expand Up @@ -52,9 +52,8 @@ class AND(QuantumCircuit):
"""

@deprecate_func(
since="1.3",
since="1.4",
additional_msg="Use qiskit.circuit.library.AndGate instead.",
pending=True,
)
def __init__(
self,
Expand Down
3 changes: 1 addition & 2 deletions qiskit/circuit/library/boolean_logic/quantum_or.py
Original file line number Diff line number Diff line change
Expand Up @@ -53,9 +53,8 @@ class OR(QuantumCircuit):
"""

@deprecate_func(
since="1.3",
since="1.4",
additional_msg="Use qiskit.circuit.library.OrGate instead.",
pending=True,
)
def __init__(
self,
Expand Down
3 changes: 1 addition & 2 deletions qiskit/circuit/library/boolean_logic/quantum_xor.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,10 +30,9 @@ class XOR(QuantumCircuit):
"""

@deprecate_func(
since="1.3",
since="1.4",
additional_msg="Instead, for xor-ing with a specified amount, use BitwiseXorGate,"
"and for xor-ing with a random amount, use random_bitwise_xor.",
pending=True,
)
def __init__(
self,
Expand Down
3 changes: 1 addition & 2 deletions qiskit/circuit/library/data_preparation/_z_feature_map.py
Original file line number Diff line number Diff line change
Expand Up @@ -76,12 +76,11 @@ class ZFeatureMap(PauliFeatureMap):
"""

@deprecate_func(
since="1.3",
since="1.4",
additional_msg=(
"Use the z_feature_map function as a replacement. Note that this will no longer "
"return a BlueprintCircuit, but just a plain QuantumCircuit."
),
pending=True,
)
def __init__(
self,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -96,12 +96,11 @@ class ZZFeatureMap(PauliFeatureMap):
"""

@deprecate_func(
since="1.3",
since="1.4",
additional_msg=(
"Use the z_feature_map function as a replacement. Note that this will no longer "
"return a BlueprintCircuit, but just a plain QuantumCircuit."
),
pending=True,
)
def __init__(
self,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -408,12 +408,11 @@ class PauliFeatureMap(NLocal):
"""

@deprecate_func(
since="1.3",
since="1.4",
additional_msg=(
"Use the pauli_feature_map function as a replacement. Note that this will no longer "
"return a BlueprintCircuit, but just a plain QuantumCircuit."
),
pending=True,
)
def __init__(
self,
Expand Down
3 changes: 1 addition & 2 deletions qiskit/circuit/library/fourier_checking.py
Original file line number Diff line number Diff line change
Expand Up @@ -54,9 +54,8 @@ class FourierChecking(QuantumCircuit):
"""

@deprecate_func(
since="1.3",
since="1.4",
additional_msg="Use qiskit.circuit.library.fourier_checking instead.",
pending=True,
)
def __init__(self, f: Sequence[int], g: Sequence[int]) -> None:
"""Create Fourier checking circuit.
Expand Down
2 changes: 1 addition & 1 deletion qiskit/circuit/library/generalized_gates/diagonal.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@
class Diagonal(QuantumCircuit):
"""Circuit implementing a diagonal transformation."""

@deprecate_func(since="1.3", additional_msg="Use DiagonalGate instead.", pending=True)
@deprecate_func(since="1.4", additional_msg="Use DiagonalGate instead.")
def __init__(self, diag: Sequence[complex]) -> None:
r"""
Args:
Expand Down
2 changes: 1 addition & 1 deletion qiskit/circuit/library/generalized_gates/gms.py
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ class GMS(QuantumCircuit):
`arXiv:1707.06356 <https://arxiv.org/abs/1707.06356>`_
"""

@deprecate_func(since="1.3", additional_msg="Use the MSGate instead.", pending=True)
@deprecate_func(since="1.4", additional_msg="Use the MSGate instead.")
def __init__(self, num_qubits: int, theta: list[list[float]] | np.ndarray) -> None:
"""Create a new Global Mølmer–Sørensen (GMS) gate.

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -227,8 +227,7 @@ def _define(self):
self.definition = synth_cnot_count_full_pmh(self.linear)

@deprecate_func(
since="1.3",
pending=True,
since="1.4",
additional_msg="Call LinearFunction.definition instead, or compile the circuit.",
)
def synthesize(self):
Expand Down
5 changes: 2 additions & 3 deletions qiskit/circuit/library/generalized_gates/mcmt.py
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ class MCMT(QuantumCircuit):
:class:`~qiskit.circuit.library.MCMTVChain`.
"""

@deprecate_func(since="1.3", additional_msg="Use MCMTGate instead.", pending=True)
@deprecate_func(since="1.4", additional_msg="Use MCMTGate instead.")
def __init__(
self,
gate: Gate | Callable[[QuantumCircuit, circuit.Qubit, circuit.Qubit], circuit.Instruction],
Expand Down Expand Up @@ -157,9 +157,8 @@ class MCMTVChain(MCMT):
"""

@deprecate_func(
since="1.3",
since="1.4",
additional_msg="Use MCMTGate with the V-chain synthesis plugin instead.",
pending=True,
)
def __init__(
self,
Expand Down
2 changes: 1 addition & 1 deletion qiskit/circuit/library/generalized_gates/permutation.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
class Permutation(QuantumCircuit):
"""An n_qubit circuit that permutes qubits."""

@deprecate_func(since="1.3", pending=True, additional_msg="Use PermutationGate instead.")
@deprecate_func(since="1.4", additional_msg="Use PermutationGate instead.")
def __init__(
self,
num_qubits: int,
Expand Down
3 changes: 1 addition & 2 deletions qiskit/circuit/library/graph_state.py
Original file line number Diff line number Diff line change
Expand Up @@ -58,9 +58,8 @@ class GraphState(QuantumCircuit):
"""

@deprecate_func(
since="1.3",
since="1.4",
additional_msg="Use qiskit.circuit.library.GraphStateGate instead.",
pending=True,
)
def __init__(self, adjacency_matrix: list | np.ndarray) -> None:
"""Create graph state preparation circuit.
Expand Down
3 changes: 1 addition & 2 deletions qiskit/circuit/library/grover_operator.py
Original file line number Diff line number Diff line change
Expand Up @@ -424,9 +424,8 @@ class GroverOperator(QuantumCircuit):
"""

@deprecate_func(
since="1.3",
since="1.4",
additional_msg="Use qiskit.circuit.library.grover_operator instead.",
pending=True,
)
def __init__(
self,
Expand Down
3 changes: 1 addition & 2 deletions qiskit/circuit/library/hidden_linear_function.py
Original file line number Diff line number Diff line change
Expand Up @@ -69,9 +69,8 @@ class HiddenLinearFunction(QuantumCircuit):
"""

@deprecate_func(
since="1.3",
since="1.4",
additional_msg="Use qiskit.circuit.library.hidden_linear_function instead.",
pending=True,
)
def __init__(self, adjacency_matrix: list | np.ndarray) -> None:
"""Create new HLF circuit.
Expand Down
3 changes: 1 addition & 2 deletions qiskit/circuit/library/iqp.py
Original file line number Diff line number Diff line change
Expand Up @@ -63,9 +63,8 @@ class IQP(QuantumCircuit):
"""

@deprecate_func(
since="1.3",
since="1.4",
additional_msg="Use the qiskit.circuit.library.iqp function instead.",
pending=True,
)
def __init__(self, interactions: list | np.ndarray) -> None:
"""Create IQP circuit.
Expand Down
3 changes: 1 addition & 2 deletions qiskit/circuit/library/n_local/efficient_su2.py
Original file line number Diff line number Diff line change
Expand Up @@ -189,9 +189,8 @@ class EfficientSU2(TwoLocal):
"""

@deprecate_func(
since="1.3",
since="1.4",
additional_msg="Use the function qiskit.circuit.library.efficient_su2 instead.",
pending=True,
)
def __init__(
self,
Expand Down
7 changes: 3 additions & 4 deletions qiskit/circuit/library/n_local/excitation_preserving.py
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ def excitation_preserving(
ansatz = excitation_preserving(3, reps=1, insert_barriers=True, entanglement="linear")
ansatz.draw("mpl")

The entanglement structure can be explicitly specified with the ``entanglement``
The entanglement structure can be explicitly specified with the ``entanglement``
argument. The ``"fsim"`` mode includes an additional parameterized :class:`.CPhaseGate`
in each block:

Expand Down Expand Up @@ -203,15 +203,14 @@ class ExcitationPreserving(TwoLocal):

.. seealso::

The :func:`.excitation_preserving` function constructs a functionally equivalent circuit,
The :func:`.excitation_preserving` function constructs a functionally equivalent circuit,
but faster.

"""

@deprecate_func(
since="1.3",
since="1.4",
additional_msg="Use the function qiskit.circuit.library.excitation_preserving instead.",
pending=True,
)
def __init__(
self,
Expand Down
3 changes: 1 addition & 2 deletions qiskit/circuit/library/n_local/n_local.py
Original file line number Diff line number Diff line change
Expand Up @@ -304,9 +304,8 @@ class NLocal(BlueprintCircuit):
"""

@deprecate_func(
since="1.3",
since="1.4",
additional_msg="Use the function qiskit.circuit.library.n_local instead.",
pending=True,
)
def __init__(
self,
Expand Down
3 changes: 1 addition & 2 deletions qiskit/circuit/library/n_local/pauli_two_design.py
Original file line number Diff line number Diff line change
Expand Up @@ -167,9 +167,8 @@ class PauliTwoDesign(TwoLocal):
"""

@deprecate_func(
since="1.3",
since="1.4",
additional_msg="Use the function qiskit.circuit.library.pauli_two_design instead.",
pending=True,
)
def __init__(
self,
Expand Down
3 changes: 1 addition & 2 deletions qiskit/circuit/library/n_local/real_amplitudes.py
Original file line number Diff line number Diff line change
Expand Up @@ -232,9 +232,8 @@ class RealAmplitudes(TwoLocal):
"""

@deprecate_func(
since="1.3",
since="1.4",
additional_msg="Use the function qiskit.circuit.library.real_amplitudes instead.",
pending=True,
)
def __init__(
self,
Expand Down
3 changes: 1 addition & 2 deletions qiskit/circuit/library/n_local/two_local.py
Original file line number Diff line number Diff line change
Expand Up @@ -138,9 +138,8 @@ class TwoLocal(NLocal):
"""

@deprecate_func(
since="1.3",
since="1.4",
additional_msg="Use the function qiskit.circuit.library.n_local instead.",
pending=True,
)
def __init__(
self,
Expand Down
3 changes: 1 addition & 2 deletions qiskit/circuit/library/overlap.py
Original file line number Diff line number Diff line change
Expand Up @@ -60,9 +60,8 @@ class UnitaryOverlap(QuantumCircuit):
"""

@deprecate_func(
since="1.3",
since="1.4",
additional_msg="Use qiskit.circuit.library.unitary_overlap instead.",
pending=True,
)
def __init__(
self,
Expand Down
3 changes: 1 addition & 2 deletions qiskit/circuit/library/phase_estimation.py
Original file line number Diff line number Diff line change
Expand Up @@ -50,9 +50,8 @@ class PhaseEstimation(QuantumCircuit):
"""

@deprecate_func(
since="1.3",
since="1.4",
additional_msg="Use qiskit.circuit.library.phase_estimation instead.",
pending=True,
)
def __init__(
self,
Expand Down
12 changes: 4 additions & 8 deletions qiskit/circuit/library/standard_gates/x.py
Original file line number Diff line number Diff line change
Expand Up @@ -1181,8 +1181,7 @@ def inverse(self, annotated: bool = False):
"qubits is require, one can create a custom gate by calling the corresponding "
"synthesis function directly."
),
since="1.3",
pending=True,
since="1.4",
)
def get_num_ancilla_qubits(num_ctrl_qubits: int, mode: str = "noancilla") -> int:
"""Get the number of required ancilla qubits without instantiating the class.
Expand Down Expand Up @@ -1291,8 +1290,7 @@ def __new__(
"high-level-synthesis plugin `gray_code` for MCX gates, or, alternatively, "
"one can use synth_mcx_gray_code to construct the gate directly."
),
since="1.3",
pending=True,
since="1.4",
)
def __init__(
self,
Expand Down Expand Up @@ -1346,8 +1344,7 @@ class MCXRecursive(MCXGate):
"high-level-synthesis plugin '1_clean_b95' for MCX gates, or, alternatively, "
"one can use synth_mcx_1_clean to construct the gate directly."
),
since="1.3",
pending=True,
since="1.4",
)
def __init__(
self,
Expand Down Expand Up @@ -1437,8 +1434,7 @@ def __new__(
"`n_dirty_i15` (using dirty ancillas) for MCX gates. Alternatively, one can "
"use synth_mcx_n_dirty_i15 and synth_mcx_n_clean_m15 to construct the gate directly."
),
since="1.3",
pending=True,
since="1.4",
)
def __init__(
self,
Expand Down
Loading