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

'Peephole' optimization - or: collecting and optimizing two-qubit blocks - before routing (backport #12727) #12881

Merged
merged 1 commit into from
Aug 1, 2024

Commits on Aug 1, 2024

  1. 'Peephole' optimization - or: collecting and optimizing two-qubit blo…

    …cks - before routing (#12727)
    
    * init
    
    * up
    
    * up
    
    * Update builtin_plugins.py
    
    * Update builtin_plugins.py
    
    * reno
    
    * Update builtin_plugins.py
    
    * Update builtin_plugins.py
    
    * Update peephole-before-routing-c3d184b740bb7a8b.yaml
    
    * neko check
    
    * check neko
    
    * Update builtin_plugins.py
    
    * test neko
    
    * Update builtin_plugins.py
    
    * Update builtin_plugins.py
    
    * Update builtin_plugins.py
    
    * lint
    
    * tests and format
    
    * remove FakeTorino test
    
    * Update peephole-before-routing-c3d184b740bb7a8b.yaml
    
    * Apply suggestions from code review
    
    Co-authored-by: Matthew Treinish <[email protected]>
    
    * comments from code review
    
    * fix precision
    
    * up
    
    * up
    
    * update
    
    * up
    
    * .
    
    * cyclic import
    
    * cycl import
    
    * cyl import
    
    * .
    
    * circular import
    
    * .
    
    * lint
    
    * Include new pass in docs
    
    * Fix Split2QUnitaries dag manipulation
    
    This commit fixes the dag handling to do the 1q unitary insertion.
    Previously the dag manipulation was being done manually using the
    insert_node_on_in_edges() rustworkx method. However as the original node
    had 2 incoming edges for each qubit this caused the dag after running
    the pass to become corrupted. Each of the new 1q unitary nodes would end
    up with 2 incident edges and they would be in a sequence. This would result
    in later passes not being able to correctly understand the state of the
    circuit correctly. This was causing the unit tests to fail. This commit
    fixes this by just using `substitute_node_with_dag()` to handle the
    node substition, while doing it manually to avoid the overhead of
    checking is probably possible, the case where a unitary is the product
    of two 1q gates is not very common so optimizing it isn't super
    critical.
    
    * Update releasenotes/notes/peephole-before-routing-c3d184b740bb7a8b.yaml
    
    * stricter check for doing split2q
    
    * Update qiskit/transpiler/preset_passmanagers/builtin_plugins.py
    
    Co-authored-by: Matthew Treinish <[email protected]>
    
    * code review
    
    * Update qiskit/transpiler/passes/optimization/split_2q_unitaries.py
    
    Co-authored-by: Matthew Treinish <[email protected]>
    
    * new tests
    
    * typo
    
    * lint
    
    * lint
    
    ---------
    
    Co-authored-by: Matthew Treinish <[email protected]>
    (cherry picked from commit 1214d51)
    sbrandhsn authored and mergify[bot] committed Aug 1, 2024
    Configuration menu
    Copy the full SHA
    5b507c4 View commit details
    Browse the repository at this point in the history