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

Qiskit / qiskit / 10729862045
88%

Build:
DEFAULT BRANCH: main
Ran 06 Sep 2024 12:10AM 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.118% (+0.07%) from 89.05%
10729862045

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%)

3 existing lines in 2 files now uncovered.

72617 of 81484 relevant lines covered (89.12%)

386253.78 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
90.82
-0.06% crates/accelerate/src/two_qubit_decompose.rs
2
92.48
1.0% crates/qasm2/src/lex.rs
Jobs
ID Job ID Ran Files Coverage
1 10729862045.1 06 Sep 2024 12:10AM UTC 877
89.12
GitHub Action Run
Source Files on build 10729862045
  • Tree
  • List 877
  • Changed 58
  • Source Changed 0
  • Coverage Changed 11
Coverage ∆ File Lines Relevant Covered Missed Hits/Line
  • Back to Repo
  • 8982dbde on github
  • Prev Build on main (#10729582718)
  • Next Build on main (#10730166347)
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