QEngineCPU

Defined in qengine_cpu.hpp.

The API is provided by Qrack::QInterface, via Qrack::Engine. This is a general purpose implementation of Qrack::QInterface, without OpenCL.

Qrack::QEngineCPU::QEngineCPU(bitLenInt qBitCount, bitCapInt initState, qrack_rand_gen_ptr rgp = nullptr, complex phaseFac = CMPLX_DEFAULT_ARG, bool doNorm = false, bool randomGlobalPhase = true, bool ignored = false, int64_t ignored2 = -1, bool useHardwareRNG = true, bool useSparseStateVec = false, real1_f norm_thresh = REAL1_EPSILON, std::vector<int64_t> ignored3 = {}, bitLenInt ignored4 = 0U, real1_f ignored5 = FP_NORM_EPSILON_F)

Initialize a coherent unit with qBitCount number of bits, to initState unsigned integer permutation state, with a shared random number generator, with a specific phase.

(Note that “useHostMem” is required as a parameter to normalize constructors for use with the CreateQuantumInterface() factory, but it serves no function in QEngineCPU.)

Warning
Overall phase is generally arbitrary and unknowable. Setting two QEngineCPU instances to the same phase usually makes sense only if they are initialized at the same time.