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

Qiskit / qiskit / 10729421750
89%
main: 88%

Build:
Build:
LAST BUILD BRANCH: substitute_pi4_rotations
DEFAULT BRANCH: main
Ran 05 Sep 2024 11:22PM UTC
Jobs 1
Files 877
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

05 Sep 2024 11:00PM UTC coverage: 89.091% (-0.05%) from 89.136%
10729421750

push

github

web-flow
Fully port FilterOpNodes to Rust (#13052)

* Fully port FilterOpNodes to Rust

This commit ports the FilterOpNodes pass to rust. This pass is
exceedingly simple and just runs a filter function over all the op
nodes and removes nodes that match the filter. However, the API for
the class exposes that filter function interface as a user provided
Python callable. So for the current pass we need to retain that python
callback. This limits the absolute performance of this pass because
we're bottlenecked by calling python.

Looking to the future, this commit adds a rust native method to
DAGCircuit to perform this filtering with a rust predicate FnMut. It
isn't leveraged by the python implementation because of layer mismatch
for the efficient rust interface and Python working with `DAGOpNode`
objects. A function using that interface is added to filter labeled
nodes. In the preset pass manager we only use FilterOpNodes to remove
nodes with a specific label (which is used to identify temporary
barriers created by qiskit). In a follow up we should consider
leveraging this new function to build a new pass specifically for
this use case.

Fixes #12263
Part of #12208

* Make filter_op_nodes() infallible

The filter_op_nodes() method originally returned a Result<()> to handle
a predicate that was fallible. This was because the original intent for
the method was to use it with Python callbacks in the predicate. But
because of differences between the rust API and the Python API this
wasn't feasible as was originally planned. So this Result<()> return
wasn't used anymore. This commit reworks it to make the
filter_op_nodes() infallible and the predicate a user provides also only
returns `bool` and not `Result<bool>`.

* Rename filter_labelled_op to filter_labeled_op

30 of 60 new or added lines in 7 files covered. (50.0%)

23 existing lines in 3 files now uncovered.

72595 of 81484 relevant lines covered (89.09%)

387296.96 hits per line

New Missed Lines in Diff

Lines Coverage ∆ File
1
95.65
-2.13% crates/accelerate/src/remove_diagonal_gates_before_measure.rs
5
93.08
-1.64% crates/circuit/src/packed_instruction.rs
9
73.53
crates/accelerate/src/filter_op_nodes.rs
15
88.66
-0.29% crates/circuit/src/dag_circuit.rs

Uncovered Existing Lines

Lines Coverage ∆ File
1
94.02
-0.24% crates/qasm2/src/expr.rs
4
91.73
0.0% crates/qasm2/src/lex.rs
18
96.23
-0.92% crates/qasm2/src/parse.rs
Jobs
ID Job ID Ran Files Coverage
1 10729421750.1 05 Sep 2024 11:22PM UTC 877
89.09
GitHub Action Run
Source Files on build 10729421750
  • Tree
  • List 877
  • Changed 58
  • Source Changed 0
  • Coverage Changed 10
Coverage ∆ File Lines Relevant Covered Missed Hits/Line
  • Back to Repo
  • 8982dbde on github
  • Prev Build on gh-readonly-queue/main/pr-13098-9898979d2947340514adca7121ed8eaea75df77f (#10729212412)
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