|
Ran
|
Jobs
1
|
Files
131
|
Run time
1min
|
Badge
README BADGES
|
push
github
fix: compare Evolution, InitializeModes and PrepareSlaterDeterminant by what defines them (#427) (#429) These gates are Qiskit `Gate`s, whose equality only sees the name and the `params`. None of them stores its defining data there: `Evolution` keeps only the time in `params`, and the other two keep nothing. Evolutions under different Hamiltonians for the same time, and either gate with different occupations, therefore compared equal. Defining `__eq__` also left them unhashable, so they could not be deduplicated in a set or a dict. Each class now compares the attributes that define it, as `OrbitalRotation` already did. The operators of two evolutions are compared with `equiv(other, 0.0)` rather than `==`, because operator `==` depends on the order in which terms are stored. `Evolution` also gains `equiv(other, atol)` for a comparison up to a tolerance. The synthesis method and the `atomic` flag are left out of both comparisons: they decide how a gate is broken down, not which gate it is. Nothing inside the package relied on gate equality (`MergeEvolutions` compares the operators directly), so only user code is affected. (cherry picked from commit 93de8b2b6) Co-authored-by: Max Rossmannek <21973473+mrossinek@users.noreply.github.com> Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
24 of 31 new or added lines in 3 files covered. (77.42%)
14565 of 14822 relevant lines covered (98.27%)
295872.74 hits per line
| Lines | Coverage | ∆ | File |
|---|---|---|---|
| 5 |
89.36
|
-10.64% | python/qiskit_fermions/circuit/library/evolution.py |
| 1 |
98.67
|
-1.33% | python/qiskit_fermions/circuit/library/initialize_modes.py |
| 1 |
97.06
|
-2.94% | python/qiskit_fermions/circuit/library/prepare_slater_determinant.py |
| ID | Job ID | Ran | Files | Coverage | |
|---|---|---|---|---|---|
| 1 | 44487984717.1 | 131 |
98.27
|
GitHub Action Run |
| Coverage | ∆ | File | Lines | Relevant | Covered | Missed | Hits/Line |
|---|