Qrack  1.7
General classical-emulating-quantum development framework
Public Member Functions | Protected Member Functions | Protected Attributes | Static Protected Attributes | List of all members
Qrack::QEngineOCL Class Reference

OpenCL enhanced QEngineCPU implementation. More...

#include <qengine_opencl.hpp>

Inheritance diagram for Qrack::QEngineOCL:
Inheritance graph
[legend]
Collaboration diagram for Qrack::QEngineOCL:
Collaboration graph
[legend]

Public Member Functions

 QEngineOCL (bitLenInt qBitCount, bitCapInt initState, std::shared_ptr< std::default_random_engine > rgp=nullptr)
 
virtual void Swap (bitLenInt qubit1, bitLenInt qubit2)
 Swap values of two bits in register. More...
 
virtual void Swap (bitLenInt start1, bitLenInt start2, bitLenInt length)
 Bitwise swap. More...
 
virtual void X (bitLenInt start, bitLenInt length)
 Bitwise Pauli X (or logical "NOT") operator. More...
 
virtual void ROL (bitLenInt shift, bitLenInt start, bitLenInt length)
 "Circular shift left" - shift bits left, and carry last bits. More...
 
virtual void ROR (bitLenInt shift, bitLenInt start, bitLenInt length)
 "Circular shift right" - shift bits right, and carry first bits. More...
 
virtual void INC (bitCapInt toAdd, bitLenInt start, bitLenInt length)
 Increment integer (without sign, with carry) More...
 
virtual void DEC (bitCapInt toSub, bitLenInt start, bitLenInt length)
 Subtract integer (without sign, with carry) More...
 
virtual void INCC (bitCapInt toAdd, bitLenInt start, bitLenInt length, bitLenInt carryIndex)
 Increment integer (without sign, with carry) More...
 
virtual void DECC (bitCapInt toSub, bitLenInt start, bitLenInt length, bitLenInt carryIndex)
 Subtract integer (without sign, with carry) More...
 
virtual bitCapInt IndexedLDA (bitLenInt indexStart, bitLenInt indexLength, bitLenInt valueStart, bitLenInt valueLength, unsigned char *values)
 Set 8 bit register bits based on read from classical memory. More...
 
virtual bitCapInt IndexedADC (bitLenInt indexStart, bitLenInt indexLength, bitLenInt valueStart, bitLenInt valueLength, bitLenInt carryIndex, unsigned char *values)
 Add based on an indexed load from classical memory. More...
 
virtual bitCapInt IndexedSBC (bitLenInt indexStart, bitLenInt indexLength, bitLenInt valueStart, bitLenInt valueLength, bitLenInt carryIndex, unsigned char *values)
 Subtract based on an indexed load from classical memory. More...
 
- Public Member Functions inherited from Qrack::QEngineCPU
 QEngineCPU (bitLenInt qBitCount, bitCapInt initState, std::shared_ptr< std::default_random_engine > rgp=nullptr, complex phaseFac=complex(-999.0,-999.0))
 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. More...
 
 ~QEngineCPU ()
 
virtual void SetQuantumState (complex *inputState)
 Set arbitrary pure quantum state, in unsigned int permutation basis. More...
 
virtual void SetPermutation (bitCapInt perm)
 Set to a specific permutation. More...
 
virtual void SetRandomSeed (uint32_t seed)
 
virtual bitLenInt Cohere (QInterfacePtr toCopy)
 Combine another QInterface with this one, after the last bit index of this one. More...
 
std::map< QInterfacePtr, bitLenIntCohere (std::vector< QInterfacePtr > toCopy)
 Combine (copies) each QEngineCPU in the vector with this one, after the last bit index of this one. More...
 
virtual void Decohere (bitLenInt start, bitLenInt length, QInterfacePtr dest)
 Minimally decohere a set of contiguous bits from the full coherent unit, into "destination.". More...
 
virtual bitLenInt Cohere (QEngineCPUPtr toCopy)
 Combine (a copy of) another QEngineCPU with this one, after the last bit index of this one. More...
 
virtual void Decohere (bitLenInt start, bitLenInt length, QEngineCPUPtr dest)
 Minimally decohere a set of contigious bits from the full coherent unit. More...
 
virtual void Dispose (bitLenInt start, bitLenInt length)
 Minimally decohere a set of contigious bits from the full coherent unit, throwing these qubits away. More...
 
