Repo Added
|
Files
869
|
Badge
README BADGES
|
push
github
Fix string and standard gate mismatch in commutation checker (backport #13991) (#14004) * Fix string and standard gate mismatch in commutation checker (#13991) * Fix string and standard gate mismatch in commutation checker This commit reworks the internals of the CommutationChecker to not rely on operation name except for where we do a lookup by name in the commutation library provided (which is the only key available to support custom gates). This fixes the case where a custom gate that overloads the standard gate name, previously the code would assume it to be a standard gate and internally panic when it wasn't. When working with standard gates (or standard instructions) we don't need to rely on string matching because we can rely on the rust data model to do the heavy lifting for us. This commit moves all the explicit handling of standard gates to use the StandardGate type directly and makes this logic more robust. This also removes are usage of the once_cell library in qiskit-accelerate because it was used to create a lazy static hashsets of strings which are no longer needed because static lookup tables replace this when we stopped using string comparisons. Fixes #13988 * Rename is_commutation_skipped() is_parameterized() (cherry picked from commit abb0cf9db) # Conflicts: # crates/accelerate/src/commutation_checker.rs * Update commutation_checker.rs --------- Co-authored-by: Matthew Treinish <mtreinish@kortar.org> Co-authored-by: Elena Peña Tapia <57907331+ElePT@users.noreply.github.com>
47 of 91 new or added lines in 1 file covered. (51.65%)
9 existing lines in 2 files now uncovered.72628 of 82436 relevant lines covered (88.1%)
496551.8 hits per line
Coverage | ∆ | File | Lines | Relevant | Covered | Missed | Hits/Line |
---|