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

Qiskit / qiskit-fermions / 30743472918
98%

Build:
DEFAULT BRANCH: main
Ran 02 Aug 2026 10:29AM UTC
Jobs 1
Files 103
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

02 Aug 2026 10:18AM UTC coverage: 98.121% (+0.005%) from 98.116%
30743472918

push

github

web-flow
fix(operators): correct operand order and grouping in commutator helpers (#252)

The helpers built their products with `__and__`, but following Qiskit that is
`compose`, i.e. *left* multiplication: `A & B == B @ A`. Right multiplication
(`__matmul__`) is what the documented definitions call for, so every product was
reversed and `commutator` computed `BA - AB`.

`double_commutator` carried a second, independent error: the bracketed
half-weighted part is a single four-term sum, but it was grouped as
`term2 - term3`. That distributes the subtraction over `sign_num * op_bca` and
flips its sign, which fixing the operand order alone would not correct.

Both errors date back to the initial commit (1455f7b) rather than being a
regression. They survived because the existing tests were sign-blind: all of
them asserted a result equal to zero, `anti_commutator` is symmetric under
operand exchange so it was numerically correct throughout, and the C
double-commutator test reconstructed its reference by mirroring the buggy
expression line for line. The one test carrying a non-zero value had the
flipped sign baked into its expectation.

Verified independently of this source by expanding the free algebra on
non-commuting A, B, C in exact rationals: the coefficients (ABC:1, ACB:-1/2,
BAC:-1/2, BCA:-1/2, CAB:-1/2, CBA:1) now match the symmetric double commutator
of Ollitrault et al., Acc. Chem. Res. 54, 4229 (2021), given below their
Eq. (2); the pre-fix expression differs from it by `+ACB`.

The docstrings cited "Equation (13.6.18)" in McWeeny, which could not be
confirmed against the book. Qiskit's own opflow cites the same source with a
locator that is traceable, chapter 13.6 "Equation of motion methods" page 479,
so use that and add the Ollitrault reference alongside it.

Co-authored-by: Claude Opus 5 <noreply@anthropic.com>

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

10913 of 11122 relevant lines covered (98.12%)

298.43 hits per line

Jobs
ID Job ID Ran Files Coverage
1 30743472918.1 02 Aug 2026 10:29AM UTC 103
98.12
GitHub Action Run
Source Files on build 30743472918
  • Tree
  • List 103
  • Changed 3
  • Source Changed 3
  • Coverage Changed 2
Coverage ∆ File Lines Relevant Covered Missed Hits/Line
  • Back to Repo
  • Github Actions Build #30743472918
  • 5855f5df on github
  • Prev Build on main (#30737548551)
  • Next Build on main (#30744562503)
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