• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

Qiskit / qiskit / 6555474740
88%

Build:
DEFAULT BRANCH: main
Ran 18 Oct 2023 03:10AM UTC
Jobs 1
Files 1267
Run time 19s
Badge
Embed ▾
README BADGES
x

If you need to use a raster PNG badge, change the '.svg' to '.png' in the link

Markdown

Textile

RDoc

HTML

Rst

18 Oct 2023 01:08AM UTC coverage: 87.065% (+0.006%) from 87.059%
6555474740

push

github

web-flow
Inline parameter binding as part of BasisTranslator (#10707)

* Inline parameter binding as part of BasisTranslator

This commit updates the internal logic for doing basis translation with
equivalence rules that involve parameter expressions. Previously the
basis translator would first construct an unbound DAGCircuit from the
equivalence library search, the it would convert that DAGCircuit into a
QuantumCircuit, bind the parameters, and finally convert the
QuantumCircuit back to a DAGCircuit for inline replacement. This was
needlessly inefficient, especially considering the original unbound
DAGCircuit was built from a QuamtumCircuit object. This meant in the
case of each gate being translated with a parameterized equivalence
rule the BasisTranslator was doing:

QuantumCircuit -> DAGCircuit -> QuantumCircuit -> DAGCircuit

just to be able to replace a node. This ends up being the primary
performance bottleneck for the pass because while each conversion of a
typically very small circuit is fairly quick in aggregate it takes a
large amount of time as the number of gates in the circuit grows.

This commit attempts to address this performance overhead by removing
the last QuantumCircuit -> DAGCircuit conversion by directly binding the
parameters on a copy of the DAGCircuit. Since the equivalence library
use case is very constrained in how parameter expressions are
constructed we're able to inline the binding on a copy of the
DAGCircuit. This still has a fair amount of overhead as we still need to
iterate over the DAGCircuit and copy it, but we're able to avoid one set
of copies and circuit iteration by doing the binding this way.

Fixes #9680

* Handle parameter substition individually

In the case we're substituting a parameter expression in the replacement
circuit with another parameter expression we need to handle each sub
parameter in the expression individually to either bind it to a value or
substitute it with the replacement expression. Previously w... (continued)

44 of 44 new or added lines in 1 file covered. (100.0%)

74063 of 85066 relevant lines covered (87.07%)

92244.9 hits per line

New Missed Lines in Diff

Lines Coverage ∆ File
3
97.71
-0.78% qiskit/transpiler/passes/basis/basis_translator.py

Uncovered Existing Lines

Lines Coverage ∆ File
1
93.76
-0.24% crates/qasm2/src/expr.rs
4
90.91
-0.51% crates/qasm2/src/lex.rs
6
97.13
0.46% crates/qasm2/src/parse.rs
Jobs
ID Job ID Ran Files Coverage
1 6555474740.1 18 Oct 2023 03:10AM UTC 1267
87.07
GitHub Action Run
Source Files on build 6555474740
  • Tree
  • List 1267
  • Changed 24
  • Source Changed 0
  • Coverage Changed 4
Coverage ∆ File Lines Relevant Covered Missed Hits/Line
  • Back to Repo
  • 4d636f43 on github
  • Prev Build on gh-readonly-queue/main/pr-10618-881fa8eeefb2bc0877122657125ec72e2adfc65d (#6550160160)
  • Next Build on main (#6559119273)
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc