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

Implement parsing measure from text through ASG #42

Merged
merged 6 commits into from
Jan 19, 2024
Merged

Commits on Jan 18, 2024

  1. Partially implement parsing measure from text through ASG

    Statements like `c = measure q` are analyzed correctly.
    But `c[0] = measure q` is not analyzed correctly. The code
    that builds the assignment statement assumes the LHS is an identifier.
    The ASG should be able to handle valid lvalues. But we cannot yet
    construct statements with them.
    jlapeyre committed Jan 18, 2024
    Configuration menu
    Copy the full SHA
    014ce25 View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    e45f669 View commit details
    Browse the repository at this point in the history
  3. Factor code into from_gate_operand

    This is done twice and is several lines, so it is a function now.
    jlapeyre committed Jan 18, 2024
    Configuration menu
    Copy the full SHA
    300efc7 View commit details
    Browse the repository at this point in the history
  4. Fix test in from_string_test

    This is unrelated to measurement.
    jlapeyre committed Jan 18, 2024
    Configuration menu
    Copy the full SHA
    32c4322 View commit details
    Browse the repository at this point in the history

Commits on Jan 19, 2024

  1. Parse argument to measure as gate operand

    `GateOperand` is a qubit argument to gate call. And arguments to
    `measure` have the same spec. Identifier, hardware identifier,
    or indexed identifier. So we reuse the code from gate call.
    
    The code in oq3_parser is a bit mysterious. I added some comments to
    make it easier to locate next time, I hope.
    jlapeyre committed Jan 19, 2024
    Configuration menu
    Copy the full SHA
    2a63485 View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    c2ce523 View commit details
    Browse the repository at this point in the history