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

Add Expr support to OpenQASM 3 exporter #10408

Merged
merged 5 commits into from
Jul 20, 2023
Merged

Commits on Jul 19, 2023

  1. Add Expr support to OpenQASM 3 exporter

    This adds support for `Expr` nodes in `condition` fields and
    `SwitchCaseOp.target`.  The general `c_if` condition checking is lifted
    into an `Expr` node as part of the OQ3 export, so the form of them
    automatically becomes like the new-style outputs, depending on how
    `expr.lift_legacy_condition` chooses to raise them to `Expr` nodes.
    
    As part of the refactor of the `Expression` subtree of the temporary
    AST, I removed `SubroutineCall`.  Its definition was severely
    out-of-date (a form from before even the initial arXiv draft), where it
    was statement-like instead of expression-like.  There is currently no
    support in Qiskit for representing these sorts of subroutines properly,
    and the OQ3 exporter would produce invalid OQ3 if it encountered
    something that it thought should be a a subroutine call.  This commit
    fixes that bug, correctly raising an exception that non-unitary
    instructions are not yet supported for export.
    
    This commit also removes the special casing from the `CXGate` into the
    exporter itself; it was more convenient in the new structure of some
    internal components, and it's a data model we don't want to support
    anyway.
    jakelishman committed Jul 19, 2023
    Configuration menu
    Copy the full SHA
    e622dca View commit details
    Browse the repository at this point in the history
  2. Use IntegerLiteral for Uint values

    This is what the QSS stack expects (they don't like bitstring literals
    in expressions yet), and is more in line with what we used to do anyway.
    jakelishman committed Jul 19, 2023
    Configuration menu
    Copy the full SHA
    e138bc5 View commit details
    Browse the repository at this point in the history
  3. Fix quotes

    jakelishman committed Jul 19, 2023
    Configuration menu
    Copy the full SHA
    4d41785 View commit details
    Browse the repository at this point in the history

Commits on Jul 20, 2023

  1. Configuration menu
    Copy the full SHA
    ce32c18 View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    bc1bb3b View commit details
    Browse the repository at this point in the history