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

Qiskit / qiskit / 9498296748
89%
main: 88%

Build:
Build:
LAST BUILD BRANCH: substitute_pi4_rotations
DEFAULT BRANCH: main
Ran 13 Jun 2024 11:09AM UTC
Jobs 1
Files 839
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

13 Jun 2024 10:48AM UTC coverage: 89.392% (-0.2%) from 89.585%
9498296748

push

github

web-flow
Add infrastructure for gates, instruction, and operations in Rust (#12459)

* Add infrastructure for gates, instruction, and operations in Rust

This commit adds a native representation of Gates, Instruction, and
Operations to rust's circuit module. At a high level this works by
either wrapping the Python object in a rust wrapper struct that tracks
metadata about the operations (name, num_qubits, etc) and then for other
details it calls back to Python to get dynamic details like the
definition, matrix, etc. For standard library gates like Swap, CX, H,
etc this replaces the on-circuit representation with a new rust enum
StandardGate. The enum representation is much more efficient and has a
minimal memory footprint (just the enum variant and then any parameters
or other mutable state stored in the circuit instruction). All the gate
properties such as the matrix, definiton, name, etc are statically
defined in rust code based on the enum variant (which represents the
gate).

The use of an enum to represent standard gates does mean a change in
what we store on a CircuitInstruction. To represent a standard gate
fully we need to store the mutable properties of the existing Gate class
on the circuit instruction as the gate by itself doesn't contain this
detail. That means, the parameters, label, unit, duration, and condition
are added to the rust side of circuit instrucion. However no Python side
access methods are added for these as they're internal only to the Rust
code. In Qiskit 2.0 to simplify this storage we'll be able to drop, unit,
duration, and condition from the api leaving only label and parameters.
But for right now we're tracking all of the fields.

To facilitate working with circuits and gates full from rust the
setting the `operation` attribute of a `CircuitInstruction` object now
transltates the python object to an internal rust representation.
For standard gates this translates it to the enum form described earlier,
and for other circuit oper... (continued)

1650 of 1956 new or added lines in 38 files covered. (84.36%)

25 existing lines in 3 files now uncovered.

63809 of 71381 relevant lines covered (89.39%)

299647.78 hits per line

New Missed Lines in Diff

Lines Coverage ∆ File
2
95.71
-0.14% qiskit/circuit/quantumcircuit.py
3
62.5
-4.17% crates/circuit/src/interner.rs
7
84.44
crates/circuit/src/imports.rs
10
90.0
crates/circuit/src/parameter_table.rs
18
95.07
5.98% crates/circuit/src/circuit_instruction.rs
58
91.28
-2.7% crates/circuit/src/circuit_data.rs
208
58.89
crates/circuit/src/operations.rs

Uncovered Existing Lines

Lines Coverage ∆ File
1
88.51
0.0% crates/accelerate/src/two_qubit_decompose.rs
6
91.86
-1.02% crates/qasm2/src/lex.rs
18
96.23
-1.39% crates/qasm2/src/parse.rs
Jobs
ID Job ID Ran Files Coverage
1 9498296748.1 13 Jun 2024 11:09AM UTC 839
89.39
GitHub Action Run
Source Files on build 9498296748
  • Tree
  • List 839
  • Changed 61
  • Source Changed 0
  • Coverage Changed 38
Coverage ∆ File Lines Relevant Covered Missed Hits/Line
  • Back to Repo
  • f304a4b4 on github
  • Prev Build on gh-readonly-queue/main/pr-12542-8a1bcc2d5236ac090cd9bcbd7cdf5ce8efbcb18c (#9498282421)
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