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

V4 - Program and Instruction APIs are backed by quil-rs #1639

Merged
merged 52 commits into from
Aug 30, 2023

Commits on Mar 7, 2023

  1. Foundational support for implementing Program with qcs-sdk-python (#1518

    )
    
    * tear out members, start replacing with rust API (WIP)
    
    * first pass as integrating with qcs_sdk.quil
    
    * fix low hanging fruit, introduce snapshot testing for passing tests,
    annotate others with improvements that need to be made
    
    * update poetry.lock
    
    * more test annotations, fixes, snapshots
    
    * deprecation warnings and cleanup
    
    * Gate tests and snapshots, pre-replacement with quil-rs
    
    * add test for FORKED gate
    
    * back Gate with RSGate
    
    * fix deprecated notice
    
    * test improvements
    
    * more cleanup
    
    * various cleanups
    
    * add more snaps
    
    * clean up program per feedback
    
    * feat!: The `calibrations` method on `Program` now only returns `DefCalibration`s. A `Program`s the `DefMeasureCalibrations` can be retrieved via the new `measure_calibrations` method.
    
    * update instruction handling logic
    
    * deprecate valid protoquil/quilt methods
    
    * add compatibility layer by overriding quil_rs.Gate superclass methods
    
    * remove gate __init__ method
    
    * remove old comments
    
    * revert defcal changes
    
    * safer type checking on conversion methods
    
    * simplify ParameterDesignator Type
    
    * forbidden metaclass shenanigans
    
    * Update pyquil/quil.py
    
    Co-authored-by: Kalan <[email protected]>
    
    * use deprecated decorator
    
    * update qcs-sdk-python dependency spec
    
    ---------
    
    Co-authored-by: Kalan <[email protected]>
    MarquessV and kalzoo authored Mar 7, 2023
    Configuration menu
    Copy the full SHA
    9c7de67 View commit details
    Browse the repository at this point in the history

