QEngine

Defined in qengine.hpp.

This is an (abstract) intermediate specialization that inherits from Qrack::QInterface. This type is specifically a “state vector” simulation, with corresponding special methods.

inline Qrack::QEngine::QEngine(bitLenInt qBitCount, qrack_rand_gen_ptr rgp = nullptr, bool doNorm = false, bool randomGlobalPhase = true, bool useHostMem = false, bool useHardwareRNG = true, real1_f norm_thresh = REAL1_EPSILON)
inline Qrack::QEngine::QEngine()

Default constructor, primarily for protected internal use.

virtual void Qrack::QEngine::ZeroAmplitudes() = 0

Set all amplitudes to 0, and optionally temporarily deallocate state vector RAM.

virtual void Qrack::QEngine::CopyStateVec(QEnginePtr src) = 0

Exactly copy the state vector of a different QEngine instance.

virtual bool Qrack::QEngine::IsZeroAmplitude() = 0

Returns “true” only if amplitudes are all totally 0.

virtual void Qrack::QEngine::GetAmplitudePage(complex *pagePtr, bitCapIntOcl offset, bitCapIntOcl length) = 0

Copy a “page” of amplitudes from this QEngine’s internal state, into pagePtr.

virtual void Qrack::QEngine::SetAmplitudePage(complex const *pagePtr, bitCapIntOcl offset, bitCapIntOcl length) = 0

Copy a “page” of amplitudes from pagePtr into this QEngine’s internal state.

virtual void Qrack::QEngine::SetAmplitudePage(QEnginePtr pageEnginePtr, bitCapIntOcl srcOffset, bitCapIntOcl dstOffset, bitCapIntOcl length) = 0

Copy a “page” of amplitudes from another QEngine, pointed to by pageEnginePtr, into this QEngine’s internal state.

virtual void Qrack::QEngine::ShuffleBuffers(QEnginePtr engine) = 0

Swap the high half of this engine with the low half of another.

This is necessary for gates which cross sub-engine boundaries.

virtual void Qrack::QEngine::QueueSetDoNormalize(bool doNorm) = 0

Add an operation to the (OpenCL) queue, to set the value of doNormalize, which controls whether to automatically normalize the state.

virtual void Qrack::QEngine::QueueSetRunningNorm(real1_f runningNrm) = 0

Add an operation to the (OpenCL) queue, to set the value of runningNorm, which is the normalization constant for the next normalization operation.