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

Qiskit / qiskit / 8914929648 / 1
88%
main: 88%

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

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)

61581 of 68762 relevant lines covered (89.56%)

218451.85 hits per line

Source Files on job 8914929648.1
  • Tree
  • List 829
  • Changed 33
  • Source Changed 0
  • Coverage Changed 7
Coverage ∆ File Lines Relevant Covered Missed Hits/Line
  • Back to Build 8914929648
  • 6b73b585 on github
  • Prev Job for on main (#8911481354.1)
  • Next Job for on main (#8916276358.1)
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