Qrack  9.9
General classical-emulating-quantum development framework
Namespaces | Macros | Functions | Variables
qrack_functions.hpp File Reference
#include "qrack_types.hpp"
#include <set>
#include <vector>
Include dependency graph for qrack_functions.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 _bi_div_mod(left, right, quotient, rmndr)
 
#define _bi_compare(left, right)
 

Functions

void bi_not_ip (bitCapInt *left)
 
void bi_and_ip (bitCapInt *left, const bitCapInt &right)
 
void bi_or_ip (bitCapInt *left, const bitCapInt &right)
 
void bi_xor_ip (bitCapInt *left, const bitCapInt &right)
 
double bi_to_double (const bitCapInt &in)
 
void bi_increment (bitCapInt *pBigInt, const bitCapInt &value)
 
void bi_decrement (bitCapInt *pBigInt, const bitCapInt &value)
 
void bi_lshift_ip (bitCapInt *left, const bitCapInt &right)
 
void bi_rshift_ip (bitCapInt *left, const bitCapInt &right)
 
int bi_and_1 (const bitCapInt &left)
 
int bi_compare (const bitCapInt &left, const bitCapInt &right)
 
int bi_compare_0 (const bitCapInt &left)
 
int bi_compare_1 (const bitCapInt &left)
 
void bi_add_ip (bitCapInt *left, const bitCapInt &right)
 
void bi_sub_ip (bitCapInt *left, const bitCapInt &right)
 
void bi_div_mod (const bitCapInt &left, const bitCapInt &right, bitCapInt *quotient, bitCapInt *rmndr)
 
void bi_div_mod_small (const bitCapInt &left, uint32_t right, bitCapInt *quotient, uint32_t *rmndr)
 
bitLenInt Qrack::log2Ocl (bitCapIntOcl n)
 
int Qrack::bi_log2 (const bitCapInt &n)
 
bitLenInt Qrack::log2 (bitCapInt n)
 
bitCapInt Qrack::pow2 (const bitLenInt &p)
 
bitCapIntOcl Qrack::pow2Ocl (const bitLenInt &p)
 
bitCapInt Qrack::pow2Mask (const bitLenInt &p)
 
bitCapIntOcl Qrack::pow2MaskOcl (const bitLenInt &p)
 
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)
 
bool Qrack::isPowerOfTwoOcl (const bitCapIntOcl &x)
 
bool Qrack::isBadBitRange (const bitLenInt &start, const bitLenInt &length, const bitLenInt &qubitCount)
 
bool Qrack::isBadPermRange (const bitCapIntOcl &start, const bitCapIntOcl &length, const bitCapIntOcl &maxQPowerOcl)
 
void Qrack::ThrowIfQbIdArrayIsBad (const std::vector< bitLenInt > &controls, const bitLenInt &qubitCount, std::string message)
 
unsigned char * Qrack::cl_alloc (size_t ucharCount)
 
void Qrack::cl_free (void *toFree)
 
void Qrack::mul2x2 (complex const *left, complex const *right, complex *out)
 
void Qrack::exp2x2 (complex const *matrix2x2, complex *outMatrix2x2)
 
void Qrack::log2x2 (complex const *matrix2x2, complex *outMatrix2x2)
 
void Qrack::inv2x2 (complex const *matrix2x2, complex *outMatrix2x2)
 
bool Qrack::isOverflowAdd (bitCapIntOcl inOutInt, bitCapIntOcl inInt, const bitCapIntOcl &signMask, const bitCapIntOcl &lengthPower)
 Check if an addition with overflow sets the flag. More...
 
bool Qrack::isOverflowSub (bitCapIntOcl inOutInt, bitCapIntOcl inInt, const bitCapIntOcl &signMask, const bitCapIntOcl &lengthPower)
 Check if a subtraction with overflow sets the flag. More...
 
bitCapInt Qrack::pushApartBits (const bitCapInt &perm, const std::vector< bitCapInt > &skipPowers)
 
bitCapInt Qrack::intPow (const bitCapInt &base, const bitCapInt &power)
 
bitCapIntOcl Qrack::intPowOcl (bitCapIntOcl base, bitCapIntOcl power)
 

Variables

const real1_f Qrack::_qrack_qunit_sep_thresh = FP_NORM_EPSILON
 
const real1_f Qrack::_qrack_qbdt_sep_thresh = FP_NORM_EPSILON
 
const bitLenInt Qrack::QRACK_MAX_CPU_QB_DEFAULT = -1
 
const bitLenInt Qrack::QRACK_MAX_PAGE_QB_DEFAULT = QRACK_MAX_CPU_QB_DEFAULT
 
const bitLenInt Qrack::QRACK_MAX_PAGING_QB_DEFAULT = QRACK_MAX_CPU_QB_DEFAULT
 
const bitLenInt Qrack::QRACK_QRACK_QTENSORNETWORK_THRESHOLD_CPU_QB = 32U
 
const bitLenInt Qrack::PSTRIDEPOW_DEFAULT = PSTRIDEPOW
 

Macro Definition Documentation

◆ _bi_compare

#define _bi_compare (   left,
  right 
)
Value:
if (left > right) { \
return 1; \
} \
if (left < right) { \
return -1; \
} \
\
return 0;

◆ _bi_div_mod

#define _bi_div_mod (   left,
  right,
  quotient,
  rmndr 
)
Value:
if (quotient) { \
*quotient = left / right; \
} \
if (rmndr) { \
*rmndr = left % right; \
}

Function Documentation

◆ bi_add_ip()

void bi_add_ip ( bitCapInt left,
const bitCapInt right 
)
inline

◆ bi_and_1()

int bi_and_1 ( const bitCapInt left)
inline

◆ bi_and_ip()

void bi_and_ip ( bitCapInt left,
const bitCapInt right 
)
inline

◆ bi_compare()

int bi_compare ( const bitCapInt left,
const bitCapInt right 
)
inline

◆ bi_compare_0()

int bi_compare_0 ( const bitCapInt left)
inline

◆ bi_compare_1()

int bi_compare_1 ( const bitCapInt left)
inline

◆ bi_decrement()

void bi_decrement ( bitCapInt pBigInt,
const bitCapInt value 
)
inline

◆ bi_div_mod()

void bi_div_mod ( const bitCapInt left,
const bitCapInt right,
bitCapInt quotient,
bitCapInt rmndr 
)
inline

◆ bi_div_mod_small()

void bi_div_mod_small ( const bitCapInt left,
uint32_t  right,
bitCapInt quotient,
uint32_t *  rmndr 
)
inline

◆ bi_increment()

void bi_increment ( bitCapInt pBigInt,
const bitCapInt value 
)
inline

◆ bi_lshift_ip()

void bi_lshift_ip ( bitCapInt left,
const bitCapInt right 
)
inline

◆ bi_not_ip()

void bi_not_ip ( bitCapInt left)
inline

◆ bi_or_ip()

void bi_or_ip ( bitCapInt left,
const bitCapInt right 
)
inline

◆ bi_rshift_ip()

void bi_rshift_ip ( bitCapInt left,
const bitCapInt right 
)
inline

◆ bi_sub_ip()

void bi_sub_ip ( bitCapInt left,
const bitCapInt right 
)
inline

◆ bi_to_double()

double bi_to_double ( const bitCapInt in)
inline

◆ bi_xor_ip()

void bi_xor_ip ( bitCapInt left,
const bitCapInt right 
)
inline