virtual void CCNOT (bitLenInt control1, bitLenInt control2, bitLenInt target)
 Doubly-controlled not. More...
 
virtual void AntiCCNOT (bitLenInt control1, bitLenInt control2, bitLenInt target)
 "Anti-doubly-controlled not" - Apply "not" if control bits are both zero, do not apply if either control bit is one. More...
 
virtual void CNOT (bitLenInt control, bitLenInt target)
 Controlled not. More...
 
virtual void AntiCNOT (bitLenInt control, bitLenInt target)
 "Anti-controlled not" - Apply "not" if control bit is zero, do not apply if control bit is one. More...
 
virtual void H (bitLenInt qubitIndex)
 Hadamard gate. More...
 
virtual bool M (bitLenInt qubitIndex)
 Measurement gate. More...
 
virtual void X (bitLenInt qubitIndex)
 NOT gate, which is also Pauli x matrix. More...
 
virtual void Y (bitLenInt qubitIndex)
 Apply Pauli Y matrix to bit. More...
 
virtual void Z (bitLenInt qubitIndex)
 Apply Pauli Z matrix to bit. More...
 
virtual void CY (bitLenInt control, bitLenInt target)
 Apply controlled Pauli Y matrix to bit. More...
 
virtual void CZ (bitLenInt control, bitLenInt target)
 Apply controlled Pauli Z matrix to bit. More...
 
virtual void AND (bitLenInt inputBit1, bitLenInt inputBit2, bitLenInt outputBit)
 "AND" compare two bits in QEngineCPU, and store result in outputBit More...
 
virtual void OR (bitLenInt inputBit1, bitLenInt inputBit2, bitLenInt outputBit)
 "OR" compare two bits in QEngineCPU, and store result in outputBit More...
 
virtual void XOR (bitLenInt inputBit1, bitLenInt inputBit2, bitLenInt outputBit)
 "XOR" compare two bits in QEngineCPU, and store result in outputBit More...
 
virtual void CLAND (bitLenInt inputQBit, bool inputClassicalBit, bitLenInt outputBit)
 "AND" compare a qubit in QEngineCPU with a classical bit, and store result in outputBit More...
 
virtual void CLOR (bitLenInt inputQBit, bool inputClassicalBit, bitLenInt outputBit)
 "OR" compare a qubit in QEngineCPU with a classical bit, and store result in outputBit More...
 
virtual void CLXOR (bitLenInt inputQBit, bool inputClassicalBit, bitLenInt outputBit)
 "XOR" compare a qubit in QEngineCPU with a classical bit, and store result in outputBit More...
 
virtual void RT (double radians, bitLenInt qubitIndex)
 "Phase shift gate" - Rotates as e^(-i*/2) around |1> state More...
 
virtual void RX (double radians, bitLenInt qubitIndex)
 x axis rotation gate - Rotates as e^(-i*/2) around Pauli x axis More...
 
virtual void CRX (double radians, bitLenInt control, bitLenInt target)
 Controlled x axis rotation - if control bit is true, rotates as e^(-i*/2) around Pauli x axis. More...
 
virtual void RY (double radians, bitLenInt qubitIndex)
 y axis rotation gate - Rotates as e^(-i*/2) around Pauli y axis More...
 
virtual void CRY (double radians, bitLenInt control, bitLenInt target)
 Controlled y axis rotation - if control bit is true, rotates as e^(-i*) around Pauli y axis. More...
 
virtual void RZ (double radians, bitLenInt qubitIndex)
 z axis rotation gate - Rotates as e^(-i*/2) around Pauli z axis More...
 
virtual void CRZ (double radians, bitLenInt control, bitLenInt target)
 Controlled z axis rotation - if control bit is true, rotates as e^(-i*) around Pauli z axis. More...
 
virtual void CRT (double radians, bitLenInt control, bitLenInt target)
 Controlled "phase shift gate" - if control bit is true, rotates target bit as e^(-i*/2) around |1> state. More...
 
virtual void CNOT (bitLenInt control, bitLenInt target, bitLenInt length)
 Bitwise CNOT. More...
 
virtual void AntiCNOT (bitLenInt control, bitLenInt target, bitLenInt length)
 Bitwise "Anti-"CNOT - NOT operation if control is 0. More...
 
