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

Qiskit / qiskit-fermions / 29262900024
98%

Build:
DEFAULT BRANCH: main
Ran 13 Jul 2026 03:58PM UTC
Jobs 1
Files 80
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

13 Jul 2026 03:35PM UTC coverage: 97.785%. Remained the same
29262900024

push

github

web-flow
Fix relabel modes post processing (#177)

* fix: correct RelabelModes bitstring post-processing recipe

The documented post-processing recipe used `bitstring[-idx]`, which has an
index-0 asymmetry (`-0 == 0` reads from the front while every other index
reads from the back) and never restored Qiskit's little-endian bit ordering.
It only passed its doctest because the example used a self-inverse, symmetric
permutation that masked the bug.

Replace it with `"".join(bitstring[~idx] for idx in bit_permutation)[::-1]`,
which reads each bit consistently from the end and reverses the result to stay
little-endian. Verified against ground truth across all permutations and
bitstrings for sizes up to 7 modes.

Switch the doctest to a physically motivated, asymmetric blocked->interleaved
relabeling (`[0, 2, 4, 1, 3, 5]`) so it no longer hides these bug classes, and
print the raw counts before post-processing to make the transformation obvious.

Also expand the class docstring to define the permutation direction precisely
(original -> new mode index: original mode `i` is placed at new index
`permutation[i]`), explain the post-processing conceptually, and make clear
that under automatic relabeling the applied permutation is only available from
the circuit metadata.

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

* docs: note RelabelModes permutation metadata may be absent

The "Post-processing" section instructed users to always read the applied
relabeling from `metadata["permutation"]`, but `run()` returns the input
circuit unchanged -- with no `permutation` metadata -- whenever the pass has
no effect (automatic path with the optional pyomo dependency or a solver
missing, or the solver raising). Following the docstring literally then
raises `KeyError`.

Document that the field is only present when the circuit was actually
relabeled, and switch the doctest to the defensive `metadata.get("permutation")`
access pattern it now recommends.

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

7682 of 7856 relevant lines covered (97.79%)

161.8 hits per line

Jobs
ID Job ID Ran Files Coverage
1 29262900024.1 13 Jul 2026 03:58PM UTC 80
97.79
GitHub Action Run
Source Files on build 29262900024
  • Tree
  • List 80
  • Changed 1
  • Source Changed 1
  • Coverage Changed 1
Coverage ∆ File Lines Relevant Covered Missed Hits/Line
  • Back to Repo
  • Github Actions Build #29262900024
  • 51b7856b on github
  • Prev Build on main (#29262826814)
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc