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

Qiskit / qiskit-addon-sqd / 38999191217
84%
main: 83%

Build:
Build:
LAST BUILD BRANCH: stable/0.14
DEFAULT BRANCH: main
Ran 17 Oct 2026 03:33AM UTC
Jobs 1
Files 7
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

17 Oct 2026 03:32AM UTC coverage: 83.747% (+0.9%) from 82.878%
38999191217

push

github

web-flow
Document SCIState's amplitude sign convention (#395) (#408)

* Document SCIState's amplitude sign convention

SCIState.rdm() and spin_square() hand the amplitudes to PySCF, which assumes
a determinant orders its creation operators with every alpha operator before
every beta one. However, this has gone undocumented in this package. The
amplitudes docstring was precise about which determinant each amplitude
belongs to and silent about its sign, and the sci_solver contract --
otherwise thorough, down to multi-process collective semantics -- did not
mention it either.

A solver that orders them differently therefore gets wrong values from both
methods with no error raised, while its energies, RDMs, occupancies and any
selection by amplitude magnitude stay correct. That happened: SBD
interleaves the spins orbital by orbital and the Python wrapper saw
spin_square() of 0.036 for an exact singlet, with an energy rebuilt from
rdm() 89 mHa off. Fixed downstream in
https://github.com/Qiskit/sbd-eigensolver-python/pull/62,
which is also where the reordering phase is derived.

Documents the convention on SCIState.amplitudes, where the attribute lives,
and points the sci_solver output contract at it.

The three existing spin_square() tests cannot catch this. Each expands
sci_state.amplitudes into an FCI vector with a plain scatter, then compares
PySCF's spin_square of that against sci_state.spin_square() -- both sides
consume the amplitudes under the same assumed convention, so the test agrees
with itself either way. Applying the reordering phase to a random state
makes both sides move together, from 1.358 to 1.729.

Adds a test that compares against physics instead. Over a full determinant
space the eigenvector is a spin eigenstate, so spin_square() must be exactly
S(S+1); and the energy rebuilt from the RDMs must equal the eigenvalue the
solver itself returned. Neither reference is a recorded number, so the same
body suits any eigensolver. Full spaces only: on a ... (continued)

675 of 806 relevant lines covered (83.75%)

0.84 hits per line

Jobs
ID Job ID Ran Files Coverage
1 38999191217.1 17 Oct 2026 03:33AM UTC 7
83.75
GitHub Action Run
Source Files on build 38999191217
  • Tree
  • List 7
  • Changed 1
  • Source Changed 1
  • Coverage Changed 1
Coverage ∆ File Lines Relevant Covered Missed Hits/Line
  • Back to Repo
  • Github Actions Build #38999191217
  • f3e1acbe on github
  • Prev Build on stable/0.14 (#38996413066)
  • Next Build on stable/0.14 (#39046910527)
  • Delete
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