Qrack  1.7
General classical-emulating-quantum development framework
Classes | Typedefs | Enumerations | Functions | Variables
Qrack Namespace Reference

Classes

union  _cmplx_union
 
struct  Complex16Simd
 SIMD implementation of the double precision complex type. More...
 
struct  Complex16x2Simd
 SIMD implementation of the double precision complex vector type of 2 complex numbers, only for AVX Apply2x2. More...
 
struct  Complex8x2Simd
 SIMD implementation of the float precision complex vector type of 2 complex numbers, only for COMPLEX_X_2 Apply2x2. More...
 
class  OCLDeviceCall
 
class  OCLDeviceContext
 
class  OCLEngine
 "Qrack::OCLEngine" manages the single OpenCL context. More...
 
class  ParallelFor
 
class  QEngineCPU
 General purpose QEngineCPU implementation. More...
 
class  QEngineOCL
 OpenCL enhanced QEngineCPU implementation. More...
 
class  QEngineOCLMulti
 OpenCL enhanced QEngineCPU implementation. More...
 
struct  QEngineShard
 Associates a QInterface object with a set of bits. More...
 
class  QInterface
 A "Qrack::QInterface" is an abstract interface exposing qubit permutation state vector with methods to operate on it as by gates and register-like instructions. More...
 
class  QUnit
 

Typedefs

typedef std::shared_ptr< OCLDeviceContextDeviceContextPtr
 
typedef std::shared_ptr< QEngineCPUQEngineCPUPtr
 
typedef std::shared_ptr< cl::Buffer > BufferPtr
 
typedef std::shared_ptr< QEngineOCLQEngineOCLPtr
 
typedef std::shared_ptr< QEngineOCLMultiQEngineOCLMultiPtr
 
typedef std::shared_ptr< QInterfaceQInterfacePtr
 
typedef std::shared_ptr< QUnitQUnitPtr
 

Enumerations

enum  OCLAPI {
  OCL_API_UNKNOWN = 0, OCL_API_APPLY2X2, OCL_API_APPLY2X2_NORM, OCL_API_COHERE,
  OCL_API_DECOHEREPROB, OCL_API_DECOHEREAMP, OCL_API_DISPOSEPROB, OCL_API_PROB,
  OCL_API_X, OCL_API_SWAP, OCL_API_ROL, OCL_API_ROR,
  OCL_API_INC, OCL_API_DEC, OCL_API_INCC, OCL_API_DECC,
  OCL_API_INCS, OCL_API_DECS, OCL_API_INCSC_1, OCL_API_DECSC_1,
  OCL_API_INCSC_2, OCL_API_DECSC_2, OCL_API_INCBCD, OCL_API_DECBCD,
  OCL_API_INCBCDC, OCL_API_DECBCDC, OCL_API_INDEXEDLDA, OCL_API_INDEXEDADC,
  OCL_API_INDEXEDSBC, OCL_API_NORMALIZE, OCL_API_UPDATENORM, OCL_API_APPLYM,
  OCL_API_PHASEFLIP, OCL_API_ZEROPHASEFLIP, OCL_API_CPHASEFLIPIFLESS, OCL_API_MUL,
  OCL_API_DIV, OCL_API_CMUL, OCL_API_CDIV
}
 
enum  QInterfaceEngine {
  QINTERFACE_CPU = 0, QINTERFACE_OPENCL, QINTERFACE_OPENCL_MULTI, QINTERFACE_QUNIT,
  QINTERFACE_FIRST = QINTERFACE_CPU, QINTERFACE_OPTIMAL = QINTERFACE_CPU, QINTERFACE_MAX
}
 Enumerated list of supported engines. More...
 

Functions

Complex16Simd operator* (const double &lhs, const Complex16Simd &rhs)
 
Complex16Simd operator/ (const double &lhs, const Complex16Simd &rhs)
 
double real (const Complex16Simd &cmplx)
 
double imag (const Complex16Simd &cmplx)
 
double arg (const Complex16Simd &cmplx)
 
Complex16Simd conj (const Complex16Simd &cmplx)
 
double norm (const Complex16Simd &cmplx)
 
double abs (const Complex16Simd &cmplx)
 
Complex16Simd polar (const double rho, const double theta=0)
 
Complex16x2Simd dupeLo (const Complex16x2Simd &cmplx2)
 
Complex16x2Simd dupeHi (const Complex16x2Simd &cmplx2)
 
Complex16x2Simd matrixMul (const Complex16x2Simd &mtrxCol1, const Complex16x2Simd &mtrxCol2, const Complex16x2Simd &qubit)
 
Complex16x2Simd matrixMul (const double &nrm, const Complex16x2Simd &mtrxCol1, const Complex16x2Simd &mtrxCol2, const Complex16x2Simd &qubit)
 
Complex16x2Simd operator* (const double lhs, const Complex16x2Simd &rhs)
 
Complex8x2Simd dupeLo (const Complex8x2Simd &cmplx2)
 
Complex8x2Simd dupeHi (const Complex8x2Simd &cmplx2)
 
Complex8x2Simd matrixMul (const Complex8x2Simd &mtrxCol1, const Complex8x2Simd &mtrxCol2, const Complex8x2Simd &qubit)
 
Complex8x2Simd matrixMul (const float &nrm, const Complex8x2Simd &mtrxCol1, const Complex8x2Simd &mtrxCol2, const Complex8x2Simd &qubit)
 
Complex8x2Simd operator* (const float lhs, const Complex8x2Simd &rhs)
 
float norm (const Complex8x2Simd &c)
 
template<class BidirectionalIterator >
void reverse (BidirectionalIterator first, BidirectionalIterator last, bitCapInt stride)
 
template<class BidirectionalIterator >
void rotate (BidirectionalIterator first, BidirectionalIterator middle, BidirectionalIterator last, bitCapInt stride)
 
template<typename... Ts>
QInterfacePtr CreateQuantumInterface (QInterfaceEngine engine, QInterfaceEngine subengine, Ts...args)
 Factory method to create specific engine implementations. More...
 
template void rotate< complex * > (complex *first, complex *middle, complex *last, bitCapInt stride)
 

Variables

static const __m128 SIGNMASK = _mm_castsi128_ps(_mm_set_epi32(0, 0x80000000, 0, 0x80000000))
 

Typedef Documentation

typedef std::shared_ptr<cl::Buffer> Qrack::BufferPtr
typedef std::shared_ptr<OCLDeviceContext> Qrack::DeviceContextPtr
typedef std::shared_ptr<QEngineCPU> Qrack::QEngineCPUPtr
typedef std::shared_ptr<QEngineOCLMulti> Qrack::QEngineOCLMultiPtr
typedef std::shared_ptr<QEngineOCL> Qrack::QEngineOCLPtr
typedef std::shared_ptr<QInterface> Qrack::QInterfacePtr
typedef std::shared_ptr<QUnit> Qrack::QUnitPtr

Enumeration Type Documentation

Enumerator
OCL_API_UNKNOWN 
OCL_API_APPLY2X2 
OCL_API_APPLY2X2_NORM 
OCL_API_COHERE 
OCL_API_DECOHEREPROB 
OCL_API_DECOHEREAMP 
OCL_API_DISPOSEPROB 
OCL_API_PROB 
OCL_API_X 
OCL_API_SWAP 
OCL_API_ROL 
OCL_API_ROR 
OCL_API_INC 
OCL_API_DEC 
OCL_API_INCC 
OCL_API_DECC 
OCL_API_INCS 
OCL_API_DECS 
OCL_API_INCSC_1 
OCL_API_DECSC_1 
OCL_API_INCSC_2 
OCL_API_DECSC_2 
OCL_API_INCBCD 
OCL_API_DECBCD 
OCL_API_INCBCDC 
OCL_API_DECBCDC 
OCL_API_INDEXEDLDA 
OCL_API_INDEXEDADC 
OCL_API_INDEXEDSBC 
OCL_API_NORMALIZE 
OCL_API_UPDATENORM 
OCL_API_APPLYM 
OCL_API_PHASEFLIP 
OCL_API_ZEROPHASEFLIP 
OCL_API_CPHASEFLIPIFLESS 
OCL_API_MUL 
OCL_API_DIV 
OCL_API_CMUL 
OCL_API_CDIV 

