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

Qiskit / qiskit-fermions / 34354338217
98%

Build:
DEFAULT BRANCH: main
Ran 09 Sep 2026 01:04PM UTC
Jobs 1
Files 110
Run time 1min
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

09 Sep 2026 01:00PM UTC coverage: 98.165% (-0.03%) from 98.191%
34354338217

push

github

web-flow
refactor: remove `SparsePauliOp` where possible (#336)

* test(mappers): map the generator tests onto SparseObservable

The four `map_*_generators` test helpers used `SparsePauliOp` as their
generic output type `T`, inherited from the docstring examples rather than
required by anything: the library's own mapper contract (`MapperFunction`)
has spoken `SparseObservable` all along, so these were the last place a
custom mapper was exercised against the other type.

Two details of the swap are worth recording.

`compose=SparseObservable.compose` is now passed explicitly. The
`compose=None` default resolves to `operator.and_`, and `SparseObservable`
has no `__and__`, so the default is simply unusable here. It is a faithful
substitution: `SparsePauliOp.__and__` *is* `compose`, and both agree on a
non-commuting pair (`X∘Y = -iZ`).

The `expected` values are unchanged. That is safe only because both types
read `from_sparse_list(label, indices, coeff)` the same way -- a dense
`SparsePauliOp` label would *not* have ported, since it reads right-to-left
while a sparse label aligns with its index list. Each assertion was
confirmed to still fail under a perturbed coefficient, so the swap did not
quietly defuse them.

In the edge- and transfer-vertex files the helper now returns a
`SparseObservable` directly, so the `from_sparse_pauli_op` conversion at the
library-comparison site is gone.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>

* test(transpiler): compare mapped operators without SparsePauliOp

Two tests converted their `SparseObservable` operands to `SparsePauliOp`
for the sole purpose of reaching `.equiv()`, which `SparseObservable` does
not have. The conversion was the only reason `SparsePauliOp` appeared in
this file.

`simplify()` sorts terms into a canonical order and drops zero
coefficients, so the difference of two equal operators simplifies to
exactly the zero observable. That makes the file's own existing idiom --
`(a - b).simplify() == Spar... (continued)

11450 of 11664 relevant lines covered (98.17%)

565116.1 hits per line

Coverage Regressions

Lines Coverage ∆ File
1
93.33
-6.67% python/qiskit_fermions/mappers/edge_vertex_generators.py
1
93.33
-6.67% python/qiskit_fermions/mappers/fermion_generators.py
1
93.33
-6.67% python/qiskit_fermions/mappers/majorana_generators.py
1
93.33
-6.67% python/qiskit_fermions/mappers/transfer_vertex_generators.py
Jobs
ID Job ID Ran Files Coverage
1 34354338217.1 09 Sep 2026 01:04PM UTC 110
98.17
GitHub Action Run
Source Files on build 34354338217
  • Tree
  • List 110
  • Changed 5
  • Source Changed 4
  • Coverage Changed 5
Coverage ∆ File Lines Relevant Covered Missed Hits/Line
  • Back to Repo
  • Github Actions Build #34354338217
  • 564dae3b on github
  • Prev Build on main (#34324872664)
  • Next Build on main (#34364759259)
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE TRIAL · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc