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

Qiskit / qiskit / 10579458520
88%

Build:
DEFAULT BRANCH: main
Ran 27 Aug 2024 02:14PM UTC
Jobs 1
Files 871
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

27 Aug 2024 01:08PM UTC coverage: 89.217% (-0.001%) from 89.218%
10579458520

push

github

web-flow
Move interners from trait to generic structs (#13033)

* Move interners from trait to generic structs

This rewrites the interner mechanisms be defined in terms of two generic
structs (`Interner` and `Interned`) that formalise the idea that the
interned values are owned versions of a given reference type, and move
the logically separate intern-related actions (get a key from the value,
and get the value from the key) into separate functions (`get` and
`insert`, respectively).

This has a few advantages:

1. we now have both `insert` and `insert_owned` methods, which was
   awkward to add within the trait-based structure.  This allows a more
   efficient path when the owned variant has already necessarily been
   constructed.

2. additionally, the standard `insert` path now takes only a reference
   type.  For large circuits, most intern lookups will, in general, find
   a pre-existing key, so in situations where the interned value is
   sufficiently small that it can be within a static allocation (which
   is the case for almost all `qargs` and `cargs`), it's more efficient
   not to construct the owned type on the heap.

3. the type of the values retrieved from an interner are no longer
   indirected through the owned type that's stored.  For example,
   where `IndexedInterner<Vec<Qubit>>` gave out `&Vec<Qubit>`s as its
   lookups, `Interner<[Qubit]>` returns the more standard `&[Qubit]`,
   which is only singly indirect rather than double.

The following replacements are made:

1. The `IndexedInterner` struct from before is now just called
   `Interner` (and internally, it uses an `IndexSet` rather than
   manually tracking the indices).  Its generic type is related to the
   references it returns, rather than the owned value it stores, so
   `IndexedInterner<Vec<Qubit>>` becomes `Interner<[Qubit]>`.

2. The `Interner` trait is now gone.  Everything is just accessed as
   concrete methods on the `Interner` struct.

3. `<&IndexedInterner as Interner>... (continued)

136 of 146 new or added lines in 3 files covered. (93.15%)

18 existing lines in 5 files now uncovered.

71659 of 80320 relevant lines covered (89.22%)

403320.26 hits per line

New Missed Lines in Diff

Lines Coverage ∆ File
4
92.0
17.93% crates/circuit/src/interner.rs
6
92.18
0.22% crates/circuit/src/circuit_data.rs

Uncovered Existing Lines

Lines Coverage ∆ File
1
94.02
-0.24% crates/qasm2/src/expr.rs
2
88.43
-0.36% qiskit/transpiler/passes/synthesis/unitary_synthesis.py
2
92.18
0.22% crates/circuit/src/circuit_data.rs
6
90.84
-4.58% qiskit/synthesis/two_qubit/xx_decompose/decomposer.py
7
91.73
-1.25% crates/qasm2/src/lex.rs
Jobs
ID Job ID Ran Files Coverage
1 10579458520.1 27 Aug 2024 02:13PM UTC 871
89.22
GitHub Action Run
Source Files on build 10579458520
  • Tree
  • List 871
  • Changed 52
  • Source Changed 0
  • Coverage Changed 8
Coverage ∆ File Lines Relevant Covered Missed Hits/Line
  • Back to Repo
  • 7b2d50cb on github
  • Prev Build on gh-readonly-queue/main/pr-13006-f537602b8d69c38b4182390ed195899401b4efc5 (#10562784162)
  • Next Build on main (#10598013395)
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