Qiskit / qiskit

Qiskit is an open-source SDK for working with quantum computers at the level of extended quantum circuits, operators, and primitives.
https://www.ibm.com/quantum/qiskit
Apache License 2.0
5.11k stars 2.34k forks source link

Add equivalence-library rules between `rzz` and `cp` #13019

Closed jakelishman closed 3 weeks ago

jakelishman commented 1 month ago

Summary

These gates are locally equivalence (as are all the Ising-interaction gates), and this simple additional rule lets things like QFT, which are defined by Qiskit's default constructor in terms of cp, get converted into rzz or rzx.

Details and comments

I also have a complete rewrite of the equivalence library that is complete and in theory optimal (in 2q gate count) for translations at jakelishman/qiskit-terra@6654059193, but the current BasisTranslator algorithm does not work as well with the structuring of the rules. I have a new algorithm for translation in mind that I'm calling the BasisConstructor, which will solve that problem, and also make basis translation for overcomplete basis sets and heterogeneous architectures more accurate, reliable and performant (hopefully!), but I haven't had chance to write it up yet.

qiskit-bot commented 1 month ago

One or more of the following people are relevant to this code:

coveralls commented 1 month ago

Pull Request Test Coverage Report for Build 10577197425

Warning: This coverage report may be inaccurate.

This pull request's base commit is no longer the HEAD commit of its target branch. This means it includes changes from outside the original pull request, including, potentially, unrelated coverage changes.

Details


Files with Coverage Reduction New Missed Lines %
qiskit/transpiler/passes/synthesis/unitary_synthesis.py 1 88.26%
crates/qasm2/src/lex.rs 4 92.23%
qiskit/circuit/gate.py 4 94.12%
crates/circuit/src/circuit_data.rs 32 91.96%
qiskit/circuit/library/n_local/n_local.py 44 83.85%
<!-- Total: 85 -->
Totals Coverage Status
Change from base Build 10529709209: 0.007%
Covered Lines: 71644
Relevant Lines: 80328

💛 - Coveralls