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

Qiskit / qiskit / 10529709209
88%

Build:
DEFAULT BRANCH: main
Ran 23 Aug 2024 06:02PM UTC
Jobs 1
Files 869
Run time 11min
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

23 Aug 2024 04:40PM UTC coverage: 89.182% (-0.5%) from 89.668%
10529709209

push

github

web-flow
[DAGCircuit Oxidation] Port `DAGCircuit` to Rust (#12550)

* Port DAGCircuit to Rust

This commit migrates the entirety of the `DAGCircuit` class to Rust. It
fully replaces the Python version of the class. The primary advantage
of this migration is moving from a Python space rustworkx directed graph
representation to a Rust space petgraph (the upstream library for
rustworkx) directed graph. Moving the graph data structure to rust
enables us to directly interact with the DAG directly from transpiler
passes in Rust in the future. This will enable a significant speed-up in
those transpiler passes. Additionally, this should also improve the
memory footprint as the DAGCircuit no longer stores `DAGNode`
instances, and instead stores a lighter enum NodeType, which simply
contains a `PackedInstruction` or the wire objects directly.

Internally, the new Rust-based `DAGCircuit` uses a `petgraph::StableGraph`
with node weights of type `NodeType` and edge weights of type `Wire`. The
NodeType enum contains variants for `QubitIn`, `QubitOut`, `ClbitIn`,
`ClbitOut`, and `Operation`, which should save us from all of the
`isinstance` checking previously needed when working with `DAGNode` Python
instances. The `Wire` enum contains variants `Qubit`, `Clbit`, and `Var`.

As the full Qiskit data model is not rust-native at this point while
all the class code in the `DAGCircuit` exists in Rust now, there are
still sections that rely on Python or actively run Python code via Rust
to function. These typically involve anything that uses `condition`,
control flow, classical vars, calibrations, bit/register manipulation,
etc. In the future as we either migrate this functionality to Rust or
deprecate and remove it this can be updated in place to avoid the use
of Python.

API access from Python-space remains in terms of `DAGNode` instances to
maintain API compatibility with the Python implementation. However,
internally, we convert to and deal in terms of NodeType. When the user
... (continued)

4881 of 5802 new or added lines in 39 files covered. (84.13%)

67 existing lines in 11 files now uncovered.

71498 of 80171 relevant lines covered (89.18%)

400068.48 hits per line

New Missed Lines in Diff

Lines Coverage ∆ File
1
74.07
11.57% crates/circuit/src/interner.rs
6
88.5
-2.45% crates/circuit/src/circuit_instruction.rs
7
88.19
-0.49% crates/circuit/src/operations.rs
7
96.56
-0.28% crates/circuit/src/packed_instruction.rs
15
12.12
2.47% qiskit/visualization/dag_visualization.py
26
83.61
0.23% crates/circuit/src/dag_node.rs
68
0.0
crates/circuit/src/dot_utils.rs
319
65.21
crates/circuit/src/rustworkx_core_vnext.rs
472
89.2
crates/circuit/src/dag_circuit.rs

Uncovered Existing Lines

Lines Coverage ∆ File
1
74.07
11.57% crates/circuit/src/interner.rs
1
95.27
-0.36% qiskit/circuit/instruction.py
1
85.37
-2.75% qiskit/dagcircuit/dagnode.py
2
88.43
-0.32% qiskit/transpiler/passes/synthesis/unitary_synthesis.py
4
88.5
-2.45% crates/circuit/src/circuit_instruction.rs
5
67.62
-2.05% qiskit/dagcircuit/dagdependency_v2.py
7
83.61
0.23% crates/circuit/src/dag_node.rs
7
91.73
-1.25% crates/qasm2/src/lex.rs
7
90.84
-5.34% qiskit/synthesis/two_qubit/xx_decompose/decomposer.py
14
88.19
-0.49% crates/circuit/src/operations.rs
18
96.23
-1.39% crates/qasm2/src/parse.rs
Jobs
ID Job ID Ran Files Coverage
1 10529709209.1 23 Aug 2024 06:02PM UTC 869
89.18
GitHub Action Run
Source Files on build 10529709209
  • Tree
  • List 869
  • Changed 71
  • Source Changed 0
  • Coverage Changed 37
Coverage ∆ File Lines Relevant Covered Missed Hits/Line
  • Back to Repo
  • d3040a0b on github
  • Prev Build on gh-readonly-queue/main/pr-13014-6b6efc7d547e5baef7d906c850e2bc69ed6430fb (#10529130066)
  • Next Build on main (#10556375371)
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