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

Qiskit / qiskit / 11722870229
89%
main: 88%

Build:
Build:
LAST BUILD BRANCH: dag/infallible-topological
DEFAULT BRANCH: main
Ran 07 Nov 2024 12:44PM UTC
Jobs 1
Files 908
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

07 Nov 2024 12:20PM UTC coverage: 88.846% (+0.03%) from 88.812%
11722870229

push

github

web-flow
Add pauli_twirl_2q_gates function (#13331)

* Add twirl_circuit function

This commit adds a new function twirl_circuit to apply Pauli twirling to
a given circuit. This function only works with a fixed set of two qubit
gates and is not a general solution. For performance this new function
is written in rust and uses static lookup tables for the twirling sets
around the fixed two qubit gates that are randomly sampled. There is
an option to perform twirling multiple times and return a list of
circuits instead of just doing it once. Ideally we'd do this in
parallel, but we're currently blocked on the use of OnceCell in the
PackedInstruction and the ParameterTable from parallelizing with
CircuitData. We can further improve the performance of this new
function by using a parallel iterator once #13219 is resolved. The
function is written in a way to make this simple in the future.

Fixes #13325

Co-authored-by: Paul Nation <nonhermitian@gmail.com>

* Update asv benchmarks to use new function

* Apply suggestions from code review

Co-authored-by: Julien Gacon <gaconju@gmail.com>

* Expand testing coverage

* Add capacity option to clone_empty_from

* Make static twirling tables more compact

* Make num_trials default to None to return a single circuit

* Allow for multiple twirling gates

This commit expands the twirling_gate argument to work with strings
instead of classes and also specify a list of gates instead of a single
gate type. It also changes the default to `None` to twirl all supported
gates in the circuit.

* Fix typo in max seed value

* Avoid vec for qubits

* Recurse into control flow for twirling

This commit updates the twirl_circuits logic to recurse into a control
flow operation and twirl any gates that are potentially in the block.

* Avoid extra calls to interner

Previously for each twirled gate we were calling the interner 4 times
once for each new gate. However, there are only 2 qargs being used and
we only need half of the interning ... (continued)

398 of 410 new or added lines in 8 files covered. (97.07%)

19 existing lines in 2 files now uncovered.

78188 of 88004 relevant lines covered (88.85%)

364962.91 hits per line

New Missed Lines in Diff

Lines Coverage ∆ File
3
95.36
-0.18% crates/circuit/src/circuit_data.rs
3
95.0
qiskit/circuit/twirling.py
6
97.97
crates/accelerate/src/twirling.rs

Uncovered Existing Lines

Lines Coverage ∆ File
7
91.98
-0.75% crates/qasm2/src/lex.rs
12
96.69
-0.92% crates/qasm2/src/parse.rs
Jobs
ID Job ID Ran Files Coverage
1 11722870229.1 07 Nov 2024 12:44PM UTC 908
88.85
GitHub Action Run
Source Files on build 11722870229
  • Tree
  • List 908
  • Changed 73
  • Source Changed 7
  • Coverage Changed 10
Coverage ∆ File Lines Relevant Covered Missed Hits/Line
  • Back to Repo
  • Github Actions Build #11722870229
  • 3e136d70 on github
  • Prev Build on gh-readonly-queue/main/pr-13319-4fd2a4e4d92bbebea6e8ade25af375b603c78c55 (#11722814211)
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