virtual void CCNOT (bitLenInt control1, bitLenInt control2, bitLenInt target, bitLenInt length)
 Bitwise CCNOT. More...
 
virtual void AntiCCNOT (bitLenInt control1, bitLenInt control2, bitLenInt target, bitLenInt length)
 Bitwise "Anti-"CCNOT - NOT operation if both control bits are 0. More...
 
virtual void AND (bitLenInt inputBit1, bitLenInt inputBit2, bitLenInt outputBit, bitLenInt length)
 "AND" compare two bits in QEngineCPU, and store result in outputBit More...
 
virtual void OR (bitLenInt inputBit1, bitLenInt inputBit2, bitLenInt outputBit, bitLenInt length)
 "OR" compare two bits in QEngineCPU, and store result in outputBit More...
 
virtual void XOR (bitLenInt inputBit1, bitLenInt inputBit2, bitLenInt outputBit, bitLenInt length)
 "XOR" compare two bits in QEngineCPU, and store result in outputBit More...
 
virtual void INCS (bitCapInt toAdd, bitLenInt start, bitLenInt length, bitLenInt overflowIndex)
 Add an integer to the register, with sign and without carry. More...
 
virtual void INCSC (bitCapInt toAdd, bitLenInt start, bitLenInt length, bitLenInt overflowIndex, bitLenInt carryIndex)
 Add an integer to the register, with sign and with carry. More...
 
virtual void INCSC (bitCapInt toAdd, bitLenInt start, bitLenInt length, bitLenInt carryIndex)
 Add an integer to the register, with sign and with carry. More...
 
virtual void INCBCD (bitCapInt toAdd, bitLenInt start, bitLenInt length)
 Add BCD integer (without sign) More...
 
virtual void INCBCDC (bitCapInt toAdd, bitLenInt start, bitLenInt length, bitLenInt carryIndex)
 Add BCD integer (without sign, with carry) More...
 
virtual void DECS (bitCapInt toAdd, bitLenInt start, bitLenInt length, bitLenInt overflowIndex)
 Subtract an integer from the register, with sign and without carry. More...
 
virtual void DECSC (bitCapInt toAdd, bitLenInt start, bitLenInt length, bitLenInt overflowIndex, bitLenInt carryIndex)
 Subtract an integer from the register, with sign and with carry. More...
 
virtual void DECSC (bitCapInt toAdd, bitLenInt start, bitLenInt length, bitLenInt carryIndex)
 Subtract an integer from the register, with sign and with carry. More...
 
virtual void DECBCD (bitCapInt toAdd, bitLenInt start, bitLenInt length)
 Subtract BCD integer (without sign) More...
 
virtual void DECBCDC (bitCapInt toSub, bitLenInt start, bitLenInt length, bitLenInt carryIndex)
 Subtract BCD integer (without sign, with carry) More...
 
virtual void ZeroPhaseFlip (bitLenInt start, bitLenInt length)
 For chips with a zero flag, flip the phase of the state where the register equals zero. More...
 
virtual void CPhaseFlipIfLess (bitCapInt greaterPerm, bitLenInt start, bitLenInt length, bitLenInt flagIndex)
 The 6502 uses its carry flag also as a greater-than/less-than flag, for the CMP operation. More...
 
virtual void PhaseFlip ()
 Phase flip always - equivalent to Z X Z X on any bit in the QEngineCPU. More...
 
virtual void SetReg (bitLenInt start, bitLenInt length, bitCapInt value)
 Set register bits to given permutation. More...
 
virtual bitCapInt MReg (bitLenInt start, bitLenInt length)
 Measure permutation state of a register. More...
 
virtual complexGetState ()
 
virtual void CopyState (QInterfacePtr orig)
 Direct copy of raw state vector to produce a clone. More...
 
virtual double Prob (bitLenInt qubitIndex)
 PSEUDO-QUANTUM Direct measure of bit probability to be in |1> state. More...
 
virtual double ProbAll (bitCapInt fullRegister)
 PSEUDO-QUANTUM Direct measure of full register probability to be in permutation state. More...
 
virtual void SetBit (bitLenInt qubitIndex1, bool value)
 Set individual bit to pure |0> (false) or |1> (true) state. More...
 
- Public Member Functions inherited from Qrack::QInterface
 QInterface (bitLenInt n)
 