Enumerated list of supported engines.

Use QINTERFACE_OPTIMAL for the best supported engine.

Enumerator
QINTERFACE_CPU 

Create a QEngineCPU leveraging only local CPU and memory resources.

QINTERFACE_OPENCL 

Create a QEngineOCL, derived from QEngineCPU, leveraging OpenCL hardware to increase the speed of certain calculations.

QINTERFACE_OPENCL_MULTI 

Create a QEngineOCLMUlti, composed from multiple QEngineOCLs, using OpenCL in parallel across 2^N devices, for N an integer >= 0.

QINTERFACE_QUNIT 

Create a QUnit, which utilizes other QInterface classes to minimize the amount of work that's needed for any given operation based on the entanglement of the bits involved.

This, combined with QINTERFACE_OPTIMAL, is the recommended object to use as a library consumer.

QINTERFACE_FIRST 
QINTERFACE_OPTIMAL 
QINTERFACE_MAX 

Function Documentation

double Qrack::abs ( const Complex16Simd cmplx)
inline
double Qrack::arg ( const Complex16Simd cmplx)
inline
Complex16Simd Qrack::conj ( const Complex16Simd cmplx)
inline
template<typename... Ts>
QInterfacePtr Qrack::CreateQuantumInterface ( QInterfaceEngine  engine,
QInterfaceEngine  subengine,
Ts...  args 
)

Factory method to create specific engine implementations.

Complex16x2Simd Qrack::dupeHi ( const Complex16x2Simd cmplx2)
inline
Complex8x2Simd Qrack::dupeHi ( const Complex8x2Simd cmplx2)
inline
Complex16x2Simd Qrack::dupeLo ( const Complex16x2Simd cmplx2)
inline
Complex8x2Simd Qrack::dupeLo ( const Complex8x2Simd cmplx2)
inline
double Qrack::imag ( const Complex16Simd cmplx)
inline
Complex16x2Simd Qrack::matrixMul ( const Complex16x2Simd mtrxCol1,
const Complex16x2Simd mtrxCol2,
const Complex16x2Simd qubit 
)
inline
Complex8x2Simd Qrack::matrixMul ( const Complex8x2Simd mtrxCol1,
const Complex8x2Simd mtrxCol2,
const Complex8x2Simd qubit 
)
inline
Complex16x2Simd Qrack::matrixMul ( const double &  nrm,
const Complex16x2Simd mtrxCol1,
const Complex16x2Simd mtrxCol2,
const Complex16x2Simd qubit 
)
inline
Complex8x2Simd Qrack::matrixMul ( const float &  nrm,
const Complex8x2Simd mtrxCol1,
const Complex8x2Simd mtrxCol2,
const Complex8x2Simd qubit 
)
inline
float Qrack::norm ( const Complex8x2Simd c)
inline
double Qrack::norm ( const Complex16Simd cmplx)
inline
Complex16x2Simd Qrack::operator* ( const double  lhs,
const Complex16x2Simd rhs 
)
inline
Complex8x2Simd Qrack::operator* ( const float  lhs,
const Complex8x2Simd rhs 
)
inline
Complex16Simd Qrack::operator* ( const double &  lhs,
const Complex16Simd rhs 
)
inline
Complex16Simd Qrack::operator/ ( const double &  lhs,
const Complex16Simd rhs 
)
inline
Complex16Simd Qrack::polar ( const double  rho,
const double  theta = 0 
)
inline
double Qrack::real ( const Complex16Simd cmplx)
inline
template<class BidirectionalIterator >
void Qrack::reverse ( BidirectionalIterator  first,
BidirectionalIterator  last,
bitCapInt  stride 
)
template<class BidirectionalIterator >
void Qrack::rotate ( BidirectionalIterator  first,
BidirectionalIterator  middle,
BidirectionalIterator  last,
bitCapInt  stride 
)
template void Qrack::rotate< complex * > ( complex first,
complex middle,
complex last,
bitCapInt  stride 
)

Variable Documentation

const __m128 Qrack::SIGNMASK = _mm_castsi128_ps(_mm_set_epi32(0, 0x80000000, 0, 0x80000000))
static