|
Ran
|
Files
923
|
Run time
52s
|
Badge
README BADGES
|
push
github
Fix Statevector.evolve modifying input state in-place (Fixes 15750) (#15905) (#16227) * [quantum_info.states] Add tests (1 failing) for Statevector.evolve modifying original state Statevector.evolve() is meant to return the evolved state, with the original state remaining unmodified. However, some instructions result in the state being modified. The added tests validate Statevector.evolve() with various gates, Operator, and QuantumCircuit. The only instance where the original state is modified is with DiagonalGate. * [quantum_info.states] Use new _data array when applying global phase The _data array of Statevector may be a shallow copy of another Statevector. Applying a global phase in-place would modify the other instances. A deep copy doesn't work as this breaks another test: - test.python.primitives.test_statevector_estimator.TestStatevectorEstimator.test_reset * [reno] Add bugfix releasenote * Update releasenotes/notes/fix-statevector-evolve-inplace-modification-be2f31976d5a2e1d.yaml * Update releasenotes/notes/fix-statevector-evolve-inplace-modification-be2f31976d5a2e1d.yaml * [tests] Fix test names not being snake-case * [tests] Fix lint black failing --------- (cherry picked from commit a8d3aefae) Co-authored-by: Conrad Haupt <conrad@conradhaupt.com> Co-authored-by: Julien Gacon <gaconju@gmail.com>
104317 of 118862 relevant lines covered (87.76%)
1010972.47 hits per line
| Coverage | ∆ | File | Lines | Relevant | Covered | Missed | Hits/Line |
|---|