virtual ~QInterface ()
 Destructor of QInterface. More...
 
int GetQubitCount ()
 Get the count of bits in this register. More...
 
int GetMaxQPower ()
 Get the maximum number of basis states, namely $ n^2 $ for $ n $ qubits. More...
 
virtual void RTDyad (int numerator, int denomPower, bitLenInt qubitIndex)
 Dyadic fraction phase shift gate. More...
 
virtual void RXDyad (int numerator, int denomPower, bitLenInt qubitIndex)
 Dyadic fraction X axis rotation gate. More...
 
virtual void CRXDyad (int numerator, int denomPower, bitLenInt control, bitLenInt target)
 Controlled dyadic fraction X axis rotation gate. More...
 
virtual void RYDyad (int numerator, int denomPower, bitLenInt qubitIndex)
 Dyadic fraction Y axis rotation gate. More...
 
virtual void CRYDyad (int numerator, int denomPower, bitLenInt control, bitLenInt target)
 Controlled dyadic fraction y axis rotation gate. More...
 
virtual void RZDyad (int numerator, int denomPower, bitLenInt qubitIndex)
 Dyadic fraction Z axis rotation gate. More...
 
virtual void CRZDyad (int numerator, int denomPower, bitLenInt control, bitLenInt target)
 Controlled dyadic fraction Z axis rotation gate. More...
 
virtual void CRTDyad (int numerator, int denomPower, bitLenInt control, bitLenInt target)
 Controlled dyadic fraction "phase shift gate". More...
 
virtual void H (bitLenInt start, bitLenInt length)
 Bitwise Hadamard. More...
 
virtual void Y (bitLenInt start, bitLenInt length)
 Bitwise Pauli Y operator. More...
 
virtual void Z (bitLenInt start, bitLenInt length)
 Bitwise Pauli Z operator. More...
 
virtual void CLAND (bitLenInt qInputStart, bitCapInt classicalInput, bitLenInt outputStart, bitLenInt length)
 Classical bitwise "AND". More...
 
virtual void CLOR (bitLenInt qInputStart, bitCapInt classicalInput, bitLenInt outputStart, bitLenInt length)
 Classical bitwise "OR". More...
 
virtual void CLXOR (bitLenInt qInputStart, bitCapInt classicalInput, bitLenInt outputStart, bitLenInt length)
 Classical bitwise "XOR". More...
 
virtual void RT (double radians, bitLenInt start, bitLenInt length)
 Bitwise phase shift gate. More...
 
virtual void RTDyad (int numerator, int denomPower, bitLenInt start, bitLenInt length)
 Bitwise dyadic fraction phase shift gate. More...
 
virtual void RX (double radians, bitLenInt start, bitLenInt length)
 Bitwise X axis rotation gate. More...
 
virtual void RXDyad (int numerator, int denomPower, bitLenInt start, bitLenInt length)
 Bitwise dyadic fraction X axis rotation gate. More...
 
virtual void CRX (double radians, bitLenInt control, bitLenInt target, bitLenInt length)
 Bitwise controlled X axis rotation gate. More...
 
virtual void CRXDyad (int numerator, int denomPower, bitLenInt control, bitLenInt target, bitLenInt length)
 Bitwise controlled dyadic fraction X axis rotation gate. More...
 
virtual void RY (double radians, bitLenInt start, bitLenInt length)
 Bitwise Y axis rotation gate. More...
 
virtual void RYDyad (int numerator, int denomPower, bitLenInt start, bitLenInt length)
 Bitwise dyadic fraction Y axis rotation gate. More...
 
virtual void CRY (double radians, bitLenInt control, bitLenInt target, bitLenInt length)
 Bitwise controlled Y axis rotation gate. More...
 
virtual void CRYDyad (int numerator, int denomPower, bitLenInt control, bitLenInt target, bitLenInt length)
 Bitwise controlled dyadic fraction y axis rotation gate. More...
 
virtual void RZ (double radians, bitLenInt start, bitLenInt length)
 Bitwise Z axis rotation gate. More...
 
virtual void RZDyad (int numerator, int denomPower, bitLenInt start, bitLenInt length)
 Bitwise dyadic fraction Z axis rotation gate. More...
 