Commits on Mar 9, 2023

  1. V4 Setters for the Gate class (#1535)

    * add and test setters
    
    * use simple enum syntax
    MarquessV authored Mar 9, 2023
    Configuration menu
    Copy the full SHA
    0488e08 View commit details
    Browse the repository at this point in the history

Commits on Mar 14, 2023

  1. Use quil_rs for Calibrations (#1536)

    * setup test suite for DefCalibration
    
    * back DefCalibration with quil_rs.Calibration
    
    * fix metaclass implementation so all instruction types aren't recognized
    as the same
    
    * back DefCalibration with quil_rs.Calibration
    
    * setup DefMeasureCalibration tests
    
    * back DefMeasureCalibration with quil_rs.MeasureCalibrationDefinition
    
    * gate calibrations with quil_rs
    
    * more efficient handling of calibrations
    
    * setup Measurement tests
    
    * back Measurement with quil_rs
    
    * use calibration set api for calibrations
    
    * BREAKING CHANGE: DefMeasureCalibration now requires a MemoryReference
    
    * update tests
    
    * cleanup stale todos, match calibration logic
    
    * type hints for tests
    
    * remove redundant guard in match_calibrations
    
    Co-authored-by: Kalan <[email protected]>
    
    ---------
    
    Co-authored-by: Kalan <[email protected]>
    MarquessV and kalzoo authored Mar 14, 2023
    Configuration menu
    Copy the full SHA
    c2f8803 View commit details
    Browse the repository at this point in the history

Commits on Mar 15, 2023

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

Commits on Mar 17, 2023

  1. BREAKING CHANGE: DefFrame and Frame are no longer dataclasses

    We've removed the @DataClass decorator from `DefFrame` and `Frame`. `Frame`s properties can now be edited. Most functionality should have been re-implemented, but breakages may be possible, depending on how much of the @DataClass functionality was being leveraged.
    MarquessV authored Mar 17, 2023
    Configuration menu
    Copy the full SHA
    961a8d2 View commit details
    Browse the repository at this point in the history
  2. Use quil-rs FrameSet API and compatibility layer (#1543)

    * setup Frame and DefFrame test suites
    
    * add eq test
    
    * back Frame with quil_rs FrameDefinition
    
    * back DefFrame with quil_rs.FrameDefinition
    
    * fix flaky DefFrame snapshot tests
    
    * cleanup imports
    
    * "unfreeze" Frame properties
    
    * use FrameSet API and compatibility layer, with tests
    
    * update calibrations property as well
    
    * center_frequency -> CENTER-FREQUENCY
    
    * fix attribute names in DefFrame
    
    * update snapshot
    MarquessV authored Mar 17, 2023
    Configuration menu
    Copy the full SHA
    651839a View commit details
    Browse the repository at this point in the history

Commits on Mar 20, 2023

  1. Configuration menu
    Copy the full SHA
    98061b5 View commit details
    Browse the repository at this point in the history

Commits on Mar 21, 2023

  1. BREAKING CHANGE: Setting the offsets property on Declare will raise…

    … a `ValueError` if no shared_region is set.
    
    * setup tests for Declare
    
    * BREAKING CHANGE: Setting the offsets property on ``Declare`` will raise
    if no shared_region is set.
    
    * update tests
    
    * add note
    
    * trust truthy/falsy values
    MarquessV authored Mar 21, 2023
    Configuration menu
    Copy the full SHA
    36c56a6 View commit details
    Browse the repository at this point in the history

Commits on Mar 22, 2023

  1. Configuration menu
    Copy the full SHA
    5c56427 View commit details
    Browse the repository at this point in the history

Commits on Mar 31, 2023

  1. V4 Program API: Back GateDef with GateDefinition (#1549)

    * setup DefGate test suite
    
    * add baseline tests for permutation and pauli gates
    
    * compatibility for paulis, expressions, back DefGate with GateDefinition
    
    * back DefPermutationGate with quil-rs
    
    * back DefGateByPaulis w/ quil-rs
    
    * better support Expressions
    
    * dont try to support Expressions
    
    * cleanup
    
    * update tests
    
    * combine int, float, and complex conversion
    MarquessV authored Mar 31, 2023
    Configuration menu
    Copy the full SHA
    d5d7d38 View commit details
    Browse the repository at this point in the history

Commits on Apr 7, 2023

  1. feat: Add DefCircuit

    * setup DefWaveform tests
    
    * back DefWaveform with quil-rs
    
    * update snapshot
    
    * clean up redudnant import
    
    * implement DefCircuit using quil-rs
    
    * add DefCircuit|Waveform to py instruction conversion method
    
    * update snapshot after instruction indentation fix
    MarquessV authored Apr 7, 2023
    Configuration menu
    Copy the full SHA
    d6a8ef4 View commit details
    Browse the repository at this point in the history

Commits on Apr 10, 2023

  1. V4 Instruction API: Pragma, Reset, Fence, Delay (#1551)

    * setup Pragma tests
    
    * setup tests for Qubit
    
    * setup tests for Fence
    
    * back Pragma with quil_rs.Pragma
    
    * back Reset, ResetQubit, with quil-rs
    
    * Back Delay(Frames|Qubits) with quil-rs
    
    * update Delay implementation per feedback
    
    * back Fence, FenceAll, with quil-rs
    
    * remove unused snapshots, prints
    
    * update convers to rs/py instruction functions
    
    * better type for numpy numbers
    
    * cleanup, and assert ResetQubit qubit is not None
    MarquessV authored Apr 10, 2023
    Configuration menu
    Copy the full SHA
    a243b3e View commit details
    Browse the repository at this point in the history
  2. BREAKING CHANGE: The pop method has been removed from Program

    * remove to_headers
    
    * BREAKING CHANGE: The `pop` method has been removed from `Program`
    
    * remove to_headers arg
    MarquessV authored Apr 10, 2023
    Configuration menu
    Copy the full SHA
    eb82e2d View commit details
    Browse the repository at this point in the history

Commits on Apr 13, 2023

  1. * BREAKING CHANGE: TemplateWaveform and its subclasses are no longe…

    …r dataclasses. Most important functionality has been replaced so this change should be transparent for most use cases.
    
    * setup tests for Capture
    
    * setup tests for Pulse
    
    * create tests for RawCapture
    
    * add tests for template waveforms
    
    * add compatibility layer for TemplateWaveforms
    
    * back Capture with quil_rs
    
    * back Pulse with quil_rs
    
    * back RawCapture with quil_rs
    
    * BREAKING CHANGE: `TemplateWaveform` and its subclasses are no longer
    dataclasses. Most important functionality has been replaced so this
    change should be transparent for most use cases.
    
    * deprecation warning for TemplateWaveform and its subclasses, direct to
    new WaveformInvocation class
    MarquessV authored Apr 13, 2023
    Configuration menu
    Copy the full SHA
    ce6f540 View commit details
    Browse the repository at this point in the history
  2. BREAKING CHANGE: SwapPhase has been renamed to SwapPhases

    * setup up tests for set/shift instructions
    
    * setup tests for SwapPhase
    
    * back frame mutation instructions with quil-rs
    
    * back SwapPhase with quil-rs
    
    * formatting
    
    * BREAKING CHANGE: SwapPhase has been renamed to SwapPhases
    MarquessV authored Apr 13, 2023
    Configuration menu
    Copy the full SHA
    31d5454 View commit details
    Browse the repository at this point in the history

Commits on Apr 20, 2023

  1. V4: Deprecate format parameter (#1566)

    * update mypy, fix various lints, deprecate format_parameter
    
    * returns variable length tuple
    
    * a few more lints
    
    * more lints
    MarquessV authored Apr 20, 2023
    Configuration menu
    Copy the full SHA
    7b33cd3 View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    4a06343 View commit details
    Browse the repository at this point in the history

Commits on May 1, 2023

  1. V4: The rest of the non control-flow instructions (#1568)

    * ClassicalConvert tests
    
    * tests for Classical(Exchange|Load|Move)
    
    * ClassicalStore tests
    
    * test ClassicalComparison classes
    
    * test UnaryClassicalInstructions
    
    * Include implementation and test
    
    * Wait, Halt, Nop test and implementation
    
    * implement ClassicalConvert
    
    * re-implement ClassicalLoad
    
    * re-implement ClassicalStore
    
    * re-implement ClassicalComparison
    
    * re-implement Exchange
    
    * re-implement ClassicalUnary
    
    * back ClassicalMove, ClassicalExchange with quil-rs
    
    * fix recursive implementation of SimpleInstruction.__str__
    MarquessV authored May 1, 2023
    Configuration menu
    Copy the full SHA
    b36d8ff View commit details
    Browse the repository at this point in the history

Commits on Jun 7, 2023

  1. WIP: Merge master

    MarquessV committed Jun 7, 2023
    Configuration menu
    Copy the full SHA
    a4c5f83 View commit details
    Browse the repository at this point in the history

Commits on Jun 9, 2023

  1. fix!: The get_qubits method on a Gate now returns a list so that

    ordering is always guaranteed.
    MarquessV committed Jun 9, 2023
    Configuration menu
    Copy the full SHA
    7009382 View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    89b915a View commit details
    Browse the repository at this point in the history
  3. Configuration menu
    Copy the full SHA
    9161680 View commit details
    Browse the repository at this point in the history
  4. Configuration menu
    Copy the full SHA
    b467b09 View commit details
    Browse the repository at this point in the history
  5. Configuration menu
    Copy the full SHA
    960814b View commit details
    Browse the repository at this point in the history

Commits on Jun 15, 2023

  1. Configuration menu
    Copy the full SHA
    f681713 View commit details
    Browse the repository at this point in the history
  2. update noise tests

    MarquessV committed Jun 15, 2023
    Configuration menu
    Copy the full SHA
    4abb2e4 View commit details
    Browse the repository at this point in the history
  3. Configuration menu
    Copy the full SHA
    dd38f33 View commit details
    Browse the repository at this point in the history

Commits on Jun 16, 2023

  1. update rewrite_arithmetic

    MarquessV committed Jun 16, 2023
    Configuration menu
    Copy the full SHA
    4d00d72 View commit details
    Browse the repository at this point in the history
  2. fix parser tests

    MarquessV committed Jun 16, 2023
    Configuration menu
    Copy the full SHA
    b8111d0 View commit details
    Browse the repository at this point in the history
  3. Configuration menu
    Copy the full SHA
    40269d0 View commit details
    Browse the repository at this point in the history
  4. Configuration menu
    Copy the full SHA
    415f535 View commit details
    Browse the repository at this point in the history
  5. annotate/fix test_quilt.py

    MarquessV committed Jun 16, 2023
    Configuration menu
    Copy the full SHA
    b06cfec View commit details
    Browse the repository at this point in the history
  6. update snapshots

    MarquessV committed Jun 16, 2023
    Configuration menu
    Copy the full SHA
    db5806e View commit details
    Browse the repository at this point in the history

Commits on Jun 28, 2023

  1. BREAKING CHANGE: fill_placeholders has been removed as it is no longer

    used to expand calibrations
    MarquessV committed Jun 28, 2023
    Configuration menu
    Copy the full SHA
    8a4aae1 View commit details
    Browse the repository at this point in the history

Commits on Jul 10, 2023

  1. Configuration menu
    Copy the full SHA
    7ca26c5 View commit details
    Browse the repository at this point in the history

Commits on Jul 11, 2023

  1. bump quil version

    MarquessV committed Jul 11, 2023
    Configuration menu
    Copy the full SHA
    4676782 View commit details
    Browse the repository at this point in the history
  2. fix some tests

    MarquessV committed Jul 11, 2023
    Configuration menu
    Copy the full SHA
    df5f753 View commit details
    Browse the repository at this point in the history

Commits on Jul 14, 2023

  1. Configuration menu
    Copy the full SHA
    8651e1f View commit details
    Browse the repository at this point in the history

Commits on Jul 18, 2023

  1. chore! Remove parser module (#1618)

    * chore!: Remove `parser` module. A `Program` can instead be constructed from a
    Quil program string directly. The full list of `AbstractInstruction`s is
    available on the `instructions` property.
    
    * fix flaky test
    
    * add parantheses to assertion
    MarquessV authored Jul 18, 2023
    Configuration menu
    Copy the full SHA
    c1a1fff View commit details
    Browse the repository at this point in the history

Commits on Jul 28, 2023

  1. V4 Program API: De-dupe definitions when adding instructions to a Pro…

    …gram (#1625)
    
    * wip - de-dupe based on abstract instruction
    
    * normalize incoming instructions ot quil-rs types
    
    * a lil more cleanup
    
    * update docstrings
    
    * bump qcs-sdk-python/quil
    MarquessV authored Jul 28, 2023
    Configuration menu
    Copy the full SHA
    6be90f4 View commit details
    Browse the repository at this point in the history

Commits on Aug 24, 2023

  1. merge v4

    MarquessV committed Aug 24, 2023
    Configuration menu
    Copy the full SHA
    8abc581 View commit details
    Browse the repository at this point in the history

Commits on Aug 29, 2023

  1. V4 Program API - Placeholders and Control Flow (#1633)

    * use to_quil() in out() methods
    
    * simplify inst
    
    * fix test_quilbase tests
    
    * fix other failing tests
    
    * make instructions consistent with v3 implementation
    
    * back Label with quil_rs
    
    * back LabelPlaceholder with quil_rs
    
    * back QubitPlaceholders with quil_rs
    
    * fix off by 1 in test
    
    * checkpoint: update/fix many tests
    
    * checkpoint: all tests passing!
    
    * use renamed method
    
    * some mypy fixes
    
    * replace deprecation with deprecated
    
    * import sphinx decorator
    
    * fix mypy lints and dangling todos
    
    * get docs building
    
    * fix doctests
    
    * update doctests
    
    * simplify pauli from_list
    
    * instrucion->instruction
    
    * use body_instructions property
    
    * update a few old references to instructions
    
    * one more
    
    * add resolve_placeholders_with_custom_resolvers method
    
    * various small fixes
    
    * Remove support for QubitPlaceholders as Pragma arguments
    
    * fix typo
    
    Co-authored-by: Kalan <[email protected]>
    
    * Update CHANGELOG.md
    
    Co-authored-by: Kalan <[email protected]>
    
    * Update CHANGELOG.md
    
    Co-authored-by: Kalan <[email protected]>
    
    * Update CHANGELOG.md
    
    Co-authored-by: Kalan <[email protected]>
    
    * Update CHANGELOG.md
    
    Co-authored-by: Kalan <[email protected]>
    
    * remove duplicate entry
    
    * ignore sphinx warnings
    
    * grammar
    
    * update qcs-sdk-python
    
    ---------
    
    Co-authored-by: Kalan <[email protected]>
    MarquessV and kalzoo authored Aug 29, 2023
    Configuration menu
    Copy the full SHA
    b23db51 View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    8614e5b View commit details
    Browse the repository at this point in the history
  3. Configuration menu
    Copy the full SHA
    fb381cc View commit details
    Browse the repository at this point in the history
  4. satisfy lints

    MarquessV committed Aug 29, 2023
    Configuration menu
    Copy the full SHA
    5addfb6 View commit details
    Browse the repository at this point in the history
  5. impl repr

    MarquessV committed Aug 29, 2023
    Configuration menu
    Copy the full SHA
    b958b5e View commit details
    Browse the repository at this point in the history
  6. type hint capitalization

    MarquessV committed Aug 29, 2023
    Configuration menu
    Copy the full SHA
    e2184f1 View commit details
    Browse the repository at this point in the history
  7. add HALT back in

    MarquessV committed Aug 29, 2023
    Configuration menu
    Copy the full SHA
    1b76766 View commit details
    Browse the repository at this point in the history
  8. Configuration menu
    Copy the full SHA
    1fd0ce1 View commit details
    Browse the repository at this point in the history
  9. update CHANGELOG

    MarquessV committed Aug 29, 2023
    Configuration menu
    Copy the full SHA
    eb5c320 View commit details
    Browse the repository at this point in the history
  10. more changelog tweaks

    MarquessV committed Aug 29, 2023
    Configuration menu
    Copy the full SHA
    1e7c0af View commit details
    Browse the repository at this point in the history
  11. Configuration menu
    Copy the full SHA
    6b79630 View commit details
    Browse the repository at this point in the history