Skip to content

Commit ab1f5a6

Browse files
tnemozElePT
andauthored
Added 2.1.2 to caught versions of Qiskit in AdaptVQE (#247)
Co-authored-by: Elena Peña Tapia <[email protected]>
1 parent d3d58b8 commit ab1f5a6

File tree

2 files changed

+6
-2
lines changed

2 files changed

+6
-2
lines changed

qiskit_algorithms/minimum_eigensolvers/adapt_vqe.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -238,9 +238,9 @@ def _compute_gradients(
238238
# The excitations operators are applied later as exp(i*theta*excitation).
239239
# For this commutator, we need to explicitly pull in the imaginary phase.
240240
commutators = [1j * (operator @ exc - exc @ operator) for exc in self._excitation_pool]
241-
# We have to call simplify on it since Qiskit doesn't do so in versions 2.1.0 and 2.1.1, see
241+
# We have to call simplify on it since Qiskit doesn't do so in versions 2.1.X, see
242242
# Qiskit/qiskit/issues/14567
243-
if get_qiskit_version_info() in ["2.1.0", "2.1.1"]:
243+
if get_qiskit_version_info() in ["2.1.0", "2.1.1", "2.1.2"]:
244244
commutators = [obs.simplify() for obs in commutators]
245245

246246
# If the ansatz has been transpiled
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
---
2+
fixes:
3+
- |
4+
:class:`.AdaptVQE` now works correctly when using qiskit in version 2.1.2.

0 commit comments

Comments
 (0)