QParity

Defined in qparity.hpp.

This is an interface layer, separate from and in addition to Qrack::QInterface, meant to isolate less-used functionality as optional.

class QParity

Subclassed by Qrack::QBdt, Qrack::QBdtHybrid, Qrack::QEngine, Qrack::QStabilizerHybrid, Qrack::QUnit

Methods

inline virtual void Qrack::QParity::UniformParityRZ(bitCapInt mask, real1_f angle)

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}.

virtual void Qrack::QParity::CUniformParityRZ(const std::vector<bitLenInt> &controls, 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}\).

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.

virtual real1_f Qrack::QParity::ProbParity(bitCapInt mask) = 0

Overall probability of any odd permutation of the masked set of bits.

inline virtual bool Qrack::QParity::MParity(bitCapInt mask)

Measure (and collapse) parity of the masked set of qubits.

virtual bool Qrack::QParity::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.

Warning

PSEUDO-QUANTUM