virtual void CRZ (double radians, bitLenInt control, bitLenInt target, bitLenInt length)
 Bitwise controlled Z axis rotation gate. More...
 
virtual void CRZDyad (int numerator, int denomPower, bitLenInt control, bitLenInt target, bitLenInt length)
 Bitwise controlled dyadic fraction Z axis rotation gate. More...
 
virtual void CRT (double radians, bitLenInt control, bitLenInt target, bitLenInt length)
 Bitwise controlled "phase shift gate". More...
 
virtual void CRTDyad (int numerator, int denomPower, bitLenInt control, bitLenInt target, bitLenInt length)
 Bitwise controlled dyadic fraction "phase shift gate". More...
 
virtual void CY (bitLenInt control, bitLenInt target, bitLenInt length)
 Bitwise controlled Y gate. More...
 
virtual void CZ (bitLenInt control, bitLenInt target, bitLenInt length)
 Bitwise controlled Z gate. More...
 
virtual void ASL (bitLenInt shift, bitLenInt start, bitLenInt length)
 Arithmetic shift left, with last 2 bits as sign and carry. More...
 
virtual void ASR (bitLenInt shift, bitLenInt start, bitLenInt length)
 Arithmetic shift right, with last 2 bits as sign and carry. More...
 
virtual void LSL (bitLenInt shift, bitLenInt start, bitLenInt length)
 Logical shift left, filling the extra bits with |0> More...
 
virtual void LSR (bitLenInt shift, bitLenInt start, bitLenInt length)
 Logical shift right, filling the extra bits with |0> More...
 
virtual void QFT (bitLenInt start, bitLenInt length)
 Quantum Fourier Transform - Apply the quantum Fourier transform to the register. More...
 
virtual void Reverse (bitLenInt first, bitLenInt last)
 Reverse all of the bits in a sequence. More...
 
- Public Member Functions inherited from Qrack::ParallelFor
 ParallelFor ()
 
virtual ~ParallelFor ()
 
void SetConcurrencyLevel (int32_t num)
 
int32_t GetConcurrencyLevel ()
 
void par_for_inc (const bitCapInt begin, const bitCapInt end, IncrementFunc, ParallelFunc fn)
 Iterate through the permutations a maximum of end-begin times, allowing the caller to control the incrementation offset through 'inc'. More...
 
void par_for (const bitCapInt begin, const bitCapInt end, ParallelFunc fn)
 Call fn once for every numerical value between begin and end. More...
 
void par_for_skip (const bitCapInt begin, const bitCapInt end, const bitCapInt skipPower, const bitLenInt skipBitCount, ParallelFunc fn)
 Skip over the skipPower bits. More...
 
void par_for_mask (const bitCapInt, const bitCapInt, const bitCapInt *maskArray, const bitLenInt maskLen, ParallelFunc fn)
 Skip over the bits listed in maskArray in the same fashion as par_for_skip. More...
 
double par_norm (const bitCapInt maxQPower, const complex *stateArray)
 Calculate the normal for the array. More...
 

Protected Member Functions

void InitOCL ()
 
void ReInitOCL ()
 
void ResetStateVec (complex *nStateVec)
 
void DispatchCall (cl::Kernel *call, bitCapInt(&bciArgs)[BCI_ARG_LEN], complex *nVec=NULL, unsigned char *values=NULL, bitCapInt valuesLength=0)
 
void Apply2x2 (bitCapInt offset1, bitCapInt offset2, const complex *mtrx, const bitLenInt bitCount, const bitCapInt *qPowersSorted, bool doCalcNorm)
 Apply a 2x2 matrix to the state vector. More...
 
void ROx (cl::Kernel *call, bitLenInt shift, bitLenInt start, bitLenInt length)
 
void INT (cl::Kernel *call, bitCapInt toAdd, const bitLenInt inOutStart, const bitLenInt length)
 Add or Subtract integer (without sign or carry) More...
 
void INTC (cl::Kernel *call, bitCapInt toAdd, const bitLenInt inOutStart, const bitLenInt length, const bitLenInt carryIndex)
 Add or Subtract integer (without sign, with carry) More...
 
bitCapInt OpIndexed (cl::Kernel *call, bitCapInt carryIn, bitLenInt indexStart, bitLenInt indexLength, bitLenInt valueStart, bitLenInt valueLength, bitLenInt carryIndex, unsigned char *values)
 Add or Subtract based on an indexed load from classical memory. More...
 
- Protected Member Functions inherited from Qrack::QEngineCPU
double Rand ()
 Generate a random double from 0 to 1. More...
 
virtual void ApplySingleBit (bitLenInt qubitIndex, const complex *mtrx, bool doCalcNorm)
 
virtual void ApplyControlled2x2 (bitLenInt control, bitLenInt target, const complex *mtrx, bool doCalcNorm)
 
virtual void ApplyAntiControlled2x2 (bitLenInt control, bitLenInt target, const complex *mtrx, bool doCalcNorm)
 
virtual void ApplyDoublyControlled2x2 (bitLenInt control1, bitLenInt control2, bitLenInt target, const complex *mtrx, bool doCalcNorm)
 
virtual void ApplyDoublyAntiControlled2x2 (bitLenInt control1, bitLenInt control2, bitLenInt target, const complex *mtrx, bool doCalcNorm)
 
virtual void NormalizeState ()
 
virtual void UpdateRunningNorm ()
 
virtual complexAllocStateVec (bitCapInt elemCount)
 
- Protected Member Functions inherited from Qrack::QInterface
virtual void SetQubitCount (bitLenInt qb)
 

Protected Attributes

OCLEngineclObj
 
cl::CommandQueue queue
 
cl::Buffer stateBuffer
 
cl::Buffer cmplxBuffer
 
cl::Buffer ulongBuffer
 
cl::Buffer nrmBuffer
 
cl::Buffer maxBuffer
 
- Protected Attributes inherited from Qrack::QEngineCPU
uint32_t randomSeed
 
double runningNorm
 
complexstateVec
 
std::shared_ptr< std::default_random_engine > rand_generator
 
std::uniform_real_distribution< double > rand_distribution
 
- Protected Attributes inherited from Qrack::QInterface
bitLenInt qubitCount
 
bitCapInt maxQPower
 

Static Protected Attributes

static const int BCI_ARG_LEN = 10
 

Additional Inherited Members

- Public Types inherited from Qrack::ParallelFor
typedef std::function< void(const bitCapInt, const int cpu)> ParallelFunc
 Called once per value between begin and end. More...
 
typedef std::function< bitCapInt(const bitCapInt, const int cpu)> IncrementFunc
 

Detailed Description

OpenCL enhanced QEngineCPU implementation.

Constructor & Destructor Documentation

Qrack::QEngineOCL::QEngineOCL ( bitLenInt  qBitCount,
bitCapInt  initState,
std::shared_ptr< std::default_random_engine >  rgp = nullptr 
)
inline

Member Function Documentation

void Qrack::QEngineOCL::Apply2x2 ( bitCapInt  offset1,
bitCapInt  offset2,
const complex mtrx,
const bitLenInt  bitCount,
const bitCapInt qPowersSorted,
bool  doCalcNorm 
)
protectedvirtual

Apply a 2x2 matrix to the state vector.

A fundamental operation used by almost all gates.

Reimplemented from Qrack::QEngineCPU.

void Qrack::QEngineOCL::DEC ( bitCapInt  toSub,
bitLenInt  start,
bitLenInt  length 
)
virtual

Subtract integer (without sign, with carry)

Reimplemented from Qrack::QEngineCPU.

void Qrack::QEngineOCL::DECC ( bitCapInt  toSub,
bitLenInt  start,
bitLenInt  length,
bitLenInt  carryIndex 
)
virtual

Subtract integer (without sign, with carry)

Reimplemented from Qrack::QEngineCPU.

void Qrack::QEngineOCL::DispatchCall ( cl::Kernel *  call,
bitCapInt(&)  bciArgs[BCI_ARG_LEN],
complex nVec = NULL,
unsigned char *  values = NULL,
bitCapInt  valuesLength = 0 
)
protected
void Qrack::QEngineOCL::INC ( bitCapInt  toAdd,
bitLenInt  start,
bitLenInt  length 
)
virtual

Increment integer (without sign, with carry)

Reimplemented from Qrack::QEngineCPU.

void Qrack::QEngineOCL::INCC ( bitCapInt  toAdd,
bitLenInt  start,
bitLenInt  length,
bitLenInt  carryIndex 
)
virtual

Increment integer (without sign, with carry)

