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 pass to filter ops and label inserted barriers #10323

Merged
merged 14 commits into from
Nov 22, 2023

Commits on Jun 22, 2023

  1. Add pass to remove labeled ops and label inserted barriers

    This commit adds a new transpiler pass RemoveLabeledOps which is used to
    remove any op nodes that match a given label. This is paired with a new
    label option for BarrierBeforeFinalMeasurements. These are combined in
    the preset pass managers to ensure we're not always adding a barrier
    before output measurements in the output of the transpiler.
    
    Fixes Qiskit#10321
    mtreinish committed Jun 22, 2023
    Configuration menu
    Copy the full SHA
    caae56f View commit details
    Browse the repository at this point in the history

Commits on Nov 21, 2023

  1. Configuration menu
    Copy the full SHA
    b8cea23 View commit details
    Browse the repository at this point in the history
  2. Fix rebase issues

    mtreinish committed Nov 21, 2023
    Configuration menu
    Copy the full SHA
    b12cc3b View commit details
    Browse the repository at this point in the history
  3. Handle pre-existing adjacent barriers

    In the case when a label is set to trigger the removal of the labelled
    barrier the merge step would lose the context around which barrier
    instruction was transpiler inserted and which was user provided. To
    address this issue this commit skips the MergeAdjacentBarrier step so
    that the transpiler barrier is kept separate from any user inserted
    barriers which need to be preserved.
    mtreinish committed Nov 21, 2023
    Configuration menu
    Copy the full SHA
    29c1217 View commit details
    Browse the repository at this point in the history
  4. Generalize RemoveLabeledOps to FilterOpNodes

    This commit generalizes the new RemoveLabeledOps pass to be a generic
    node filtering pass that given a filter function it will remove any
    matching op nodes in the circuit.
    mtreinish committed Nov 21, 2023
    Configuration menu
    Copy the full SHA
    691d7d5 View commit details
    Browse the repository at this point in the history
  5. Add release note

    mtreinish committed Nov 21, 2023
    Configuration menu
    Copy the full SHA
    a2a4eaf View commit details
    Browse the repository at this point in the history
  6. Add tests for new pass

    mtreinish committed Nov 21, 2023
    Configuration menu
    Copy the full SHA
    bc3b5d5 View commit details
    Browse the repository at this point in the history
  7. Configuration menu
    Copy the full SHA
    f855a8e View commit details
    Browse the repository at this point in the history
  8. Configuration menu
    Copy the full SHA
    1be3517 View commit details
    Browse the repository at this point in the history

Commits on Nov 22, 2023

  1. Fix type hint

    mtreinish committed Nov 22, 2023
    Configuration menu
    Copy the full SHA
    0c7cdc5 View commit details
    Browse the repository at this point in the history
  2. Fix docs typo

    mtreinish authored Nov 22, 2023
    Configuration menu
    Copy the full SHA
    d1236ad View commit details
    Browse the repository at this point in the history
  3. Invert predicate usage

    This commit inverts the predicate usage to be consistent with Python's
    built in filter() function. Now if the predicate returns True the dag node
    is retained and if it returns false it is removed. This is also
    explicitly documented to make it clear how the pass is to be used.
    mtreinish committed Nov 22, 2023
    Configuration menu
    Copy the full SHA
    f6df5be View commit details
    Browse the repository at this point in the history
  4. Configuration menu
    Copy the full SHA
    638b9d8 View commit details
    Browse the repository at this point in the history
  5. Configuration menu
    Copy the full SHA
    77d54f8 View commit details
    Browse the repository at this point in the history