Qrack  9.13
General classical-emulating-quantum development framework
Namespaces | Macros | Typedefs | Variables
qrack_types.hpp File Reference
#include "config.h"
#include <complex>
#include <functional>
#include <limits>
#include <math.h>
#include <memory>
#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.

Namespaces

 Qrack
 GLOSSARY: bitLenInt - "bit-length integer" - unsigned integer ID of qubit position in register bitCapInt - "bit-capacity integer" - unsigned integer single-permutation value of a qubit register (typically "big integer") real1 - "real number (1-dimensional)" - floating-point real-valued number complex - "complex number" - floating-point complex-valued number (with two real1 component dimensions) quid - "quantum (simulator) unique identifier" - unsigned integer that indexes and IDs running simulators, circuits, and neurons.
 

Macros

#define _USE_MATH_DEFINES
 
#define IS_NORM_0(c)   (norm(c) <= FP_NORM_EPSILON)
 
#define IS_SAME(c1, c2)   (IS_NORM_0((c1) - (c2)))
 
#define IS_OPPOSITE(c1, c2)   (IS_NORM_0((c1) + (c2)))
 
#define bitLenInt   uint8_t
 
#define bitCapIntOcl   uint8_t
 
#define bitCapInt   uint32_t
 
#define QRACK_MAX_QUBITS   32
 
#define bitsInByte   8U
 
#define qrack_rand_gen   std::mt19937_64
 
#define qrack_rand_gen_ptr   std::shared_ptr<qrack_rand_gen>
 
#define QRACK_ALIGN_SIZE   64U
 
#define ZERO_R1_F   0.0f
 
#define QUARTER_R1_F   0.25f
 
#define HALF_R1_F   0.5f
 
#define ONE_R1_F   1.0f
 
#define QRACK_CONST   const
 
#define REAL1_DEFAULT_ARG   -999.0f
 

Typedefs

typedef half_float::half Qrack::real1
 
typedef float Qrack::real1_f
 
typedef float Qrack::real1_s
 
typedef std::complex< real1 > Qrack::complex
 
typedef std::shared_ptr< complex > Qrack::BitOp
 
typedef std::function< void(const bitCapIntOcl &, const unsigned &cpu)> Qrack::ParallelFunc
 
typedef std::function< bitCapIntOcl(const bitCapIntOcl &)> Qrack::IncrementFunc
 
typedef std::function< bitCapInt(const bitCapInt &)> Qrack::BdtFunc
 
typedef std::function< void(const bitCapInt &, const unsigned &cpu)> Qrack::ParallelFuncBdt
 
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
 

Variables

const bitCapInt Qrack::ONE_BCI = 1U
 
const bitCapInt Qrack::ZERO_BCI = 0U
 
constexpr bitLenInt Qrack::bitsInCap = ((bitLenInt)1U) << ((bitLenInt)QBCAPPOW)
 
QRACK_CONST real1 Qrack::PI_R1 = (real1)M_PI
 
QRACK_CONST real1 Qrack::SQRT2_R1 = (real1)M_SQRT2
 
QRACK_CONST real1 Qrack::SQRT1_2_R1 = (real1)M_SQRT1_2
 
QRACK_CONST real1 Qrack::ZERO_R1 = (real1)0.0f
 
QRACK_CONST real1 Qrack::HALF_R1 = (real1)0.5f
 
QRACK_CONST real1 Qrack::ONE_R1 = (real1)1.0f
 
QRACK_CONST real1 Qrack::REAL1_EPSILON = (real1)0.000000477f
 
QRACK_CONST complex Qrack::ONE_CMPLX = complex(ONE_R1, ZERO_R1)
 
QRACK_CONST complex Qrack::ZERO_CMPLX = complex(ZERO_R1, ZERO_R1)
 
QRACK_CONST complex Qrack::I_CMPLX = complex(ZERO_R1, ONE_R1)
 
QRACK_CONST complex Qrack::HALF_I_HALF_CMPLX = complex(HALF_R1, HALF_R1)
 
QRACK_CONST complex Qrack::HALF_NEG_I_HALF_CMPLX = complex(HALF_R1, -HALF_R1)
 
QRACK_CONST complex Qrack::CMPLX_DEFAULT_ARG = complex((real1)REAL1_DEFAULT_ARG, (real1)REAL1_DEFAULT_ARG)
 
QRACK_CONST real1 Qrack::FP_NORM_EPSILON = (real1)(std::numeric_limits<real1>::epsilon() / 4)
 
QRACK_CONST real1_f Qrack::FP_NORM_EPSILON_F = (real1_f)FP_NORM_EPSILON
 
QRACK_CONST real1_f Qrack::TRYDECOMPOSE_EPSILON = 32 * FP_NORM_EPSILON_F
 
const double Qrack::FIDELITY_MIN = log((double)FP_NORM_EPSILON)
 

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   8U

◆ HALF_R1_F

#define HALF_R1_F   0.5f

◆ IS_NORM_0

#define IS_NORM_0 (   c)    (norm(c) <= FP_NORM_EPSILON)

◆ IS_OPPOSITE

#define IS_OPPOSITE (   c1,
  c2 
)    (IS_NORM_0((c1) + (c2)))

◆ IS_SAME

#define IS_SAME (   c1,
  c2 
)    (IS_NORM_0((c1) - (c2)))

◆ ONE_R1_F

#define ONE_R1_F   1.0f

◆ QRACK_ALIGN_SIZE

#define QRACK_ALIGN_SIZE   64U

◆ QRACK_CONST

#define QRACK_CONST   const

◆ QRACK_MAX_QUBITS

#define QRACK_MAX_QUBITS   32

◆ 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>

◆ QUARTER_R1_F

#define QUARTER_R1_F   0.25f

◆ REAL1_DEFAULT_ARG

#define REAL1_DEFAULT_ARG   -999.0f

◆ ZERO_R1_F

#define ZERO_R1_F   0.0f