Closed stavros11 closed 4 months ago
All modified and coverable lines are covered by tests :white_check_mark:
Project coverage is 99.84%. Comparing base (
ad50a20
) to head (784db2c
).
:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.
If allocating a circuit is not considered very costly
Thank you for reviewing. I updated the test in 784db2c0e3c5c6aad5de18be5574aa575814960c. I will merge after the CI passes.
Fixes #1357.
I believe the
TrotterCircuit
class is implementing a cache of the circuit implementing the Trotter decomposition returned byhamiltonian.circuit(dt)
, to avoid recreating it if the users decides to use a differentdt
. However, this creates a ("secret") link between the circuits returned byhamiltonian.circuit
that can confuse users, such as in #1357, and also complicates the code.If allocating a circuit is not considered very costly, this cache probably does not provide much in terms of performance, therefore I decided to remove it to have cleaner code (and behavior).
Checklist: