Qiskit / qiskit

Qiskit is an open-source SDK for working with quantum computers at the level of extended quantum circuits, operators, and primitives.
https://www.ibm.com/quantum/qiskit
Apache License 2.0
4.82k stars 2.29k forks source link

Bitarray postselect #12693

Open aeddins-ibm opened 2 days ago

aeddins-ibm commented 2 days ago

Summary

Add method BitArray.postselect(), per issue #12688 .

Details and comments

Added a test that does postselection on a random circuit (fixed seed in the test) with this structure:

image

Three registers, each register has >8 qubits, so it should be a pretty messy application of postselection. Each QuantumChannel is a 50/50 bitflip. We randomly pick a few of the pairs of measurements, postselect on the first cbit of each pair being randomly 0 or 1, then check that the expectation value of Z...Z on all the second cbits of each pair matches the expectation (repeating this sentence a bunch of times).

qiskit-bot commented 2 days ago

Thank you for opening a new pull request.

Before your PR can be merged it will first need to pass continuous integration tests and be reviewed. Sometimes the review process can be slow, so please be patient.

While you're waiting, please feel free to review other open PRs. While only a subset of people are authorized to approve pull requests for merging, everyone is encouraged to review open pull requests. Doing reviews helps reduce the burden on the core team and helps make the project's code better for everyone.

One or more of the following people are relevant to this code:

coveralls commented 2 days ago

Pull Request Test Coverage Report for Build 9719523525

Details


Files with Coverage Reduction New Missed Lines %
crates/qasm2/src/lex.rs 4 92.88%
crates/qasm2/src/parse.rs 12 97.15%
<!-- Total: 16 -->
Totals Coverage Status
Change from base Build 9718390567: -0.008%
Covered Lines: 64075
Relevant Lines: 71381

💛 - Coveralls
coveralls commented 2 days ago

Pull Request Test Coverage Report for Build 9725434498

Details


Files with Coverage Reduction New Missed Lines %
qiskit/transpiler/passes/synthesis/unitary_synthesis.py 2 88.2%
crates/qasm2/src/lex.rs 2 93.38%
<!-- Total: 4 -->
Totals Coverage Status
Change from base Build 9718390567: 0.009%
Covered Lines: 64087
Relevant Lines: 71381

💛 - Coveralls
qiskit-bot commented 2 days ago

Thank you for opening a new pull request.

Before your PR can be merged it will first need to pass continuous integration tests and be reviewed. Sometimes the review process can be slow, so please be patient.

While you're waiting, please feel free to review other open PRs. While only a subset of people are authorized to approve pull requests for merging, everyone is encouraged to review open pull requests. Doing reviews helps reduce the burden on the core team and helps make the project's code better for everyone.

One or more of the following people are relevant to this code: