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

Qiskit / qiskit / 8914929648
88%

Build:
DEFAULT BRANCH: main
Ran 01 May 2024 09:18PM UTC
Jobs 1
Files 829
Run time 2min
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

01 May 2024 08:12PM UTC coverage: 89.557% (+0.02%) from 89.542%
8914929648

push

github

web-flow
Support `Var` in circuit-substitution methods (#12215)

* Support `Var` in `QuantumCircuit.compose`

This converts the operation-rewriting step of `QuantumCircuit.compose`
into one that can recurse through control-flow operations rewriting
variables (to avoid conflicts). This initial commit adds two ways of
combining the variables:

1. variables in the `other` are disjoint from those in `self`, and are
   simply added to them.  This makes it easy to join unrelated circuits.
2. variables marked as "captures" in `other` can be inlined onto
   existing variables in `self`.  This makes it possible to build up a
   circuit with variables layer-by-layer.

In support of objective 2, I also taught `copy_empty_like` a way to
produce a new base layer with all the declared variables converted to
"captures" to make it easier to produce new base layers.

I deliberately did not include any _automatic_ variable renaming because
the usability of that seemed very hard to do well; while the circuit can
easily be created in a unique way, the user would then be hard-pressed
to actually retrieve the new `Var` nodes afterwards.  Asking the user to
manually break naming collisions guarantees that they'll be able to find
their variables again afterwards.

* Support `Var` in `DAGCircuit.compose`

This similarly adds support for a `vars_mode` argument to
`DAGCircuit.copy_empty_like` to make using this more convenient.  It
threads the same argument through some of the `DAGCircuit` methods that
build up layers of DAGs, since this is more common here.

Unlike `QuantumCircuit.compose`, `DAGCircuit.compose` does not (yet?)
offer the ability to remap variables during the composition, because the
use-cases for direct `DAGCircuit` composition are typically less about
building up many circuits from scratch and more about rebuilding a DAG
from itself.  Not offering the option makes it simpler to implement.

* Support `Var` in `DAGCircuit.replace_block_with_op`

This is straightforwards,... (continued)

146 of 150 new or added lines in 5 files covered. (97.33%)

9 existing lines in 2 files now uncovered.

61581 of 68762 relevant lines covered (89.56%)

218451.85 hits per line

New Missed Lines in Diff

Lines Coverage ∆ File
4
92.0
0.33% qiskit/dagcircuit/dagcircuit.py

Uncovered Existing Lines

Lines Coverage ∆ File
1
92.0
0.33% qiskit/dagcircuit/dagcircuit.py
8
91.6
-1.53% crates/qasm2/src/lex.rs
Jobs
ID Job ID Ran Files Coverage
1 8914929648.1 01 May 2024 09:18PM UTC 829
89.56
GitHub Action Run
Source Files on build 8914929648
  • Tree
  • List 829
  • Changed 33
  • Source Changed 0
  • Coverage Changed 7
Coverage ∆ File Lines Relevant Covered Missed Hits/Line
  • Back to Repo
  • 6b73b585 on github
  • Prev Build on gh-readonly-queue/main/pr-12207-b40a34e9f24410855ffbcbacc857de10af57f08d (#8911481354)
  • Next Build on main (#8916276358)
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