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

Qiskit / qiskit / 13636184568
88%

Build:
DEFAULT BRANCH: main
Ran 03 Mar 2025 05:18PM UTC
Jobs 1
Files 862
Run time 6min
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

03 Mar 2025 03:27PM UTC coverage: 87.083% (-0.1%) from 87.21%
13636184568

push

github

web-flow
Add `SparseObservable.compose` (#13766)

* Add `SparseObservable.compose`

This adds matrix multiplication between `SparseObservable`s (or one
`SparseObservable` and anything that can be coerced to an observable),
using the same signature as similar methods in `quantum_info`.

The current implementation attempts to be relatively memory efficient,
though there are specialisations that may be implemented if we wanted to
be faster:

- if all the contained terms are Paulis, so each pairwise multiplication
  produces either zero or one alphabet letters, we currently have a
  redundant copy-in and copy-out of the Cartesian-product generator that
  effectively doubles the overhead.  We could check whether each term
  contains only Paulis once, and then avoid that overhead in those
  cases.

- alternatively, the Cartesian-product iterator could be taught to use
  the buffers of the output `SparseObservable` directly as its output
  space, rather than requiring copy-out of its buffers, which would
  remove the overhead from all calls, not just the single-Pauli ones,
  but requires a bit more bookkeeping, since the references would keep
  need to be updated.

- the case of `qargs` being not `None` and `front=True` currently
  involves an extra copy step to simplify the logic.  If this is an
  important case, we could add a right-matmul specialisation of
  `compose_map`.

This commit currently does not contain tests, because we currently don't
have suitable methods to test the validity of the output without
coupling to the particular choice of factorisation of the matrix
multiplication.  We need either a way to convert to a Pauli-only
representation (with the exponential explosion that entails) or to a
matrix; either of these can be uniquely canonicalised.

* Make `lookup::matmul` non-`const`

Before Rust 1.83, `const` functions can't borrow `static`s, even
immutably and without interior mutability.o

There's no need for `matmul` to be `const`; it's always inlin... (continued)

285 of 446 new or added lines in 2 files covered. (63.9%)

23 existing lines in 4 files now uncovered.

75821 of 87068 relevant lines covered (87.08%)

332225.59 hits per line

New Missed Lines in Diff

Lines Coverage ∆ File
23
94.26
crates/accelerate/src/sparse_observable/mod.rs
138
2.82
crates/accelerate/src/sparse_observable/lookup.rs

Uncovered Existing Lines

Lines Coverage ∆ File
1
94.23
-0.23% crates/qasm2/src/expr.rs
3
94.29
-0.1% crates/accelerate/src/unitary_synthesis.rs
7
90.98
-1.5% crates/qasm2/src/lex.rs
12
96.68
0.0% crates/qasm2/src/parse.rs
Jobs
ID Job ID Ran Files Coverage
1 13636184568.1 03 Mar 2025 05:18PM UTC 862
87.08
GitHub Action Run
Source Files on build 13636184568
  • Tree
  • List 862
  • Changed 4
  • Source Changed 0
  • Coverage Changed 4
Coverage ∆ File Lines Relevant Covered Missed Hits/Line
  • Back to Repo
  • Github Actions Build #13636184568
  • 4bef4284 on github
  • Prev Build on main (#13635545005)
  • Next Build on main (#13640267114)
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

© 2025 Coveralls, Inc