push
github
Fix OpenQASM 2 `gate` definitions following a shadowed built-in `gate` (#13340) (#13352) Previously, when given an OpenQASM 2 program such as OPENQASM 2.0; gate builtin a { U(0, 0, 0) a; } gate not_builtin a { U(pi, pi, pi) a; } qreg q[1]; not_builtin q[0]; and a set of `custom_instructions` including a `builtin=True` definition for `builtin` (but not for `not_builtin`), the Rust and Python sides would get themselves out-of-sync and output a gate that matched a prior definition, rather than `not_builtin`. This was because the Rust side was still issuing `DefineGate` bytecode instructions, even for gates whose OpenQASM 2 definitions should have been ignored, so Python-space thought there were more gates than Rust-space thought there were. (cherry picked from commit 9a1d8d3ae) Co-authored-by: Jake Lishman <jake.lishman@ibm.com>
6 of 6 new or added lines in 1 file covered. (100.0%)
13 existing lines in 3 files now uncovered.66892 of 74527 relevant lines covered (89.76%)
218442.51 hits per line