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

Qiskit / qiskit-fermions / 34364759259
98%

Build:
DEFAULT BRANCH: main
Ran 09 Sep 2026 02:41PM 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 02:36PM UTC coverage: 98.452% (+0.3%) from 98.165%
34364759259

push

github

web-flow
Refactor operator `groups` assignment in core (#337)

* refactor(operators): funnel every `groups` write through the trait

`OperatorTrait::set_groups` was documented as "the only route through which group indices enter an
operator", the argument being that validating there makes a corrupt operator unreachable. That claim
was false: `groups` is a `pub` field, and direct assignments bypassed the length check throughout.

Rather than route the clear-only sites through `set_groups(None)`, invert the dependency: a new
required `_write_groups` becomes the single field write, and both public setters are lifted onto it as
provided methods. Two things fall out. The length check, previously copy-pasted byte-identically into
all four operator types, is now written once. And `clear_groups` can be infallible, so the twelve
in-place operations that drop a grouping need neither an `expect` nor a discarded `Result` for an
outcome that cannot occur -- which is also what lets the C API's `del_groups` and `add_term` keep
their `void` signatures in the following commit.

The `.expect()` calls added at the remaining sites are assertions, not error handling: each one sits
next to a loop that pushes exactly one group index per appended term. `GroupingError` has no
`From<CoherenceError>` and `retain_terms` returns `()`, so propagating was not available anyway.

Two categories deliberately keep writing the field, and the trait doc is softened to say so. The
incremental builders in `library` seed an empty array on a term-less operator and then grow terms and
group indices together, so a whole-array check can only ever hold in that initial instant; a narrow
`push_group` helper was rejected because its weaker `groups.len() <= coeffs.len()` invariant would
legitimize the transient state rather than remove it. And the field itself stays `pub`: privatizing
one of five equally corruptible fields buys nothing, since pushing a coefficient breaks the pair
regardless. No lint can expre... (continued)

100 of 100 new or added lines in 13 files covered. (100.0%)

11515 of 11696 relevant lines covered (98.45%)

563571.04 hits per line

Jobs
ID Job ID Ran Files Coverage
1 34364759259.1 09 Sep 2026 02:41PM UTC 110
98.45
GitHub Action Run
Source Files on build 34364759259
  • Tree
  • List 110
  • Changed 13
  • Source Changed 13
  • Coverage Changed 9
Coverage ∆ File Lines Relevant Covered Missed Hits/Line
  • Back to Repo
  • Github Actions Build #34364759259
  • acc2c0c1 on github
  • Prev Build on main (#34354338217)
  • Next Build on main (#34373221764)
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