Reimplemented from Qrack::QEngineCPU.

bitCapInt Qrack::QEngineOCL::IndexedADC ( bitLenInt  indexStart,
bitLenInt  indexLength,
bitLenInt  valueStart,
bitLenInt  valueLength,
bitLenInt  carryIndex,
unsigned char *  values 
)
virtual

Add based on an indexed load from classical memory.

Reimplemented from Qrack::QEngineCPU.

bitCapInt Qrack::QEngineOCL::IndexedLDA ( bitLenInt  indexStart,
bitLenInt  indexLength,
bitLenInt  valueStart,
bitLenInt  valueLength,
unsigned char *  values 
)
virtual

Set 8 bit register bits based on read from classical memory.

Reimplemented from Qrack::QEngineCPU.

bitCapInt Qrack::QEngineOCL::IndexedSBC ( bitLenInt  indexStart,
bitLenInt  indexLength,
bitLenInt  valueStart,
bitLenInt  valueLength,
bitLenInt  carryIndex,
unsigned char *  values 
)
virtual

Subtract based on an indexed load from classical memory.

Reimplemented from Qrack::QEngineCPU.

void Qrack::QEngineOCL::InitOCL ( )
protected
void Qrack::QEngineOCL::INT ( cl::Kernel *  call,
bitCapInt  toAdd,
const bitLenInt  inOutStart,
const bitLenInt  length 
)
protected

Add or Subtract integer (without sign or carry)

void Qrack::QEngineOCL::INTC ( cl::Kernel *  call,
bitCapInt  toAdd,
const bitLenInt  inOutStart,
const bitLenInt  length,
const bitLenInt  carryIndex 
)
protected

Add or Subtract integer (without sign, with carry)

bitCapInt Qrack::QEngineOCL::OpIndexed ( cl::Kernel *  call,
bitCapInt  carryIn,
bitLenInt  indexStart,
bitLenInt  indexLength,
bitLenInt  valueStart,
bitLenInt  valueLength,
bitLenInt  carryIndex,
unsigned char *  values 
)
protected

Add or Subtract based on an indexed load from classical memory.

void Qrack::QEngineOCL::ReInitOCL ( )
protected
void Qrack::QEngineOCL::ResetStateVec ( complex nStateVec)
protectedvirtual

Reimplemented from Qrack::QEngineCPU.

void Qrack::QEngineOCL::ROL ( bitLenInt  shift,
bitLenInt  start,
bitLenInt  length 
)
virtual

"Circular shift left" - shift bits left, and carry last bits.

Reimplemented from Qrack::QEngineCPU.

void Qrack::QEngineOCL::ROR ( bitLenInt  shift,
bitLenInt  start,
bitLenInt  length 
)
virtual

"Circular shift right" - shift bits right, and carry first bits.

Reimplemented from Qrack::QEngineCPU.

void Qrack::QEngineOCL::ROx ( cl::Kernel *  call,
bitLenInt  shift,
bitLenInt  start,
bitLenInt  length 
)
protected
void Qrack::QEngineOCL::Swap ( bitLenInt  qubitIndex1,
bitLenInt  qubitIndex2 
)
virtual

Swap values of two bits in register.

Reimplemented from Qrack::QEngineCPU.

void Qrack::QEngineOCL::Swap ( bitLenInt  start1,
bitLenInt  start2,
bitLenInt  length 
)
virtual

Bitwise swap.

Reimplemented from Qrack::QEngineCPU.

void Qrack::QEngineOCL::X ( bitLenInt  start,
bitLenInt  length 
)
virtual

Bitwise Pauli X (or logical "NOT") operator.

Reimplemented from Qrack::QEngineCPU.

Member Data Documentation

const int Qrack::QEngineOCL::BCI_ARG_LEN = 10
staticprotected
OCLEngine* Qrack::QEngineOCL::clObj
protected
cl::Buffer Qrack::QEngineOCL::cmplxBuffer
protected
cl::Buffer Qrack::QEngineOCL::maxBuffer
protected
cl::Buffer Qrack::QEngineOCL::nrmBuffer
protected
cl::CommandQueue Qrack::QEngineOCL::queue
protected
cl::Buffer Qrack::QEngineOCL::stateBuffer
protected
cl::Buffer Qrack::QEngineOCL::ulongBuffer
protected

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