Skip to content

Commit

Permalink
Deprecate atomic_evolution
Browse files Browse the repository at this point in the history
  • Loading branch information
1ucian0 committed Dec 24, 2024
1 parent f13673b commit ad9caad
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 6 deletions.
3 changes: 1 addition & 2 deletions qiskit/synthesis/evolution/product_formula.py
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ class ProductFormula(EvolutionSynthesis):

@deprecate_arg(
name="atomic_evolution",
since="1.2",
since="1.4",
predicate=lambda callable: callable is not None
and len(inspect.signature(callable).parameters) == 2,
deprecation_description=(
Expand All @@ -55,7 +55,6 @@ class ProductFormula(EvolutionSynthesis):
"Instead you should update your 'atomic_evolution' function to be of the following "
"type: 'Callable[[QuantumCircuit, Pauli | SparsePauliOp, float], None]'."
),
pending=True,
)
def __init__(
self,
Expand Down
3 changes: 1 addition & 2 deletions qiskit/synthesis/evolution/qdrift.py
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ class QDrift(ProductFormula):

@deprecate_arg(
name="atomic_evolution",
since="1.2",
since="1.4",
predicate=lambda callable: callable is not None
and len(inspect.signature(callable).parameters) == 2,
deprecation_description=(
Expand All @@ -54,7 +54,6 @@ class QDrift(ProductFormula):
"Instead you should update your 'atomic_evolution' function to be of the following "
"type: 'Callable[[QuantumCircuit, Pauli | SparsePauliOp, float], None]'."
),
pending=True,
)
def __init__(
self,
Expand Down
3 changes: 1 addition & 2 deletions qiskit/synthesis/evolution/suzuki_trotter.py
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ class SuzukiTrotter(ProductFormula):

@deprecate_arg(
name="atomic_evolution",
since="1.2",
since="1.4",
predicate=lambda callable: callable is not None
and len(inspect.signature(callable).parameters) == 2,
deprecation_description=(
Expand All @@ -71,7 +71,6 @@ class SuzukiTrotter(ProductFormula):
"Instead you should update your 'atomic_evolution' function to be of the following "
"type: 'Callable[[QuantumCircuit, Pauli | SparsePauliOp, float], None]'."
),
pending=True,
)
def __init__(
self,
Expand Down
8 changes: 8 additions & 0 deletions releasenotes/notes/followup_12724-59acaeb333788396.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
---
deprecations_synthesis:
- |
The argument ``atomic_evolution`` in the constructor for the classes
:class:`.LieTrotter`, :class:`.ProductFormula`, and :class:`.SuzukiTrotter`
is a callable with a different signature now: from
``Callable[[Pauli | SparsePauliOp, float], QuantumCircuit]`` to
``Callable[[QuantumCircuit, Pauli | SparsePauliOp, float], None]``.

0 comments on commit ad9caad

Please sign in to comment.