Skip to content

Commit 0b6dd75

Browse files
soranjhwilljmax
andauthored
Fix labs effective_hamiltonian test (#8257)
**Context:** A generator in effective_hamiltonian is updated to fix an issue raised by concurrency for parallel runs with `mpi4py_pool`. **Description of the Change:** **Benefits:** **Possible Drawbacks:** **Related GitHub Issues:** --------- Co-authored-by: Will <[email protected]>
1 parent f818dc2 commit 0b6dd75

File tree

2 files changed

+3
-2
lines changed

2 files changed

+3
-2
lines changed

doc/releases/changelog-dev.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -741,6 +741,7 @@
741741

742742
* Added concurrency support for `effective_hamiltonian` in labs.
743743
[(#8081)](https://github.com/PennyLaneAI/pennylane/pull/8081)
744+
[(#8257)](https://github.com/PennyLaneAI/pennylane/pull/8257)
744745

745746
* Fixed a queueing issue in `ResourceOperator` tests.
746747
[(#8204)](https://github.com/PennyLaneAI/pennylane/pull/8204)

pennylane/labs/trotter_error/product_formulas/error.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -96,11 +96,11 @@ def effective_hamiltonian(
9696
with executor(max_workers=num_workers) as ex:
9797
partial_sum = ex.starmap(
9898
_eval_commutator,
99-
(
99+
[
100100
(commutator, coeff, fragments)
101101
for ith_order in bch
102102
for commutator, coeff in ith_order.items()
103-
),
103+
],
104104
)
105105

106106
eff = _AdditiveIdentity()

0 commit comments

Comments
 (0)