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

Qiskit / qiskit-addon-utils / 22691633167
91%

Build:
DEFAULT BRANCH: main
Ran 04 Mar 2026 10:07PM UTC
Jobs 1
Files 32
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

04 Mar 2026 10:06PM UTC coverage: 90.633% (+0.2%) from 90.453%
22691633167

push

github

web-flow
Expectation-value indexing bugfix (#145)

* fix bug w observable axis (WIP)

* require mask arg for `_apply_postselect_mask`

Docstring claims returned bool_array and basis_dict have extra bits appended to indicate postselection/rejection, but this was not happening when input `postselect_mask` was `None`. Simplest, least-surprising consistent behavior seems to be just not allowing use of `_apply_postselect_mask` if no mask is given, i.e. making `postselect_mask` a required arg rather than optional kwarg.

* require pec signs for `apply_pec_signs`

Docstring claims returned bool_array and basis_dict have extra bits appended to indicate PEC negation, but this was not happening when input `pauli_signs` was `None`. Simplest, least-surprising consistent behavior seems to be just not allowing use of `_apply_pec_signs` if no pauli signs are given, i.e. making `pauli_signs` a required arg rather than optional kwarg.

* handle `None` arg values outside function calls

Prior commits changed `_apply_postselect_mask` and `apply_pec_signs` so their arguments are not optional but required.

Here, add logic to only call those functions if args are not `None` (else handle appropriately).

* avoid masking indexing bug

Was seeing an indexing error somewhere in the in-place, broadcast, boolean-masked division.

Simplified these lines, improved commenting. No longer see the indexing error.

* add TODO comment

* Fix lint bugs (#148)

* (WIP) unit tests for executor_expectation_values

Not passing yet. First trying to deal with edge cases e.g. args that can be lists or integers...

* quick fixes to bugs in tests

* (WIP) more tests passing

* Fix bug with axes into np.mean

* expval test cleanup

* Tidy up

* Add release note. Fix type hint

* fix lint

* fix reno reference

* Hold off on testing against sparse observable for now

---------

Co-authored-by: Caleb Johnson <caleb.johnson@ibm.com>

39 of 40 new or added lines in 1 file covered. (97.5%)

745 of 822 relevant lines covered (90.63%)

0.91 hits per line

New Missed Lines in Diff

Lines Coverage ∆ File
1
95.65
0.78% qiskit_addon_utils/exp_vals/expectation_values.py
Jobs
ID Job ID Ran Files Coverage
1 22691633167.1 04 Mar 2026 10:07PM UTC 32
90.63
GitHub Action Run
Source Files on build 22691633167
  • Tree
  • List 32
  • Changed 1
  • Source Changed 1
  • Coverage Changed 1
Coverage ∆ File Lines Relevant Covered Missed Hits/Line
  • Back to Repo
  • Github Actions Build #22691633167
  • 1c9bfc80 on github
  • Prev Build on main (#22591890373)
  • Next Build on main (#22693046348)
  • Delete
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