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

Qiskit / qiskit / 8851171785
88%

Build:
DEFAULT BRANCH: main
Ran 26 Apr 2024 04:28PM UTC
Jobs 1
Files 826
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

26 Apr 2024 03:30PM UTC coverage: 89.429% (-0.03%) from 89.463%
8851171785

push

github

web-flow
Add Rust-based `SparsePauliOp.to_matrix` and Miri tests (#11388)

* Add Rust-based `SparsePauliOp.to_matrix`

This rewrites the numerical version of `SparsePauliOp.to_matrix` to be
written in parallelised Rust, building up the matrices row-by-row rather
than converting each contained operator to a matrix individually and
summing them.

The new algorithms are complete row-based, which is embarrassingly
parallel for dense matrices, and parallelisable with additional copies
and cumulative sums in the CSR case.

The two new algorithms are an asymptotic complexity improvement for both
dense and sparse matrices over the "sum the individual matrices"
version.  In the dense case, the cost goes from

        O(4 ** num_qubits * num_ops)

to

        O(4 ** num_qubits + (2 ** num_qubits) * reduced_num_ops)

where the first term is from the zeroing of the matrix, and the second
is from updating the elements in-place.  `reduced_num_ops` is the number
of explicitly stored operations after Pauli-operator uniqueness
compaction, so is upper-bounded as `4 ** num_qubits`.  (The Pauli
compaction goes as `O(num_ops)`, so is irrelevant to the complexity
discussion.) The CSR form of the algorithm goes as

        O(2 ** num_qubits * reduced_num_ops * lg(reduced_num_ops))

which (I think! - I didn't fully calculate it) is asymptotically the
same as before, but in practice the constant factors and intermediate
memory use are *dramatically* reduced, and the new algorithm is
threadable with an additional `O(2 ** num_qubits * reduced_num_ops)`
intermediate memory overhead (the serial form has only
`O(reduced_num_ops)` memory overhead).

The `object`-coefficients form is left as-is to avoid exploding the
complexity in Rust space; these objects are already slow and unsuited
for high-performance code, so the effects should be minimal.

* Add non-blocking Miri to CI

As we begin to include more `unsafe` code in the Rust-accelerated
components, it is becoming more important for us t... (continued)

417 of 474 new or added lines in 3 files covered. (87.97%)

17 existing lines in 2 files now uncovered.

60920 of 68121 relevant lines covered (89.43%)

218071.94 hits per line

New Missed Lines in Diff

Lines Coverage ∆ File
21
74.39
crates/accelerate/src/rayon_ext.rs
36
91.59
-2.26% crates/accelerate/src/sparse_pauli_op.rs

Uncovered Existing Lines

Lines Coverage ∆ File
5
92.62
-0.76% crates/qasm2/src/lex.rs
12
97.15
-0.92% crates/qasm2/src/parse.rs
Jobs
ID Job ID Ran Files Coverage
1 8851171785.1 26 Apr 2024 04:28PM UTC 826
89.43
GitHub Action Run
Source Files on build 8851171785
  • Tree
  • List 826
  • Changed 28
  • Source Changed 0
  • Coverage Changed 5
Coverage ∆ File Lines Relevant Covered Missed Hits/Line
  • Back to Repo
  • d084aebf on github
  • Prev Build on gh-readonly-queue/main/pr-12284-80b54b966cd8b5111ce2be2e4e1b902f9b8a04cf (#8847147822)
  • Next Build on main (#8870157056)
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