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

Qiskit / qiskit-fermions / 44533055163
98%

Build:
DEFAULT BRANCH: main
Ran 19 Nov 2026 01:29PM UTC
Jobs 1
Files 135
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

19 Nov 2026 01:23PM UTC coverage: 98.168% (-0.1%) from 98.268%
44533055163

push

github

web-flow
Adds API to compute the non-commutation graph of operators (#424)

* refactor(operators): formalize the term count as `num_terms`

Counting an operator's terms was spelled three different ways: `coeffs.len()` in
the Rust core, `boundaries.len() - 1` in both the Python `__len__` and the C
`qf_*_len`, and nothing at all on `OperatorTrait`. The two bases agree for any
coherent operator, so this was latent rather than broken, but nothing enforced
that agreement and a reader had no single place to look.

`OperatorTrait::num_terms` now provides it once, counted off the coefficients.
That is not merely the cheaper basis (no subtraction): the incremental builders
push a term's coefficient *before* its boundary, so `coeffs.len()` already counts
a term mid-append where `boundaries.len() - 1` does not. Every internal read,
`__len__`, and the C accessors route through it.

Deliberately left alone are two lookalikes that are not term counts:
`boundaries[boundaries.len() - 1]` indexes the final factor offset, and the
`coeffs.len() == coeffs.capacity()` assertions are about allocation.

The C functions are renamed `qf_*_len` to `qf_*_num_terms`, which is a breaking
change and carries an `upgrade_c` note. The motivation is a genuine collision:
Qiskit's C API has both `qk_obs_num_terms` and `qk_obs_len`, and they count
*different* things (its `qk_obs_len` returns the total non-identity factors, as
its body shows, though its docstring claims otherwise). Our `_len` meant what
Qiskit calls `num_terms`, so anyone reading both headers would have been misled.
The `_len` names are now reserved rather than reused, leaving room to expose the
factor count under that name later if it is ever wanted.

Also adds the function to the C docs for the fermionic and Majorana operators,
which had omitted it while the edge- and transfer-vertex pages listed it.

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

* refactor(pyext): hoist the grouping dispatch macro into the module root
... (continued)

1088 of 1129 new or added lines in 18 files covered. (96.37%)

1 existing line in 1 file now uncovered.

15648 of 15940 relevant lines covered (98.17%)

275674.91 hits per line

Uncovered Changes

Lines Coverage ∆ File
11
95.53
-3.48% crates/cext/src/operators/edge_vertex_operator.rs
11
95.56
-3.46% crates/cext/src/operators/transfer_vertex_operator.rs
3
96.1
0.33% crates/core/src/operators/edge_vertex_operator.rs
3
98.69
-0.17% crates/core/src/operators/fermion_operator.rs
3
96.25
-0.24% crates/core/src/operators/majorana_operator.rs
3
96.17
-0.18% crates/core/src/operators/transfer_vertex_operator.rs
2
98.79
-0.59% crates/cext/src/operators/fermion_operator.rs
2
91.3
crates/cext/src/operators/mod.rs
2
99.71
crates/core/src/operators/terms/grouping/clash.rs
1
98.68
-0.29% crates/cext/src/operators/majorana_operator.rs

Coverage Regressions

Lines Coverage ∆ File
1
99.51
-0.49% crates/core/src/mappers/qk_obs.rs
Jobs
ID Job ID Ran Files Coverage
1 44533055163.1 19 Nov 2026 01:29PM UTC 135
98.17
GitHub Action Run
Source Files on build 44533055163
  • Tree
  • List 135
  • Changed 17
  • Source Changed 16
  • Coverage Changed 14
Coverage ∆ File Lines Relevant Covered Missed Hits/Line
  • Back to Repo
  • Github Actions Build #44533055163
  • 97a0d130 on github
  • Prev Build on main (#44491206285)
  • Next Build on main (#45132409271)
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