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

Qiskit / qiskit / 10142810143

29 Jul 2024 10:44AM UTC coverage: 89.947% (-0.008%) from 89.955%
10142810143

Pull #12836

github

mergify[bot]
Bitarray postselect (#12693)

* define BitArray.postselect()

* add test for BitArray.postselect()

* lint

* remove redundant docstring text

* Update qiskit/primitives/containers/bit_array.py

Co-authored-by: Ian Hincks <ian.hincks@gmail.com>

* docstring ticks (BitArray.postselect())

Co-authored-by: Ian Hincks <ian.hincks@gmail.com>

* Simpler tests for BitArray.postselect

* lint

* add release note

* check postselect() arg lengths match

* fix postselect tests

- fix bugs with checking that ValueError is raised.
- addtionally run all tests on a "flat" data input

* lint

* Fix type-hint

We immediately check the lengths of these args, so they should be Sequences, not Iterables.

* remove spurious print()

* lint

* lint

* use bitwise operations for faster postselect

- Also added support for negative indices
- Also updated tests

* remove spurious print()

* end final line of release note

* try to fix docstring formatting

* fix bitarray test assertion

Co-authored-by: Takashi Imamichi <31178928+t-imamichi@users.noreply.github.com>

* disallow postselect positional kwarg

Co-authored-by: Takashi Imamichi <31178928+t-imamichi@users.noreply.github.com>

* fix numpy dtype args

* Simpler kwarg: "assume_unique"

* lint (line too long)

* simplification: remove assume_unique kwarg

* improve misleading comment

* raise IndexError if indices out of range

- Change ValueError to IndexError.
- Add check for out-of-range negative indices.
- Simplify use of mod
- Update test conditions (include checks for off-by-one errors)

* lint

* add negative-contradiction test

* Update docstring with IndexErrors

* lint

* change slice_bits error from ValueError to IndexError

* update slice_bits test to use IndexError

* change ValueError to IndexError in slice_shots

also update tests for this error

* update error type in slice_shots docstring

* Revert ValueError to IndexError changes

Reverting these changes as they will instead be made in a separate PR.

T... (continued)
Pull Request #12836: Bitarray postselect (backport #12693)

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

12 existing lines in 2 files now uncovered.

66198 of 73597 relevant lines covered (89.95%)

302627.87 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

97.15
/crates/qasm2/src/parse.rs


Source Not Available

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

© 2025 Coveralls, Inc