qiskit/releasenotes/notes/1.2/bitarray-postselect-659b8f7...

12 lines
364 B
YAML

---
features_primitives:
- |
Added a new method :meth:`.BitArray.postselect` that returns all shots containing specified bit values.
Example usage::
from qiskit.primitives.containers import BitArray
ba = BitArray.from_counts({'110': 2, '100': 4, '000': 3})
print(ba.postselect([0,2], [0,1]).get_counts())
# {'110': 2, '100': 4}