Skip to content

Commit

Permalink
Merge branch 'main' into permutations-hls
Browse files Browse the repository at this point in the history
  • Loading branch information
alexanderivrii committed Jan 9, 2023
2 parents e826085 + 27da80d commit 1a02cd2
Show file tree
Hide file tree
Showing 188 changed files with 4,700 additions and 2,274 deletions.
2 changes: 1 addition & 1 deletion docs/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,10 +34,10 @@
"sphinx.ext.viewcode",
"sphinx.ext.extlinks",
"sphinx.ext.intersphinx",
"jupyter_sphinx",
"sphinx_autodoc_typehints",
"reno.sphinxext",
"sphinx_design",
"matplotlib.sphinxext.plot_directive",
]
templates_path = ["_templates"]

Expand Down
8 changes: 4 additions & 4 deletions qiskit/algorithms/__init__.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# This code is part of Qiskit.
#
# (C) Copyright IBM 2018, 2022.
# (C) Copyright IBM 2018, 2023.
#
# This code is licensed under the Apache License, Version 2.0. You may
# obtain a copy of this license in the LICENSE.txt file in the root directory
Expand Down Expand Up @@ -77,7 +77,7 @@
Algorithms to find eigenvalues of an operator. For chemistry these can be used to find excited
states of a molecule, and qiskit-nature has some algorithms that leverage chemistry specific
knowledge to do this in that application domain. These algorithms are pending deprecation.
knowledge to do this in that application domain. These algorithms are deprecated.
One should instead make use of the Eigensolver classes in the section below, which leverage
Runtime primitives.
Expand Down Expand Up @@ -111,7 +111,7 @@
Evolvers
--------
Pending deprecation: This package has been superseded by the package below. It will be
Deprecated: This package has been superseded by the package below. It will be
deprecated in a future release and subsequently removed after that:
`Time Evolvers`_
Expand Down Expand Up @@ -203,7 +203,7 @@
---------------------
Algorithms that can find the minimum eigenvalue of an operator.
These algorithms are pending deprecation. One should instead make use of the
These algorithms are deprecated. One should instead make use of the
Minimum Eigensolver classes in the section below, which leverage Runtime primitives.
.. autosummary::
Expand Down
32 changes: 15 additions & 17 deletions qiskit/algorithms/amplitude_amplifiers/grover.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# This code is part of Qiskit.
#
# (C) Copyright IBM 2018, 2022.
# (C) Copyright IBM 2018, 2023.
#
# This code is licensed under the Apache License, Version 2.0. You may
# obtain a copy of this license in the LICENSE.txt file in the root directory
Expand Down Expand Up @@ -137,7 +137,7 @@ def __init__(
sample_from_iterations: If True, instead of taking the values in ``iterations`` as
powers of the Grover operator, a random integer sample between 0 and smaller value
than the iteration is used as a power, see [1], Section 4.
quantum_instance: Pending deprecation: A Quantum Instance or Backend to run the circuits.
quantum_instance: Deprecated: A Quantum Instance or Backend to run the circuits.
sampler: A Sampler to use for sampling the results of the circuits.
Raises:
Expand Down Expand Up @@ -175,14 +175,14 @@ def __init__(
self._quantum_instance = None
if quantum_instance is not None:
warnings.warn(
"The quantum_instance argument has been superseded by the sampler argument. "
"This argument will be deprecated in a future release and subsequently "
"removed after that.",
category=PendingDeprecationWarning,
"The quantum_instance argument is deprecated as of Qiskit Terra 0.23.0 and "
"will be removed no sooner than 3 months after the release date. Instead, use "
"the sampler argument as a replacement.",
category=DeprecationWarning,
stacklevel=2,
)
with warnings.catch_warnings():
warnings.simplefilter("ignore", category=PendingDeprecationWarning)
warnings.simplefilter("ignore")
self.quantum_instance = quantum_instance

self._sampler = sampler
Expand All @@ -192,13 +192,12 @@ def __init__(

@property
@deprecate_function(
"The Grover.quantum_instance getter is pending deprecation. "
"This property will be deprecated in a future release and subsequently "
"removed after that.",
category=PendingDeprecationWarning,
"The Grover.quantum_instance getter is deprecated as of Qiskit Terra 0.23.0 and "
"will be removed no sooner than 3 months after the release date.",
category=DeprecationWarning,
)
def quantum_instance(self) -> Optional[QuantumInstance]:
r"""Pending deprecation\; Get the quantum instance.
r"""Deprecated\; Get the quantum instance.
Returns:
The quantum instance used to run this algorithm.
Expand All @@ -207,13 +206,12 @@ def quantum_instance(self) -> Optional[QuantumInstance]:

@quantum_instance.setter
@deprecate_function(
"The Grover.quantum_instance setter is pending deprecation. "
"This property will be deprecated in a future release and subsequently "
"removed after that.",
category=PendingDeprecationWarning,
"The Grover.quantum_instance setter is deprecated as of Qiskit Terra 0.23.0 and "
"will be removed no sooner than 3 months after the release date.",
category=DeprecationWarning,
)
def quantum_instance(self, quantum_instance: Union[QuantumInstance, Backend]) -> None:
r"""Pending deprecation\; Set quantum instance.
r"""Deprecated\; Set quantum instance.
Args:
quantum_instance: The quantum instance used to run this algorithm.
Expand Down
30 changes: 14 additions & 16 deletions qiskit/algorithms/amplitude_estimators/ae.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# This code is part of Qiskit.
#
# (C) Copyright IBM 2018, 2022.
# (C) Copyright IBM 2018, 2023.
#
# This code is licensed under the Apache License, Version 2.0. You may
# obtain a copy of this license in the LICENSE.txt file in the root directory
Expand Down Expand Up @@ -73,7 +73,7 @@ def __init__(
`qiskit.circuit.library.PhaseEstimation` when None.
iqft: The inverse quantum Fourier transform component, defaults to using a standard
implementation from `qiskit.circuit.library.QFT` when None.
quantum_instance: Pending deprecation\: The backend (or `QuantumInstance`) to execute
quantum_instance: Deprecated\: The backend (or `QuantumInstance`) to execute
the circuits on.
sampler: A sampler primitive to evaluate the circuits.
Expand All @@ -88,10 +88,10 @@ def __init__(
# set quantum instance
if quantum_instance is not None:
warnings.warn(
"The quantum_instance argument has been superseded by the sampler argument. "
"This argument will be deprecated in a future release and subsequently "
"removed after that.",
category=PendingDeprecationWarning,
"The quantum_instance argument is deprecated as of Qiskit Terra 0.23.0 and "
"will be removed no sooner than 3 months after the release date. Instead, use "
"the sampler argument as a replacement.",
category=DeprecationWarning,
)
with warnings.catch_warnings():
warnings.simplefilter("ignore")
Expand Down Expand Up @@ -125,13 +125,12 @@ def sampler(self, sampler: BaseSampler) -> None:

@property
@deprecate_function(
"The AmplitudeEstimation.quantum_instance getter is pending deprecation. "
"This property will be deprecated in a future release and subsequently "
"removed after that.",
category=PendingDeprecationWarning,
"The AmplitudeEstimation.quantum_instance getter is deprecated as of Qiskit Terra 0.23.0 and "
"will be removed no sooner than 3 months after the release date.",
category=DeprecationWarning,
)
def quantum_instance(self) -> QuantumInstance | None:
"""Pending deprecation; Get the quantum instance.
"""Deprecated; Get the quantum instance.
Returns:
The quantum instance used to run this algorithm.
Expand All @@ -140,13 +139,12 @@ def quantum_instance(self) -> QuantumInstance | None:

@quantum_instance.setter
@deprecate_function(
"The AmplitudeEstimation.quantum_instance setter is pending deprecation. "
"This property will be deprecated in a future release and subsequently "
"removed after that.",
category=PendingDeprecationWarning,
"The AmplitudeEstimation.quantum_instance setter is deprecated as of Qiskit Terra 0.23.0 and "
"will be removed no sooner than 3 months after the release date.",
category=DeprecationWarning,
)
def quantum_instance(self, quantum_instance: QuantumInstance | Backend) -> None:
"""Pending deprecation; Set quantum instance.
"""Deprecated; Set quantum instance.
Args:
quantum_instance: The quantum instance used to run this algorithm.
Expand Down
32 changes: 16 additions & 16 deletions qiskit/algorithms/amplitude_estimators/fae.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# This code is part of Qiskit.
#
# (C) Copyright IBM 2017, 2022.
# (C) Copyright IBM 2017, 2023.
#
# This code is licensed under the Apache License, Version 2.0. You may
# obtain a copy of this license in the LICENSE.txt file in the root directory
Expand Down Expand Up @@ -62,7 +62,7 @@ def __init__(
delta: The probability that the true value is outside of the final confidence interval.
maxiter: The number of iterations, the maximal power of Q is `2 ** (maxiter - 1)`.
rescale: Whether to rescale the problem passed to `estimate`.
quantum_instance: Pending deprecation\: The quantum instance or backend
quantum_instance: Deprecated\: The quantum instance or backend
to run the circuits.
sampler: A sampler primitive to evaluate the circuits.
Expand All @@ -76,10 +76,10 @@ def __init__(
# set quantum instance
if quantum_instance is not None:
warnings.warn(
"The quantum_instance argument has been superseded by the sampler argument. "
"This argument will be deprecated in a future release and subsequently "
"removed after that.",
category=PendingDeprecationWarning,
"The quantum_instance argument is deprecated as of Qiskit Terra 0.23.0 and "
"will be removed no sooner than 3 months after the release date. Instead, use "
"the sampler argument as a replacement.",
category=DeprecationWarning,
)
with warnings.catch_warnings():
warnings.simplefilter("ignore")
Expand Down Expand Up @@ -111,13 +111,13 @@ def sampler(self, sampler: BaseSampler) -> None:

@property
@deprecate_function(
"The FasterAmplitudeEstimation.quantum_instance getter is pending deprecation. "
"This property will be deprecated in a future release and subsequently "
"removed after that.",
category=PendingDeprecationWarning,
"The FasterAmplitudeEstimation.quantum_instance getter is deprecated "
"as of Qiskit Terra 0.23.0 and "
"will be removed no sooner than 3 months after the release date.",
category=DeprecationWarning,
)
def quantum_instance(self) -> QuantumInstance | None:
"""Pending deprecation; Get the quantum instance.
"""Deprecated; Get the quantum instance.
Returns:
The quantum instance used to run this algorithm.
Expand All @@ -126,13 +126,13 @@ def quantum_instance(self) -> QuantumInstance | None:

@quantum_instance.setter
@deprecate_function(
"The FasterAmplitudeEstimation.quantum_instance setter is pending deprecation. "
"This property will be deprecated in a future release and subsequently "
"removed after that.",
category=PendingDeprecationWarning,
"The FasterAmplitudeEstimation.quantum_instance setter is deprecated "
"as of Qiskit Terra 0.23.0 and "
"will be removed no sooner than 3 months after the release date.",
category=DeprecationWarning,
)
def quantum_instance(self, quantum_instance: QuantumInstance | Backend) -> None:
"""Pending deprecation; Set quantum instance.
"""Deprecated; Set quantum instance.
Args:
quantum_instance: The quantum instance used to run this algorithm.
Expand Down
32 changes: 16 additions & 16 deletions qiskit/algorithms/amplitude_estimators/iae.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# This code is part of Qiskit.
#
# (C) Copyright IBM 2018, 2022.
# (C) Copyright IBM 2018, 2023.
#
# This code is licensed under the Apache License, Version 2.0. You may
# obtain a copy of this license in the LICENSE.txt file in the root directory
Expand Down Expand Up @@ -72,7 +72,7 @@ def __init__(
each iteration, can be 'chernoff' for the Chernoff intervals or 'beta' for the
Clopper-Pearson intervals (default)
min_ratio: Minimal q-ratio (:math:`K_{i+1} / K_i`) for FindNextK
quantum_instance: Pending deprecation\: Quantum Instance or Backend
quantum_instance: Deprecated\: Quantum Instance or Backend
sampler: A sampler primitive to evaluate the circuits.
Raises:
Expand All @@ -98,10 +98,10 @@ def __init__(
# set quantum instance
if quantum_instance is not None:
warnings.warn(
"The quantum_instance argument has been superseded by the sampler argument. "
"This argument will be deprecated in a future release and subsequently "
"removed after that.",
category=PendingDeprecationWarning,
"The quantum_instance argument is deprecated as of Qiskit Terra 0.23.0 and "
"will be removed no sooner than 3 months after the release date. Instead, use "
"the sampler argument as a replacement.",
category=DeprecationWarning,
)
with warnings.catch_warnings():
warnings.simplefilter("ignore")
Expand Down Expand Up @@ -134,13 +134,13 @@ def sampler(self, sampler: BaseSampler) -> None:

@property
@deprecate_function(
"The IterativeAmplitudeEstimation.quantum_instance getter is pending deprecation. "
"This property will be deprecated in a future release and subsequently "
"removed after that.",
category=PendingDeprecationWarning,
"The IterativeAmplitudeEstimation.quantum_instance getter is deprecated "
"as of Qiskit Terra 0.23.0 and "
"will be removed no sooner than 3 months after the release date.",
category=DeprecationWarning,
)
def quantum_instance(self) -> QuantumInstance | None:
"""Pending deprecation; Get the quantum instance.
"""Deprecated; Get the quantum instance.
Returns:
The quantum instance used to run this algorithm.
Expand All @@ -149,13 +149,13 @@ def quantum_instance(self) -> QuantumInstance | None:

@quantum_instance.setter
@deprecate_function(
"The IterativeAmplitudeEstimation.quantum_instance setter is pending deprecation. "
"This property will be deprecated in a future release and subsequently "
"removed after that.",
category=PendingDeprecationWarning,
"The IterativeAmplitudeEstimation.quantum_instance setter is deprecated "
"as of Qiskit Terra 0.23.0 and "
"will be removed no sooner than 3 months after the release date.",
category=DeprecationWarning,
)
def quantum_instance(self, quantum_instance: QuantumInstance | Backend) -> None:
"""Pending deprecation; Set quantum instance.
"""Deprecated; Set quantum instance.
Args:
quantum_instance: The quantum instance used to run this algorithm.
Expand Down
32 changes: 16 additions & 16 deletions qiskit/algorithms/amplitude_estimators/mlae.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# This code is part of Qiskit.
#
# (C) Copyright IBM 2018, 2022.
# (C) Copyright IBM 2018, 2023.
#
# This code is licensed under the Apache License, Version 2.0. You may
# obtain a copy of this license in the LICENSE.txt file in the root directory
Expand Down Expand Up @@ -71,7 +71,7 @@ def __init__(
according to ``evaluation_schedule``. The minimizer takes a function as first
argument and a list of (float, float) tuples (as bounds) as second argument and
returns a single float which is the found minimum.
quantum_instance: Pending deprecation\: Quantum Instance or Backend
quantum_instance: Deprecated\: Quantum Instance or Backend
sampler: A sampler primitive to evaluate the circuits.
Raises:
Expand All @@ -83,10 +83,10 @@ def __init__(
# set quantum instance
if quantum_instance is not None:
warnings.warn(
"The quantum_instance argument has been superseded by the sampler argument. "
"This argument will be deprecated in a future release and subsequently "
"removed after that.",
category=PendingDeprecationWarning,
"The quantum_instance argument is deprecated as of Qiskit Terra 0.23.0 and "
"will be removed no sooner than 3 months after the release date. Instead, use "
"the sampler argument as a replacement.",
category=DeprecationWarning,
)
with warnings.catch_warnings():
warnings.simplefilter("ignore")
Expand Down Expand Up @@ -137,13 +137,13 @@ def sampler(self, sampler: BaseSampler) -> None:

@property
@deprecate_function(
"The MaximumLikelihoodAmplitudeEstimation.quantum_instance getter is pending deprecation. "
"This property will be deprecated in a future release and subsequently "
"removed after that.",
category=PendingDeprecationWarning,
"The MaximumLikelihoodAmplitudeEstimation.quantum_instance getter is deprecated "
"as of Qiskit Terra 0.23.0 and "
"will be removed no sooner than 3 months after the release date.",
category=DeprecationWarning,
)
def quantum_instance(self) -> QuantumInstance | None:
"""Pending deprecation; Get the quantum instance.
"""Deprecated; Get the quantum instance.
Returns:
The quantum instance used to run this algorithm.
Expand All @@ -152,13 +152,13 @@ def quantum_instance(self) -> QuantumInstance | None:

@quantum_instance.setter
@deprecate_function(
"The MaximumLikelihoodAmplitudeEstimation.quantum_instance setter is pending deprecation. "
"This property will be deprecated in a future release and subsequently "
"removed after that.",
category=PendingDeprecationWarning,
"The MaximumLikelihoodAmplitudeEstimation.quantum_instance setter is deprecated "
"as of Qiskit Terra 0.23.0 and "
"will be removed no sooner than 3 months after the release date.",
category=DeprecationWarning,
)
def quantum_instance(self, quantum_instance: QuantumInstance | Backend) -> None:
"""Pending deprecation; Set quantum instance.
"""Deprecated; Set quantum instance.
Args:
quantum_instance: The quantum instance used to run this algorithm.
Expand Down
Loading

0 comments on commit 1a02cd2

Please sign in to comment.