qiskit icon indicating copy to clipboard operation
qiskit copied to clipboard

Use singleton canonical instances for OpenQASM 3 gate lookups

Open jakelishman opened this issue 1 year ago • 2 comments

Summary

This reduces most symbol-table lookups for gate calls to simple is lookups, which is a sizeable increase in performance for the majority of large circuits passed to the OpenQASM 3 exporter. These circuits are typically entirely dominated by standard-library gate calls.

Details and comments

This is a very simple tweak with a pretty large impact on performance compared to the 1.2 series for circuits compiled into standard-library ones, since it near completely erases the overhead of the gate-based symbol lookup.

jakelishman avatar Oct 17 '24 17:10 jakelishman

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

  • @Qiskit/terra-core

qiskit-bot avatar Oct 17 '24 17:10 qiskit-bot

Pull Request Test Coverage Report for Build 11580872225

Details

  • 21 of 21 (100.0%) changed or added relevant lines in 2 files are covered.
  • 2 unchanged lines in 2 files lost coverage.
  • Overall coverage increased (+0.009%) to 88.677%

Files with Coverage Reduction New Missed Lines %
crates/qasm2/src/lex.rs 1 93.48%
crates/accelerate/src/unitary_synthesis.rs 1 92.2%
<!-- Total: 2
Totals Coverage Status
Change from base Build 11579524174: 0.009%
Covered Lines: 75350
Relevant Lines: 84971

💛 - Coveralls

coveralls avatar Oct 17 '24 17:10 coveralls