Qrack  9.9
General classical-emulating-quantum development framework
Public Member Functions | List of all members
Qrack::QParity Class Referenceabstract

#include <qparity.hpp>

Inheritance diagram for Qrack::QParity:
Inheritance graph
[legend]

Public Member Functions

virtual bool MParity (const bitCapInt &mask)
 Measure (and collapse) parity of the masked set of qubits. More...
 
virtual void UniformParityRZ (const 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 (const bitCapInt &mask)=0
 Overall probability of any odd permutation of the masked set of bits. More...
 
virtual bool ForceMParity (const 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 std::vector< bitLenInt > &controls, const 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...
 

Member Function Documentation

◆ CUniformParityRZ()

virtual void Qrack::QParity::CUniformParityRZ ( const std::vector< bitLenInt > &  controls,
const bitCapInt mask,
real1_f  angle 
)
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::QUnit, Qrack::QStabilizerHybrid, Qrack::QPager, Qrack::QHybrid, Qrack::QEngineOCL, Qrack::QEngineCUDA, Qrack::QEngineCPU, Qrack::QBdtHybrid, and Qrack::QBdt.

◆ ForceMParity()

virtual bool Qrack::QParity::ForceMParity ( const bitCapInt mask,
bool  result,
bool  doForce = true 
)
pure virtual

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

Implemented in Qrack::QUnit, Qrack::QStabilizerHybrid, Qrack::QPager, Qrack::QHybrid, Qrack::QEngineOCL, Qrack::QEngineCUDA, Qrack::QEngineCPU, Qrack::QBdtHybrid, and Qrack::QBdt.

◆ MParity()

virtual bool Qrack::QParity::MParity ( const bitCapInt mask)
inlinevirtual

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

◆ ProbParity()

virtual real1_f Qrack::QParity::ProbParity ( const bitCapInt mask)
pure virtual

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

Implemented in Qrack::QUnit, Qrack::QStabilizerHybrid, Qrack::QPager, Qrack::QHybrid, Qrack::QEngineOCL, Qrack::QEngineCUDA, Qrack::QEngineCPU, Qrack::QBdtHybrid, and Qrack::QBdt.

◆ UniformParityRZ()

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

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::QPager, Qrack::QHybrid, Qrack::QEngineOCL, Qrack::QEngineCUDA, Qrack::QEngineCPU, and Qrack::QBdtHybrid.


The documentation for this class was generated from the following file: