Qrack
7.0
General classical-emulating-quantum development framework
|
#include <qparity.hpp>
Public Member Functions | |
virtual bool | MParity (bitCapInt mask) |
Measure (and collapse) parity of the masked set of qubits. More... | |
virtual void | UniformParityRZ (bitCapInt mask, real1_f angle) |
If the target qubit set parity is odd, this applies a phase factor of \(e^{i angle}\). More... | |
virtual real1_f | ProbParity (bitCapInt mask)=0 |
Overall probability of any odd permutation of the masked set of bits. More... | |
virtual bool | ForceMParity (bitCapInt mask, bool result, bool doForce=true)=0 |
Act as if is a measurement of parity of the masked set of qubits was applied, except force the (usually random) result. More... | |
virtual void | CUniformParityRZ (const bitLenInt *controls, bitLenInt controlLen, bitCapInt mask, real1_f angle)=0 |
If the controls are set and the target qubit set parity is odd, this applies a phase factor of \(e^{i angle}\). More... | |
|
pure virtual |
If the controls are set and the target qubit set parity is odd, this applies a phase factor of \(e^{i angle}\).
If the controls are set and the target qubit set parity is even, this applies the conjugate, \(e^{-i angle}\). Otherwise, do nothing if any control is not set.
Implemented in Qrack::QStabilizerHybrid, Qrack::QMaskFusion, Qrack::QEngineOCL, Qrack::QEngineCPU, Qrack::QBdt, Qrack::QHybrid, Qrack::QPager, and Qrack::QUnit.
|
pure virtual |
Act as if is a measurement of parity of the masked set of qubits was applied, except force the (usually random) result.
Implemented in Qrack::QMaskFusion, Qrack::QStabilizerHybrid, Qrack::QEngineOCL, Qrack::QHybrid, Qrack::QEngineCPU, Qrack::QPager, Qrack::QBdt, and Qrack::QUnit.
|
inlinevirtual |
Measure (and collapse) parity of the masked set of qubits.
Overall probability of any odd permutation of the masked set of bits.
Implemented in Qrack::QMaskFusion, Qrack::QStabilizerHybrid, Qrack::QEngineOCL, Qrack::QHybrid, Qrack::QEngineCPU, Qrack::QPager, Qrack::QBdt, and Qrack::QUnit.
If the target qubit set parity is odd, this applies a phase factor of \(e^{i angle}\).
If the target qubit set parity is even, this applies the conjugate, e^{-i angle}.
Reimplemented in Qrack::QStabilizerHybrid, Qrack::QMaskFusion, Qrack::QEngineOCL, Qrack::QEngineCPU, Qrack::QHybrid, and Qrack::QPager.