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

Qiskit / qiskit / 10147014904
90%
main: 88%

Build:
Build:
LAST BUILD BRANCH: rust_qpy
DEFAULT BRANCH: main
Ran 29 Jul 2024 03:38PM UTC
Jobs 1
Files 857
Run time 3min
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

29 Jul 2024 03:14PM UTC coverage: 90.01% (+0.3%) from 89.728%
10147014904

push

github

web-flow
 Port `star_preroute` to rust (#12761)

* This commit ports the core logic of `star_preroute` from Python to Rust. The changes involve creating a new Rust module for the star prerouting algorithm and updating the corresponding Python code to integrate with this new Rust functionality.

Details:
- New Rust file: Added `star_preroute.rs` to handle the core logic of the function `star_preroute` from the python side. This file defines the type aliases for node and block representations, which matches the current block representation of the `StarBlock` (except that the center is just a bool, as we only need to know if there is a center), and the node representation matches how the nodes used in `SabreDAG`. The `star_preroute` function processes the star blocks witihin the `SabreDAG`  and finds the linear routing equivalent and then returns the result as a `SabreResult`. Thus we can use the same methods we used in Sabre, such as `_build_sabre_dag` and `_apply_sabre_result`.
- Node representation: A key part of this implementation is how it takes advantage of `SabreResult` and `SabreDAG`, so the node representation is a tuple of the node id, list of qubit indices, a set of classical bit indices, and a directive flag. However, once we update the regular DAG to rust, this part may change significantly.
- Updates in the SABRE rust module: To use `sabre_dag.rs` and `swap_map.rs` in `star_prerouting`, I change them to be public in `crates/accelerate/src/sabre/mod.rs`. Not sure if it makes more sense to do it this way or to move `star_prerouting` to `crates/accelerate/src/sabre/` since it mimics the methods used in Sabre to change the dag.
- Python side updates: Imported the necessary modules and only modified the function `star_preroute` so that now the function performs the heavy lifting of transforming the DAG within the Rust space, leveraging `_build_sabre_dag` and `_apply_sabre_result`.
- Possible issues: I was not sure how correctly handle control flow from ... (continued)

167 of 174 new or added lines in 4 files covered. (95.98%)

10 existing lines in 3 files now uncovered.

58581 of 65083 relevant lines covered (90.01%)

452995.98 hits per line

New Missed Lines in Diff

Lines Coverage ∆ File
7
93.75
-3.98% qiskit/transpiler/passes/routing/star_prerouting.py

Uncovered Existing Lines

Lines Coverage ∆ File
2
88.39
-0.36% qiskit/transpiler/passes/synthesis/unitary_synthesis.py
2
93.38
1.27% crates/qasm2/src/lex.rs
6
90.84
-4.58% qiskit/synthesis/two_qubit/xx_decompose/decomposer.py
Jobs
ID Job ID Ran Files Coverage
1 10147014904.1 29 Jul 2024 03:38PM UTC 857
89.77
GitHub Action Run
Source Files on build 10147014904
  • Tree
  • List 857
  • Changed 46
  • Source Changed 0
  • Coverage Changed 8
Coverage ∆ File Lines Relevant Covered Missed Hits/Line
  • Back to Repo
  • b23c5452 on github
  • Prev Build on gh-readonly-queue/main/pr-12755-f8ac2ad22c1ada79e2c58ba1a584b95884692140 (#10145944243)
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