Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix OpenQASM 2 gate definitions following a shadowed built-in gate #13340

Merged
merged 1 commit into from
Oct 22, 2024

Commits on Oct 17, 2024

  1. Fix OpenQASM 2 gate definitions following a shadowed built-in gate

    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.
    jakelishman committed Oct 17, 2024
    Configuration menu
    Copy the full SHA
    f8f9965 View commit details
    Browse the repository at this point in the history