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

Qiskit / qiskit-fermions / 29841024514
98%

Build:
DEFAULT BRANCH: main
Ran 21 Jul 2026 03:01PM UTC
Jobs 1
Files 87
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

21 Jul 2026 02:50PM UTC coverage: 97.604% (+0.02%) from 97.586%
29841024514

push

github

web-flow
fix: correct cross-spin sign for interleaved mixed FCI terms (#196)

The spinful FCI matvec kernel factors each mixed term into independent
alpha and beta blocks and folds the block-reordering phase into a single
per-term cross-sign. That cross-sign was computed as `(-1)^{n_alpha *
k_beta}`, assuming a beta operator always hops over the same alpha electron
count because the net count is invariant across a particle-conserving term.

That fails when a term's alpha and beta ladder operators are interleaved:
the alpha count seen by each beta operator changes between the betas, so the
collapsed exponent is wrong. In effect the kernel returned the sign of the
*normal-ordered* term regardless of how it was written, silently dropping a
sign for common two-body excitations such as `a†_{β1} a†_{α0} a_{β0} a_{α1}`
— which disagreed with ffsim by an overall minus sign, and propagated
through every consumer of `_fci_linear_operator_` (Evolution,
OrbitalRotation).

Accumulate the cross-sign in the term's written (right-to-left) order
instead, folding in `(-1)^{alpha count at that step}` at each beta operator.
This stays a per-term constant, so the factored contraction and its
performance are unchanged, and it reduces to the previous formula for the
already-correct beta-only case. Note the earlier "normal ordering
unnecessary" reasoning still holds: intra-block ordering was always handled
exactly by the ladder walk; only the cross-block sign was wrong. The
surrounding comments are updated to make that distinction precise.

Add regression tests at both layers: a Rust kernel test pinned against the
ffsim-verified amplitude plus a reordering check, and a Python test of the
`FermionOperator._linear_operator_` contract against ffsim. The pre-existing
interleaved tests missed the bug because their beta operators sat at equal
alpha parity, so the old and new cross-signs coincided; the new terms
straddle an odd alpha count and fail against the old formula.

Co-authored-by: ... (continued)

80 of 80 new or added lines in 1 file covered. (100.0%)

9614 of 9850 relevant lines covered (97.6%)

333.31 hits per line

Jobs
ID Job ID Ran Files Coverage
1 29841024514.1 21 Jul 2026 03:01PM UTC 87
97.6
GitHub Action Run
Source Files on build 29841024514
  • Tree
  • List 87
  • Changed 1
  • Source Changed 1
  • Coverage Changed 1
Coverage ∆ File Lines Relevant Covered Missed Hits/Line
  • Back to Repo
  • Github Actions Build #29841024514
  • 86823e1b on github
  • Prev Build on main (#29744608424)
  • Next Build on main (#29844319920)
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