Qrack  7.0
General classical-emulating-quantum development framework
Classes | Namespaces | Macros | Typedefs | Functions
qrack_types.hpp File Reference
#include "config.h"
#include <cfloat>
#include <cmath>
#include <complex>
#include <functional>
#include <memory>
#include <random>
#include "half.hpp"
Include dependency graph for qrack_types.hpp:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

class  Qrack::StateVector
 

Namespaces

 Qrack
 

Macros

#define _USE_MATH_DEFINES
 
#define ONE_BCI   ((uint8_t)1U)
 
#define bitCapIntOcl   uint8_t
 
#define bitLenInt   uint8_t
 
#define bitsInCap   32
 
#define bitCapInt   uint32_t
 
#define bitsInByte   8
 
#define qrack_rand_gen   std::mt19937_64
 
#define qrack_rand_gen_ptr   std::shared_ptr<qrack_rand_gen>
 
#define QRACK_ALIGN_SIZE   64
 
#define ZERO_R1   ((real1)0.0f)
 
#define ONE_R1   ((real1)1.0f)
 
#define PI_R1   ((real1)M_PI)
 
#define SQRT2_R1   ((real1)M_SQRT2)
 
#define SQRT1_2_R1   ((real1)M_SQRT1_2)
 
#define REAL1_DEFAULT_ARG   ((real1)-999.0f)
 
#define REAL1_EPSILON   ((real1)2e-17f)
 
#define FP_NORM_EPSILON   ((real1)0.0009765625f)
 
#define ONE_CMPLX   complex(ONE_R1, ZERO_R1)
 
#define ZERO_CMPLX   complex(ZERO_R1, ZERO_R1)
 
#define I_CMPLX   complex(ZERO_R1, ONE_R1)
 
#define CMPLX_DEFAULT_ARG   complex(REAL1_DEFAULT_ARG, REAL1_DEFAULT_ARG)
 
#define TRYDECOMPOSE_EPSILON   (8 * FP_NORM_EPSILON)
 

Typedefs

typedef std::complex< half_float::halfQrack::complex
 
typedef half_float::half Qrack::real1
 
typedef float Qrack::real1_f
 
typedef std::shared_ptr< complex > Qrack::BitOp
 
typedef std::function< void(const bitCapIntOcl &, const unsigned &cpu)> Qrack::ParallelFunc
 Called once per value between begin and end. More...
 
typedef std::function< bitCapIntOcl(const bitCapIntOcl &, const unsigned &cpu)> Qrack::IncrementFunc
 
typedef std::function< bitCapInt(const bitCapInt &, const unsigned &cpu)> Qrack::BdtFunc
 
typedef std::shared_ptr< StateVector > Qrack::StateVectorPtr
 
typedef std::shared_ptr< StateVectorArray > Qrack::StateVectorArrayPtr
 
typedef std::shared_ptr< StateVectorSparse > Qrack::StateVectorSparsePtr
 
typedef std::shared_ptr< QEngine > Qrack::QEnginePtr
 

Functions

bitCapInt Qrack::pow2 (const bitLenInt &p)
 
bitCapIntOcl Qrack::pow2Ocl (const bitLenInt &p)
 
bitCapInt Qrack::pow2Mask (const bitLenInt &p)
 
bitCapIntOcl Qrack::pow2MaskOcl (const bitLenInt &p)
 
bitLenInt Qrack::log2 (bitCapInt n)
 
bitCapInt Qrack::bitSlice (const bitLenInt &bit, const bitCapInt &source)
 
bitCapIntOcl Qrack::bitSliceOcl (const bitLenInt &bit, const bitCapIntOcl &source)
 
bitCapInt Qrack::bitRegMask (const bitLenInt &start, const bitLenInt &length)
 
bitCapIntOcl Qrack::bitRegMaskOcl (const bitLenInt &start, const bitLenInt &length)
 
bool Qrack::isPowerOfTwo (const bitCapInt &x)
 
unsigned char * Qrack::cl_alloc (size_t ucharCount)
 
void Qrack::cl_free (void *toFree)
 
void Qrack::mul2x2 (const complex *left, const complex *right, complex *out)
 
void Qrack::exp2x2 (const complex *matrix2x2, complex *outMatrix2x2)
 
void Qrack::log2x2 (const complex *matrix2x2, complex *outMatrix2x2)
 
void Qrack::inv2x2 (const complex *matrix2x2, complex *outMatrix2x2)
 
bool Qrack::isOverflowAdd (bitCapInt inOutInt, bitCapInt inInt, const bitCapInt &signMask, const bitCapInt &lengthPower)
 Check if an addition with overflow sets the flag. More...
 
bool Qrack::isOverflowSub (bitCapInt inOutInt, bitCapInt inInt, const bitCapInt &signMask, const bitCapInt &lengthPower)
 Check if a subtraction with overflow sets the flag. More...
 
bitCapInt Qrack::pushApartBits (const bitCapInt &perm, const bitCapInt *skipPowers, const bitLenInt skipPowersCount)
 
bitCapInt Qrack::intPow (bitCapInt base, bitCapInt power)
 
bitCapIntOcl Qrack::intPowOcl (bitCapIntOcl base, bitCapIntOcl power)
 

Macro Definition Documentation

◆ _USE_MATH_DEFINES

#define _USE_MATH_DEFINES

◆ bitCapInt

#define bitCapInt   uint32_t

◆ bitCapIntOcl

#define bitCapIntOcl   uint8_t

◆ bitLenInt

#define bitLenInt   uint8_t

◆ bitsInByte

#define bitsInByte   8

◆ bitsInCap

#define bitsInCap   32

◆ CMPLX_DEFAULT_ARG

#define CMPLX_DEFAULT_ARG   complex(REAL1_DEFAULT_ARG, REAL1_DEFAULT_ARG)

◆ FP_NORM_EPSILON

#define FP_NORM_EPSILON   ((real1)0.0009765625f)

◆ I_CMPLX

#define I_CMPLX   complex(ZERO_R1, ONE_R1)

◆ ONE_BCI

#define ONE_BCI   ((uint8_t)1U)

◆ ONE_CMPLX

#define ONE_CMPLX   complex(ONE_R1, ZERO_R1)

◆ ONE_R1

#define ONE_R1   ((real1)1.0f)

◆ PI_R1

#define PI_R1   ((real1)M_PI)

◆ QRACK_ALIGN_SIZE

#define QRACK_ALIGN_SIZE   64

◆ qrack_rand_gen

#define qrack_rand_gen   std::mt19937_64

◆ qrack_rand_gen_ptr

#define qrack_rand_gen_ptr   std::shared_ptr<qrack_rand_gen>

◆ REAL1_DEFAULT_ARG

#define REAL1_DEFAULT_ARG   ((real1)-999.0f)

◆ REAL1_EPSILON

#define REAL1_EPSILON   ((real1)2e-17f)

◆ SQRT1_2_R1

#define SQRT1_2_R1   ((real1)M_SQRT1_2)

◆ SQRT2_R1

#define SQRT2_R1   ((real1)M_SQRT2)

◆ TRYDECOMPOSE_EPSILON

#define TRYDECOMPOSE_EPSILON   (8 * FP_NORM_EPSILON)

◆ ZERO_CMPLX

#define ZERO_CMPLX   complex(ZERO_R1, ZERO_R1)

◆ ZERO_R1

#define ZERO_R1   ((real1)0.0f)