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

Qiskit / qiskit / 13054892992
89%
main: 88%

Build:
Build:
LAST BUILD BRANCH: substitute_pi4_rotations
DEFAULT BRANCH: main
Ran 30 Jan 2025 03:18PM UTC
Jobs 1
Files 913
Run time 3min
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

30 Jan 2025 02:54PM UTC coverage: 88.815% (-0.1%) from 88.936%
13054892992

push

github

web-flow
Add merging of `Interner`s (#13752)

* Add merging of `Interner` instances

This makes it possible to merge one interner into another, using a
map-and-filter function to explain how the values should be considered
afterwards.  The main use-case for this is in DAG and circuit
substitution methods, where we want to be able to map
`PackedInstruction`s from a small circuit to new ones on a larger
circuit, without having to unwrap and re-hash the interned slices once
for instruction; instead, we do that once _per interner key_, and then
have a no-hash direct lookup table to remap the interner keys directly.

The methods here are designed to directly allow the reuse of the heap
allocations used to track the interner key mappings, to help reduce the
number of small-scale allocations done in substitution methods.

The filtering part of the mapping is because one cannot typically be
certain that an `Interner` contains the minimally necessary keys,
especially for DAGs; it can well be that substitutions and bit removals
cause old data to be present.

* Use new `Interner` merging in `DAGCircuit::from_circuit`

This converts one obvious candidate for the new interner-merging
functionality.  There are several others in the codebase (all uses of
`DAGCircuit::extend`, for example, and several other full rebuilds), but
the structure of their code wasn't designed with this in mind, so the
modifications would typically be far more involved and more suitable for
separate patches.

Using a timing script:

```python
        import itertools
        from qiskit.circuit import QuantumCircuit
from qiskit.converters import circuit_to_dag

qc = QuantumCircuit(100, 100)
for pair in itertools.permutations(qc.qubits, 2):
    qc.rz(0, pair[0])
    qc.sx(pair[0])
    qc.rz(0, pair[0])
    qc.rz(0, pair[1])
    qc.sx(pair[1])
    qc.rz(0, pair[1])
    qc.cx(*pair)

%timeit circuit_to_dag(qc, copy_operations=False)
```

this patch showed an improvement from 18.5(6)ms to 14.4(5)ms on m... (continued)

123 of 253 new or added lines in 2 files covered. (48.62%)

11 existing lines in 3 files now uncovered.

79761 of 89806 relevant lines covered (88.81%)

346389.92 hits per line

New Missed Lines in Diff

Lines Coverage ∆ File
130
42.74
-50.71% crates/circuit/src/interner.rs

Uncovered Existing Lines

Lines Coverage ∆ File
1
94.23
-0.23% crates/qasm2/src/expr.rs
3
94.94
-0.32% crates/circuit/src/circuit_data.rs
7
91.48
-1.0% crates/qasm2/src/lex.rs
Jobs
ID Job ID Ran Files Coverage
1 13054892992.1 30 Jan 2025 03:18PM UTC 913
88.81
GitHub Action Run
Source Files on build 13054892992
  • Tree
  • List 913
  • Changed 71
  • Source Changed 2
  • Coverage Changed 6
Coverage ∆ File Lines Relevant Covered Missed Hits/Line
  • Back to Repo
  • Github Actions Build #13054892992
  • 315d6ade on github
  • Prev Build on main (#13053673557)
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

© 2025 Coveralls, Inc