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

Qiskit / qiskit-fermions / 33624751028
98%

Build:
DEFAULT BRANCH: main
Ran 02 Sep 2026 11:32AM UTC
Jobs 1
Files 104
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 Sep 2026 11:28AM UTC coverage: 98.061% (-0.009%) from 98.07%
33624751028

push

github

web-flow
feat: add `OperatorTrait.is_hermitian` (#304)

* feat: add is_hermitian to the OperatorTrait protocol

Every operator type already provided this check, but it was reachable only
through the concrete classes: neither the Rust trait nor the Python protocol
declared it, so generic code over `T: OperatorTrait` (or a parameter annotated
`OperatorTrait`, such as `jordan_wigner`'s) could not call it. Several sessions
have now run into that gap.

It is a required trait method rather than one with a default body because the
check reduces `self - self.adjoint()` to a normal form, and `normal_ordered` is
not part of the trait: it takes different arguments on every operator type, so
there is no single call a default body could make. Hoisting a normal-form hook
onto the trait to enable one was rejected, because the contract of such a hook
differs per type in exactly the way that decides this method's strength, and it
would be a new core API whose only caller is this method. A default body also
cannot reach `__sub__`, which lives on `OperatorMacro`.

That per-type strength difference is the reason the trait declaration and the
Python protocol document only the weakest guarantee, with the two operator types
that have something specific to say documenting it on their own implementation:
`EdgeVertexOperator`'s normal form contracts every reducible pair, so its result
is exact, while `TransferVertexOperator`'s leaves shared-mode transfer products
alone, so a `False` result there can be a false negative.

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

* refactor: drop the inherent num_groups shadowing the trait default

`OperatorTrait::num_groups` has a default body, but all four operator types also
declared an inherent method of the same name. Rust resolves `op.num_groups()` to
the inherent one, so the trait default was dead code for every concrete type and
only ever ran through a generic bound. The two implementations agreed, but
nothing enforced that: had the... (continued)

37 of 37 new or added lines in 6 files covered. (100.0%)

1 existing line in 1 file now uncovered.

12337 of 12581 relevant lines covered (98.06%)

521774.64 hits per line

Coverage Regressions

Lines Coverage ∆ File
1
99.75
-0.25% crates/core/src/mappers/library/jordan_wigner.rs
Jobs
ID Job ID Ran Files Coverage
1 33624751028.1 02 Sep 2026 11:32AM UTC 104
98.06
GitHub Action Run
Source Files on build 33624751028
  • Tree
  • List 104
  • Changed 8
  • Source Changed 7
  • Coverage Changed 7
Coverage ∆ File Lines Relevant Covered Missed Hits/Line
  • Back to Repo
  • Github Actions Build #33624751028
  • c458e005 on github
  • Prev Build on main (#33601913735)
  • Next Build on main (#33626627795)
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