Qrack  9.0
General classical-emulating-quantum development framework
Namespaces | Macros | Functions
functions.cpp File Reference
#include "qrack_functions.hpp"
#include <algorithm>
Include dependency graph for functions.cpp:

Namespaces

 Qrack
 

Macros

#define _INTPOW(type, fn)
 

Functions

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::_expLog2x2 (complex const *matrix2x2, complex *outMatrix2x2, bool isExp)
 
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 (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 std::vector< bitCapInt > &skipPowers)
 

Macro Definition Documentation

◆ _INTPOW

#define _INTPOW (   type,
  fn 
)
Value:
type fn(type base, type power) \
{ \
if (power == 0U) { \
return ONE_BCI; \
} \
if (power == ONE_BCI) { \
return base; \
} \
\
type tmp = fn(base, power >> 1U); \
if (power & 1U) { \
return base * tmp * tmp; \
} \
\
return tmp * tmp; \
}
constexpr uint8_t ONE_BCI
Definition: qrack_types.hpp:90
MICROSOFT_QUANTUM_DECL void U(_In_ uintq sid, _In_ uintq q, _In_ double theta, _In_ double phi, _In_ double lambda)
(External API) 3-parameter unitary gate
Definition: pinvoke_api.cpp:1362