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

Qiskit / qiskit-fermions / 30624978477
98%

Build:
DEFAULT BRANCH: main
Ran 31 Jul 2026 11:02AM 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

31 Jul 2026 10:51AM UTC coverage: 98.116% (+0.002%) from 98.114%
30624978477

push

github

web-flow
refactor(circuit): infer norb in UCJ.__init__ instead of taking it explicitly (#241)

`norb` was fully determined by the tensors it accompanied -- it is just
`orbital_rotations.shape[-1]` in every variant -- so the primary construction
path already inferred it, passed it, and re-derived it: `from_t_amplitudes`
computed it that way and handed it to `__init__`, which recomputed the same
value inside `_validate_shapes`. It also left `UCJ` inconsistent with `UCC`,
which takes no `norb` and derives it from its amplitude shapes; that asymmetry
was incidental to how the two classes came about rather than designed.

`__init__` now takes `variant` first and infers `norb`, mirroring
`UCC.__init__(variant, t1, t2)`, and `_validate_shapes` returns the implied
`norb` the way `UCC`'s does. `num_parameters`/`from_parameters` keep their
explicit `norb` -- the tensors they size do not exist yet at that point.

The one property this gives up is checking the tensors against the `norb` the
caller *intended*; with mutually consistent tensors there is nothing left to
disagree with. Everything else still holds, because `diag_coulomb_mats` and
`orbital_rotations` continue to anchor each other: a non-square rotation, a
wrong spin-axis count, or the two tensors implying different orbital counts are
all still rejected. That remains true at zero repetitions, where `norb` lives in
the trailing axes and survives an empty repetition axis -- worth keeping intact,
since a zero-rep ansatz is reachable from `from_t_amplitudes` whenever the
factorization truncates every term, and is now covered by a test.

Inferring from a trailing axis does require knowing the rank is what it should
be, so the tensor ranks are now validated before that axis is read; otherwise a
wrongly ranked tensor would infer a bogus `norb` and then be checked against it.

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

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

10883 of 11092 relevant lines covered (98.12%)

299.2 hits per line

Jobs
ID Job ID Ran Files Coverage
1 30624978477.1 31 Jul 2026 11:02AM UTC 103
98.12
GitHub Action Run
Source Files on build 30624978477
  • Tree
  • List 103
  • Changed 1
  • Source Changed 1
  • Coverage Changed 1
Coverage ∆ File Lines Relevant Covered Missed Hits/Line
  • Back to Repo
  • Github Actions Build #30624978477
  • 25ff3aa5 on github
  • Prev Build on main (#30623756194)
  • Next Build on main (#30736652851)
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