Qrack  7.0
General classical-emulating-quantum development framework
Classes | Macros | Functions | Variables
pinvoke_api.cpp File Reference
#include "pinvoke_api.hpp"
#include "qfactory.hpp"
#include <map>
#include <mutex>
#include <vector>
Include dependency graph for pinvoke_api.cpp:

Classes

struct  MapArithmeticResult2
 

Macros

#define META_LOCK_GUARD()
 
#define SIMULATOR_LOCK_GUARD(sid)
 
#define SIMULATOR_LOCK_GUARD_DOUBLE(sid)
 
#define SIMULATOR_LOCK_GUARD_BOOL(sid)
 
#define SIMULATOR_LOCK_GUARD_INT(sid)
 
#define QALU(qReg)   std::dynamic_pointer_cast<QAlu>(qReg)
 
#define QPARITY(qReg)   std::dynamic_pointer_cast<QParity>(qReg)
 
#define MAP_CONTROLS_AND_LOCK(sid, numC)
 

Functions

bitLenInt MaxShardQubits ()
 
void TransformPauliBasis (QInterfacePtr simulator, unsigned len, int *bases, unsigned *qubitIds)
 
void RevertPauliBasis (QInterfacePtr simulator, unsigned len, int *bases, unsigned *qubitIds)
 
void removeIdentities (std::vector< int > *b, std::vector< bitLenInt > *qs)
 
void RHelper (unsigned sid, unsigned b, double phi, unsigned q)
 
void MCRHelper (unsigned sid, unsigned b, double phi, unsigned n, unsigned *c, unsigned q)
 
std::size_t make_mask (std::vector< bitLenInt > const &qs)
 
std::map< unsigned, bitLenInt >::iterator FindShardValue (bitLenInt v, std::map< unsigned, bitLenInt > &simMap)
 
void SwapShardValues (bitLenInt v1, bitLenInt v2, std::map< unsigned, bitLenInt > &simMap)
 
unsigned MapArithmetic (QInterfacePtr simulator, unsigned n, unsigned *q)
 
MapArithmeticResult2 MapArithmetic2 (QInterfacePtr simulator, unsigned n, unsigned *q1, unsigned *q2)
 
MapArithmeticResult2 MapArithmetic3 (QInterfacePtr simulator, unsigned n1, unsigned *q1, unsigned n2, unsigned *q2)
 
void _darray_to_creal1_array (double *params, bitCapIntOcl componentCount, complex *amps)
 
MICROSOFT_QUANTUM_DECL int get_error (_In_ unsigned sid)
 (External API) Poll after each operation to check whether error occurred. More...
 
MICROSOFT_QUANTUM_DECL unsigned init_count_type (_In_ unsigned q, _In_ bool md, _In_ bool sd, _In_ bool sh, _In_ bool bdt, _In_ bool pg, _In_ bool zxf, _In_ bool hy, _In_ bool oc, _In_ bool hp)
 (External API) Initialize a simulator ID with "q" qubits and explicit layer options on/off More...
 
MICROSOFT_QUANTUM_DECL unsigned init_count (_In_ unsigned q, _In_ bool hp)
 (External API) Initialize a simulator ID with "q" qubits and implicit default layer options. More...
 
MICROSOFT_QUANTUM_DECL unsigned init_count_pager (_In_ unsigned q, _In_ bool hp)
 (External API) Initialize a simulator ID with "q" qubits and implicit default layer options. More...
 
MICROSOFT_QUANTUM_DECL unsigned init_clone (_In_ unsigned sid)
 (External API) Initialize a simulator ID that clones simulator ID "sid" More...
 
MICROSOFT_QUANTUM_DECL unsigned init_qbdt_stabilizer (_In_ unsigned q, _In_ unsigned c, _In_ bool sd)
 
MICROSOFT_QUANTUM_DECL void destroy (_In_ unsigned sid)
 (External API) Destroy a simulator (ID will not be reused) More...
 
MICROSOFT_QUANTUM_DECL void seed (_In_ unsigned sid, _In_ unsigned s)
 (External API) Set RNG seed for simulator ID More...
 
MICROSOFT_QUANTUM_DECL void set_concurrency (_In_ unsigned sid, _In_ unsigned p)
 (External API) Set concurrency level per QEngine shard More...
 
MICROSOFT_QUANTUM_DECL void DumpIds (_In_ unsigned sid, _In_ IdCallback callback)
 (External API) "Dump" all IDs from the selected simulator ID into the callback More...
 
MICROSOFT_QUANTUM_DECL void Dump (_In_ unsigned sid, _In_ ProbAmpCallback callback)
 (External API) "Dump" all IDs from the selected simulator ID into the callback More...
 
MICROSOFT_QUANTUM_DECL std::size_t random_choice (_In_ unsigned sid, _In_ std::size_t n, _In_reads_(n) double *p)
 (External API) Select from a distribution of "n" elements according the discrete probabilities in "d." More...
 
MICROSOFT_QUANTUM_DECL void PhaseParity (_In_ unsigned sid, _In_ double lambda, _In_ unsigned n, _In_reads_(n) unsigned *q)
 
double _JointEnsembleProbabilityHelper (QInterfacePtr simulator, unsigned n, int *b, unsigned *q, bool doMeasure)
 
MICROSOFT_QUANTUM_DECL double JointEnsembleProbability (_In_ unsigned sid, _In_ unsigned n, _In_reads_(n) int *b, _In_reads_(n) unsigned *q)
 (External API) Find the joint probability for all specified qubits under the respective Pauli basis transformations. More...
 
MICROSOFT_QUANTUM_DECL void ResetAll (_In_ unsigned sid)
 (External API) Set the simulator to a computational basis permutation. More...
 
MICROSOFT_QUANTUM_DECL void allocateQubit (_In_ unsigned sid, _In_ unsigned qid)
 (External API) Allocate 1 new qubit with the given qubit ID, under the simulator ID More...
 
MICROSOFT_QUANTUM_DECL bool release (_In_ unsigned sid, _In_ unsigned q)
 (External API) Release 1 qubit with the given qubit ID, under the simulator ID More...
 
MICROSOFT_QUANTUM_DECL unsigned num_qubits (_In_ unsigned sid)
 
MICROSOFT_QUANTUM_DECL void X (_In_ unsigned sid, _In_ unsigned q)
 (External API) "X" Gate More...
 
MICROSOFT_QUANTUM_DECL void Y (_In_ unsigned sid, _In_ unsigned q)
 (External API) "Y" Gate More...
 
MICROSOFT_QUANTUM_DECL void Z (_In_ unsigned sid, _In_ unsigned q)
 (External API) "Z" Gate More...
 
MICROSOFT_QUANTUM_DECL void H (_In_ unsigned sid, _In_ unsigned q)
 (External API) Walsh-Hadamard transform applied for simulator ID and qubit ID More...
 
MICROSOFT_QUANTUM_DECL void S (_In_ unsigned sid, _In_ unsigned q)
 (External API) "S" Gate More...
 
MICROSOFT_QUANTUM_DECL void T (_In_ unsigned sid, _In_ unsigned q)
 (External API) "T" Gate More...
 
MICROSOFT_QUANTUM_DECL void AdjS (_In_ unsigned sid, _In_ unsigned q)
 (External API) Inverse "S" Gate More...
 
MICROSOFT_QUANTUM_DECL void AdjT (_In_ unsigned sid, _In_ unsigned q)
 (External API) Inverse "T" Gate More...
 
MICROSOFT_QUANTUM_DECL void U (_In_ unsigned sid, _In_ unsigned q, _In_ double theta, _In_ double phi, _In_ double lambda)
 (External API) 3-parameter unitary gate More...
 
MICROSOFT_QUANTUM_DECL void Mtrx (_In_ unsigned sid, _In_reads_(8) double *m, _In_ unsigned q)
 (External API) 2x2 complex matrix unitary gate More...
 
MICROSOFT_QUANTUM_DECL void MCX (_In_ unsigned sid, _In_ unsigned n, _In_reads_(n) unsigned *c, _In_ unsigned q)
 (External API) Controlled "X" Gate More...
 
MICROSOFT_QUANTUM_DECL void MCY (_In_ unsigned sid, _In_ unsigned n, _In_reads_(n) unsigned *c, _In_ unsigned q)
 (External API) Controlled "Y" Gate More...
 
MICROSOFT_QUANTUM_DECL void MCZ (_In_ unsigned sid, _In_ unsigned n, _In_reads_(n) unsigned *c, _In_ unsigned q)
 (External API) Controlled "Z" Gate More...
 
MICROSOFT_QUANTUM_DECL void MCH (_In_ unsigned sid, _In_ unsigned n, _In_reads_(n) unsigned *c, _In_ unsigned q)
 (External API) Controlled "H" Gate More...
 
MICROSOFT_QUANTUM_DECL void MCS (_In_ unsigned sid, _In_ unsigned n, _In_reads_(n) unsigned *c, _In_ unsigned q)
 (External API) Controlled "S" Gate More...
 
MICROSOFT_QUANTUM_DECL void MCT (_In_ unsigned sid, _In_ unsigned n, _In_reads_(n) unsigned *c, _In_ unsigned q)
 (External API) Controlled "T" Gate More...
 
MICROSOFT_QUANTUM_DECL void MCAdjS (_In_ unsigned sid, _In_ unsigned n, _In_reads_(n) unsigned *c, _In_ unsigned q)
 (External API) Controlled Inverse "S" Gate More...
 
MICROSOFT_QUANTUM_DECL void MCAdjT (_In_ unsigned sid, _In_ unsigned n, _In_reads_(n) unsigned *c, _In_ unsigned q)
 (External API) Controlled Inverse "T" Gate More...
 
MICROSOFT_QUANTUM_DECL void MCU (_In_ unsigned sid, _In_ unsigned n, _In_reads_(n) unsigned *c, _In_ unsigned q, _In_ double theta, _In_ double phi, _In_ double lambda)
 (External API) Controlled 3-parameter unitary gate More...
 
MICROSOFT_QUANTUM_DECL void MCMtrx (_In_ unsigned sid, _In_ unsigned n, _In_reads_(n) unsigned *c, _In_reads_(8) double *m, _In_ unsigned q)
 (External API) Controlled 2x2 complex matrix unitary gate More...
 
MICROSOFT_QUANTUM_DECL void MACX (_In_ unsigned sid, _In_ unsigned n, _In_reads_(n) unsigned *c, _In_ unsigned q)
 (External API) "Anti-"Controlled "X" Gate More...
 
MICROSOFT_QUANTUM_DECL void MACY (_In_ unsigned sid, _In_ unsigned n, _In_reads_(n) unsigned *c, _In_ unsigned q)
 (External API) "Anti-"Controlled "Y" Gate More...
 
MICROSOFT_QUANTUM_DECL void MACZ (_In_ unsigned sid, _In_ unsigned n, _In_reads_(n) unsigned *c, _In_ unsigned q)
 (External API) "Anti-"Controlled "Z" Gate More...
 
MICROSOFT_QUANTUM_DECL void MACH (_In_ unsigned sid, _In_ unsigned n, _In_reads_(n) unsigned *c, _In_ unsigned q)
 (External API) "Anti-"Controlled "H" Gate More...
 
MICROSOFT_QUANTUM_DECL void MACS (_In_ unsigned sid, _In_ unsigned n, _In_reads_(n) unsigned *c, _In_ unsigned q)
 (External API) "Anti-"Controlled "S" Gate More...
 
MICROSOFT_QUANTUM_DECL void MACT (_In_ unsigned sid, _In_ unsigned n, _In_reads_(n) unsigned *c, _In_ unsigned q)
 (External API) "Anti-"Controlled "T" Gate More...
 
MICROSOFT_QUANTUM_DECL void MACAdjS (_In_ unsigned sid, _In_ unsigned n, _In_reads_(n) unsigned *c, _In_ unsigned q)
 (External API) "Anti-"Controlled Inverse "S" Gate More...
 
MICROSOFT_QUANTUM_DECL void MACAdjT (_In_ unsigned sid, _In_ unsigned n, _In_reads_(n) unsigned *c, _In_ unsigned q)
 (External API) "Anti-"Controlled Inverse "T" Gate More...
 
MICROSOFT_QUANTUM_DECL void MACU (_In_ unsigned sid, _In_ unsigned n, _In_reads_(n) unsigned *c, _In_ unsigned q, _In_ double theta, _In_ double phi, _In_ double lambda)
 (External API) Controlled 3-parameter unitary gate More...
 
MICROSOFT_QUANTUM_DECL void MACMtrx (_In_ unsigned sid, _In_ unsigned n, _In_reads_(n) unsigned *c, _In_reads_(8) double *m, _In_ unsigned q)
 (External API) Controlled 2x2 complex matrix unitary gate More...
 
MICROSOFT_QUANTUM_DECL void Multiplex1Mtrx (_In_ unsigned sid, _In_ unsigned n, _In_reads_(n) unsigned *c, _In_ unsigned q, double *m)
 
MICROSOFT_QUANTUM_DECL void R (_In_ unsigned sid, _In_ unsigned b, _In_ double phi, _In_ unsigned q)
 (External API) Rotation around Pauli axes More...
 
MICROSOFT_QUANTUM_DECL void MCR (_In_ unsigned sid, _In_ unsigned b, _In_ double phi, _In_ unsigned n, _In_reads_(n) unsigned *c, _In_ unsigned q)
 (External API) Controlled rotation around Pauli axes More...
 
MICROSOFT_QUANTUM_DECL void Exp (_In_ unsigned sid, _In_ unsigned n, _In_reads_(n) int *b, _In_ double phi, _In_reads_(n) unsigned *q)
 (External API) Exponentiation of Pauli operators More...
 
MICROSOFT_QUANTUM_DECL void MCExp (_In_ unsigned sid, _In_ unsigned n, _In_reads_(n) int *b, _In_ double phi, _In_ unsigned nc, _In_reads_(nc) unsigned *cs, _In_reads_(n) unsigned *q)
 (External API) Controlled exponentiation of Pauli operators More...
 
MICROSOFT_QUANTUM_DECL unsigned M (_In_ unsigned sid, _In_ unsigned q)
 (External API) Measure bit in |0>/|1> basis More...
 
MICROSOFT_QUANTUM_DECL unsigned MAll (_In_ unsigned sid)
 (External API) Measure all bits separately in |0>/|1> basis, and return the result in low-to-high order corresponding with first-to-last in original order of allocation. More...
 
MICROSOFT_QUANTUM_DECL unsigned Measure (_In_ unsigned sid, _In_ unsigned n, _In_reads_(n) int *b, _In_reads_(n) unsigned *q)
 (External API) Measure bits in specified Pauli bases More...
 
MICROSOFT_QUANTUM_DECL void MeasureShots (_In_ unsigned sid, _In_ unsigned n, _In_reads_(n) unsigned *q, _In_ unsigned s, _In_reads_(s) unsigned *m)
 
MICROSOFT_QUANTUM_DECL void SWAP (_In_ unsigned sid, _In_ unsigned qi1, _In_ unsigned qi2)
 
MICROSOFT_QUANTUM_DECL void ISWAP (_In_ unsigned sid, _In_ unsigned qi1, _In_ unsigned qi2)
 
MICROSOFT_QUANTUM_DECL void FSim (_In_ unsigned sid, _In_ double theta, _In_ double phi, _In_ unsigned qi1, _In_ unsigned qi2)
 
MICROSOFT_QUANTUM_DECL void CSWAP (_In_ unsigned sid, _In_ unsigned n, _In_reads_(n) unsigned *c, _In_ unsigned qi1, _In_ unsigned qi2)
 
MICROSOFT_QUANTUM_DECL void ACSWAP (_In_ unsigned sid, _In_ unsigned n, _In_reads_(n) unsigned *c, _In_ unsigned qi1, _In_ unsigned qi2)
 
MICROSOFT_QUANTUM_DECL void Compose (_In_ unsigned sid1, _In_ unsigned sid2, unsigned *q)
 
MICROSOFT_QUANTUM_DECL unsigned Decompose (_In_ unsigned sid, _In_ unsigned n, _In_reads_(n) unsigned *q)
 
MICROSOFT_QUANTUM_DECL void Dispose (_In_ unsigned sid, _In_ unsigned n, _In_reads_(n) unsigned *q)
 
MICROSOFT_QUANTUM_DECL void AND (_In_ unsigned sid, _In_ unsigned qi1, _In_ unsigned qi2, _In_ unsigned qo)
 
MICROSOFT_QUANTUM_DECL void OR (_In_ unsigned sid, _In_ unsigned qi1, _In_ unsigned qi2, _In_ unsigned qo)
 
MICROSOFT_QUANTUM_DECL void XOR (_In_ unsigned sid, _In_ unsigned qi1, _In_ unsigned qi2, _In_ unsigned qo)
 
MICROSOFT_QUANTUM_DECL void NAND (_In_ unsigned sid, _In_ unsigned qi1, _In_ unsigned qi2, _In_ unsigned qo)
 
MICROSOFT_QUANTUM_DECL void NOR (_In_ unsigned sid, _In_ unsigned qi1, _In_ unsigned qi2, _In_ unsigned qo)
 
MICROSOFT_QUANTUM_DECL void XNOR (_In_ unsigned sid, _In_ unsigned qi1, _In_ unsigned qi2, _In_ unsigned qo)
 
MICROSOFT_QUANTUM_DECL void CLAND (_In_ unsigned sid, _In_ bool ci, _In_ unsigned qi, _In_ unsigned qo)
 
MICROSOFT_QUANTUM_DECL void CLOR (_In_ unsigned sid, _In_ bool ci, _In_ unsigned qi, _In_ unsigned qo)
 
MICROSOFT_QUANTUM_DECL void CLXOR (_In_ unsigned sid, _In_ bool ci, _In_ unsigned qi, _In_ unsigned qo)
 
MICROSOFT_QUANTUM_DECL void CLNAND (_In_ unsigned sid, _In_ bool ci, _In_ unsigned qi, _In_ unsigned qo)
 
MICROSOFT_QUANTUM_DECL void CLNOR (_In_ unsigned sid, _In_ bool ci, _In_ unsigned qi, _In_ unsigned qo)
 
MICROSOFT_QUANTUM_DECL void CLXNOR (_In_ unsigned sid, _In_ bool ci, _In_ unsigned qi, _In_ unsigned qo)
 
MICROSOFT_QUANTUM_DECL double Prob (_In_ unsigned sid, _In_ unsigned q)
 (External API) Get the probability that a qubit is in the |1> state. More...
 
MICROSOFT_QUANTUM_DECL double PermutationExpectation (_In_ unsigned sid, _In_ unsigned n, _In_reads_(n) unsigned *c)
 (External API) Get the permutation expectation value, based upon the order of input qubits. More...
 
MICROSOFT_QUANTUM_DECL void QFT (_In_ unsigned sid, _In_ unsigned n, _In_reads_(n) unsigned *c)
 
MICROSOFT_QUANTUM_DECL void IQFT (_In_ unsigned sid, _In_ unsigned n, _In_reads_(n) unsigned *c)
 
MICROSOFT_QUANTUM_DECL void ADD (_In_ unsigned sid, unsigned a, _In_ unsigned n, _In_reads_(n) unsigned *q)
 
MICROSOFT_QUANTUM_DECL void SUB (_In_ unsigned sid, unsigned a, _In_ unsigned n, _In_reads_(n) unsigned *q)
 
MICROSOFT_QUANTUM_DECL void ADDS (_In_ unsigned sid, unsigned a, unsigned s, _In_ unsigned n, _In_reads_(n) unsigned *q)
 
MICROSOFT_QUANTUM_DECL void SUBS (_In_ unsigned sid, unsigned a, unsigned s, _In_ unsigned n, _In_reads_(n) unsigned *q)
 
MICROSOFT_QUANTUM_DECL void MCADD (_In_ unsigned sid, unsigned a, _In_ unsigned nc, _In_reads_(nc) unsigned *c, _In_ unsigned nq, _In_reads_(nq) unsigned *q)
 
MICROSOFT_QUANTUM_DECL void MCSUB (_In_ unsigned sid, unsigned a, _In_ unsigned nc, _In_reads_(nc) unsigned *c, _In_ unsigned nq, _In_reads_(nq) unsigned *q)
 
MICROSOFT_QUANTUM_DECL void MUL (_In_ unsigned sid, unsigned a, _In_ unsigned n, _In_reads_(n) unsigned *q, _In_reads_(n) unsigned *o)
 
MICROSOFT_QUANTUM_DECL void DIV (_In_ unsigned sid, unsigned a, _In_ unsigned n, _In_reads_(n) unsigned *q, _In_reads_(n) unsigned *o)
 
MICROSOFT_QUANTUM_DECL void MULN (_In_ unsigned sid, unsigned a, unsigned m, _In_ unsigned n, _In_reads_(n) unsigned *q, _In_reads_(n) unsigned *o)
 
MICROSOFT_QUANTUM_DECL void DIVN (_In_ unsigned sid, unsigned a, unsigned m, _In_ unsigned n, _In_reads_(n) unsigned *q, _In_reads_(n) unsigned *o)
 
MICROSOFT_QUANTUM_DECL void POWN (_In_ unsigned sid, unsigned a, unsigned m, _In_ unsigned n, _In_reads_(n) unsigned *q, _In_reads_(n) unsigned *o)
 
MICROSOFT_QUANTUM_DECL void MCMUL (_In_ unsigned sid, unsigned a, _In_ unsigned nc, _In_reads_(nc) unsigned *c, _In_ unsigned n, _In_reads_(n) unsigned *q, _In_reads_(n) unsigned *o)
 
MICROSOFT_QUANTUM_DECL void MCDIV (_In_ unsigned sid, unsigned a, _In_ unsigned nc, _In_reads_(nc) unsigned *c, _In_ unsigned n, _In_reads_(n) unsigned *q, _In_reads_(n) unsigned *o)
 
MICROSOFT_QUANTUM_DECL void MCMULN (_In_ unsigned sid, unsigned a, _In_ unsigned nc, _In_reads_(nc) unsigned *c, unsigned m, _In_ unsigned n, _In_reads_(n) unsigned *q, _In_reads_(n) unsigned *o)
 
MICROSOFT_QUANTUM_DECL void MCDIVN (_In_ unsigned sid, unsigned a, _In_ unsigned nc, _In_reads_(nc) unsigned *c, unsigned m, _In_ unsigned n, _In_reads_(n) unsigned *q, _In_reads_(n) unsigned *o)
 
MICROSOFT_QUANTUM_DECL void MCPOWN (_In_ unsigned sid, unsigned a, _In_ unsigned nc, _In_reads_(nc) unsigned *c, unsigned m, _In_ unsigned n, _In_reads_(n) unsigned *q, _In_reads_(n) unsigned *o)
 
MICROSOFT_QUANTUM_DECL void LDA (_In_ unsigned sid, _In_ unsigned ni, _In_reads_(ni) unsigned *qi, _In_ unsigned nv, _In_reads_(nv) unsigned *qv, unsigned char *t)
 
MICROSOFT_QUANTUM_DECL void ADC (_In_ unsigned sid, unsigned s, _In_ unsigned ni, _In_reads_(ni) unsigned *qi, _In_ unsigned nv, _In_reads_(nv) unsigned *qv, unsigned char *t)
 
MICROSOFT_QUANTUM_DECL void SBC (_In_ unsigned sid, unsigned s, _In_ unsigned ni, _In_reads_(ni) unsigned *qi, _In_ unsigned nv, _In_reads_(nv) unsigned *qv, unsigned char *t)
 
MICROSOFT_QUANTUM_DECL void Hash (_In_ unsigned sid, _In_ unsigned n, _In_reads_(n) unsigned *q, unsigned char *t)
 
MICROSOFT_QUANTUM_DECL bool TrySeparate1Qb (_In_ unsigned sid, _In_ unsigned qi1)
 
MICROSOFT_QUANTUM_DECL bool TrySeparate2Qb (_In_ unsigned sid, _In_ unsigned qi1, _In_ unsigned qi2)
 
MICROSOFT_QUANTUM_DECL bool TrySeparateTol (_In_ unsigned sid, _In_ unsigned n, _In_reads_(n) unsigned *q, _In_ double tol)
 
MICROSOFT_QUANTUM_DECL void SetReactiveSeparate (_In_ unsigned sid, _In_ bool irs)
 

Variables

qrack_rand_gen_ptr randNumGen = std::make_shared<qrack_rand_gen>(time(0))
 
std::mutex metaOperationMutex
 
std::vector< int > simulatorErrors
 
std::vector< QInterfacePtrsimulators
 
std::vector< std::vector< QInterfaceEngine > > simulatorTypes
 
std::vector< bool > simulatorHostPointer
 
std::map< QInterface *, std::mutex > simulatorMutexes
 
std::vector< bool > simulatorReservations
 
std::map< QInterface *, std::map< unsigned, bitLenInt > > shards
 
bitLenInt _maxShardQubits = 0
 

Macro Definition Documentation

◆ MAP_CONTROLS_AND_LOCK

#define MAP_CONTROLS_AND_LOCK (   sid,
  numC 
)
Value:
QInterfacePtr simulator = simulators[sid]; \
std::unique_ptr<bitLenInt[]> ctrlsArray(new bitLenInt[numC]); \
for (unsigned i = 0; i < numC; i++) { \
ctrlsArray[i] = shards[simulator.get()][c[i]]; \
}
std::map< QInterface *, std::map< unsigned, bitLenInt > > shards
Definition: pinvoke_api.cpp:72
#define SIMULATOR_LOCK_GUARD(sid)
Definition: pinvoke_api.cpp:33
std::vector< QInterfacePtr > simulators
Definition: pinvoke_api.cpp:67
#define bitLenInt
Definition: qrack_types.hpp:40

◆ META_LOCK_GUARD

#define META_LOCK_GUARD ( )
Value:
const std::lock_guard<std::mutex> metaLock(metaOperationMutex); \
std::map<QInterface*, std::mutex>::iterator mutexLockIt; \
std::vector<std::unique_ptr<const std::lock_guard<std::mutex>>> simulatorLocks; \
for (mutexLockIt = simulatorMutexes.begin(); mutexLockIt != simulatorMutexes.end(); mutexLockIt++) { \
simulatorLocks.push_back(std::unique_ptr<const std::lock_guard<std::mutex>>( \
new const std::lock_guard<std::mutex>(mutexLockIt->second))); \
}
std::mutex metaOperationMutex
Definition: pinvoke_api.cpp:65
std::map< QInterface *, std::mutex > simulatorMutexes
Definition: pinvoke_api.cpp:70

◆ QALU

#define QALU (   qReg)    std::dynamic_pointer_cast<QAlu>(qReg)

◆ QPARITY

#define QPARITY (   qReg)    std::dynamic_pointer_cast<QParity>(qReg)

◆ SIMULATOR_LOCK_GUARD

#define SIMULATOR_LOCK_GUARD (   sid)
Value:
std::unique_ptr<const std::lock_guard<std::mutex>> simulatorLock; \
if (true) { \
const std::lock_guard<std::mutex> metaLock(metaOperationMutex); \
simulatorLock = std::unique_ptr<const std::lock_guard<std::mutex>>( \
new const std::lock_guard<std::mutex>(simulatorMutexes[simulators[sid].get()])); \
}
std::vector< QInterfacePtr > simulators
Definition: pinvoke_api.cpp:67
std::mutex metaOperationMutex
Definition: pinvoke_api.cpp:65
std::map< QInterface *, std::mutex > simulatorMutexes
Definition: pinvoke_api.cpp:70

◆ SIMULATOR_LOCK_GUARD_BOOL

#define SIMULATOR_LOCK_GUARD_BOOL (   sid)
Value:
if (!simulators[sid]) { \
return false; \
}
#define SIMULATOR_LOCK_GUARD(sid)
Definition: pinvoke_api.cpp:33
std::vector< QInterfacePtr > simulators
Definition: pinvoke_api.cpp:67

◆ SIMULATOR_LOCK_GUARD_DOUBLE

#define SIMULATOR_LOCK_GUARD_DOUBLE (   sid)
Value:
if (!simulators[sid]) { \
return 0.0; \
}
#define SIMULATOR_LOCK_GUARD(sid)
Definition: pinvoke_api.cpp:33
std::vector< QInterfacePtr > simulators
Definition: pinvoke_api.cpp:67

◆ SIMULATOR_LOCK_GUARD_INT

#define SIMULATOR_LOCK_GUARD_INT (   sid)
Value:
if (!simulators[sid]) { \
return 0U; \
}
#define SIMULATOR_LOCK_GUARD(sid)
Definition: pinvoke_api.cpp:33
MICROSOFT_QUANTUM_DECL void U(_In_ unsigned sid, _In_ unsigned q, _In_ double theta, _In_ double phi, _In_ double lambda)
(External API) 3-parameter unitary gate
Definition: pinvoke_api.cpp:1074
std::vector< QInterfacePtr > simulators
Definition: pinvoke_api.cpp:67

Function Documentation

◆ _darray_to_creal1_array()

void _darray_to_creal1_array ( double *  params,
bitCapIntOcl  componentCount,
complex amps 
)

◆ _JointEnsembleProbabilityHelper()

double _JointEnsembleProbabilityHelper ( QInterfacePtr  simulator,
unsigned  n,
int *  b,
unsigned *  q,
bool  doMeasure 
)

◆ ACSWAP()

MICROSOFT_QUANTUM_DECL void ACSWAP ( _In_ unsigned  sid,
_In_ unsigned  n,
_In_reads_(n) unsigned *  c,
_In_ unsigned  qi1,
_In_ unsigned  qi2 
)

◆ ADC()

MICROSOFT_QUANTUM_DECL void ADC ( _In_ unsigned  sid,
unsigned  s,
_In_ unsigned  ni,
_In_reads_(ni) unsigned *  qi,
_In_ unsigned  nv,
_In_reads_(nv) unsigned *  qv,
unsigned char *  t 
)

◆ ADD()

MICROSOFT_QUANTUM_DECL void ADD ( _In_ unsigned  sid,
unsigned  a,
_In_ unsigned  n,
_In_reads_(n) unsigned *  q 
)

◆ ADDS()

MICROSOFT_QUANTUM_DECL void ADDS ( _In_ unsigned  sid,
unsigned  a,
unsigned  s,
_In_ unsigned  n,
_In_reads_(n) unsigned *  q 
)

◆ AdjS()

MICROSOFT_QUANTUM_DECL void AdjS ( _In_ unsigned  sid,
_In_ unsigned  q 
)

(External API) Inverse "S" Gate

◆ AdjT()

MICROSOFT_QUANTUM_DECL void AdjT ( _In_ unsigned  sid,
_In_ unsigned  q 
)

(External API) Inverse "T" Gate

◆ allocateQubit()

MICROSOFT_QUANTUM_DECL void allocateQubit ( _In_ unsigned  sid,
_In_ unsigned  qid 
)

(External API) Allocate 1 new qubit with the given qubit ID, under the simulator ID

◆ AND()

MICROSOFT_QUANTUM_DECL void AND ( _In_ unsigned  sid,
_In_ unsigned  qi1,
_In_ unsigned  qi2,
_In_ unsigned  qo 
)

◆ CLAND()

MICROSOFT_QUANTUM_DECL void CLAND ( _In_ unsigned  sid,
_In_ bool  ci,
_In_ unsigned  qi,
_In_ unsigned  qo 
)

◆ CLNAND()

MICROSOFT_QUANTUM_DECL void CLNAND ( _In_ unsigned  sid,
_In_ bool  ci,
_In_ unsigned  qi,
_In_ unsigned  qo 
)

◆ CLNOR()

MICROSOFT_QUANTUM_DECL void CLNOR ( _In_ unsigned  sid,
_In_ bool  ci,
_In_ unsigned  qi,
_In_ unsigned  qo 
)

◆ CLOR()

MICROSOFT_QUANTUM_DECL void CLOR ( _In_ unsigned  sid,
_In_ bool  ci,
_In_ unsigned  qi,
_In_ unsigned  qo 
)

◆ CLXNOR()

MICROSOFT_QUANTUM_DECL void CLXNOR ( _In_ unsigned  sid,
_In_ bool  ci,
_In_ unsigned  qi,
_In_ unsigned  qo 
)

◆ CLXOR()

MICROSOFT_QUANTUM_DECL void CLXOR ( _In_ unsigned  sid,
_In_ bool  ci,
_In_ unsigned  qi,
_In_ unsigned  qo 
)

◆ Compose()

MICROSOFT_QUANTUM_DECL void Compose ( _In_ unsigned  sid1,
_In_ unsigned  sid2,
unsigned *  q 
)

◆ CSWAP()

MICROSOFT_QUANTUM_DECL void CSWAP ( _In_ unsigned  sid,
_In_ unsigned  n,
_In_reads_(n) unsigned *  c,
_In_ unsigned  qi1,
_In_ unsigned  qi2 
)

◆ Decompose()

MICROSOFT_QUANTUM_DECL unsigned Decompose ( _In_ unsigned  sid,
_In_ unsigned  n,
_In_reads_(n) unsigned *  q 
)

◆ destroy()

MICROSOFT_QUANTUM_DECL void destroy ( _In_ unsigned  sid)

(External API) Destroy a simulator (ID will not be reused)

◆ Dispose()

MICROSOFT_QUANTUM_DECL void Dispose ( _In_ unsigned  sid,
_In_ unsigned  n,
_In_reads_(n) unsigned *  q 
)

◆ DIV()

MICROSOFT_QUANTUM_DECL void DIV ( _In_ unsigned  sid,
unsigned  a,
_In_ unsigned  n,
_In_reads_(n) unsigned *  q,
_In_reads_(n) unsigned *  o 
)

◆ DIVN()

MICROSOFT_QUANTUM_DECL void DIVN ( _In_ unsigned  sid,
unsigned  a,
unsigned  m,
_In_ unsigned  n,
_In_reads_(n) unsigned *  q,
_In_reads_(n) unsigned *  o 
)

◆ Dump()

MICROSOFT_QUANTUM_DECL void Dump ( _In_ unsigned  sid,
_In_ ProbAmpCallback  callback 
)

(External API) "Dump" all IDs from the selected simulator ID into the callback

◆ DumpIds()

MICROSOFT_QUANTUM_DECL void DumpIds ( _In_ unsigned  sid,
_In_ IdCallback  callback 
)

(External API) "Dump" all IDs from the selected simulator ID into the callback

◆ Exp()

MICROSOFT_QUANTUM_DECL void Exp ( _In_ unsigned  sid,
_In_ unsigned  n,
_In_reads_(n) int *  b,
_In_ double  phi,
_In_reads_(n) unsigned *  q 
)

(External API) Exponentiation of Pauli operators

◆ FindShardValue()

std::map<unsigned, bitLenInt>::iterator FindShardValue ( bitLenInt  v,
std::map< unsigned, bitLenInt > &  simMap 
)

◆ FSim()

MICROSOFT_QUANTUM_DECL void FSim ( _In_ unsigned  sid,
_In_ double  theta,
_In_ double  phi,
_In_ unsigned  qi1,
_In_ unsigned  qi2 
)

◆ get_error()

MICROSOFT_QUANTUM_DECL int get_error ( _In_ unsigned  sid)

(External API) Poll after each operation to check whether error occurred.

◆ H()

MICROSOFT_QUANTUM_DECL void H ( _In_ unsigned  sid,
_In_ unsigned  q 
)

(External API) Walsh-Hadamard transform applied for simulator ID and qubit ID

◆ Hash()

MICROSOFT_QUANTUM_DECL void Hash ( _In_ unsigned  sid,
_In_ unsigned  n,
_In_reads_(n) unsigned *  q,
unsigned char *  t 
)

◆ init_clone()

MICROSOFT_QUANTUM_DECL unsigned init_clone ( _In_ unsigned  sid)

(External API) Initialize a simulator ID that clones simulator ID "sid"

◆ init_count()

MICROSOFT_QUANTUM_DECL unsigned init_count ( _In_ unsigned  q,
_In_ bool  hp 
)

(External API) Initialize a simulator ID with "q" qubits and implicit default layer options.

◆ init_count_pager()

MICROSOFT_QUANTUM_DECL unsigned init_count_pager ( _In_ unsigned  q,
_In_ bool  hp 
)

(External API) Initialize a simulator ID with "q" qubits and implicit default layer options.

◆ init_count_type()

MICROSOFT_QUANTUM_DECL unsigned init_count_type ( _In_ unsigned  q,
_In_ bool  md,
_In_ bool  sd,
_In_ bool  sh,
_In_ bool  bdt,
_In_ bool  pg,
_In_ bool  zxf,
_In_ bool  hy,
_In_ bool  oc,
_In_ bool  hp 
)

(External API) Initialize a simulator ID with "q" qubits and explicit layer options on/off

◆ init_qbdt_stabilizer()

MICROSOFT_QUANTUM_DECL unsigned init_qbdt_stabilizer ( _In_ unsigned  q,
_In_ unsigned  c,
_In_ bool  sd 
)

◆ IQFT()

MICROSOFT_QUANTUM_DECL void IQFT ( _In_ unsigned  sid,
_In_ unsigned  n,
_In_reads_(n) unsigned *  c 
)

◆ ISWAP()

MICROSOFT_QUANTUM_DECL void ISWAP ( _In_ unsigned  sid,
_In_ unsigned  qi1,
_In_ unsigned  qi2 
)

◆ JointEnsembleProbability()

MICROSOFT_QUANTUM_DECL double JointEnsembleProbability ( _In_ unsigned  sid,
_In_ unsigned  n,
_In_reads_(n) int *  b,
_In_reads_(n) unsigned *  q 
)

(External API) Find the joint probability for all specified qubits under the respective Pauli basis transformations.

◆ LDA()

MICROSOFT_QUANTUM_DECL void LDA ( _In_ unsigned  sid,
_In_ unsigned  ni,
_In_reads_(ni) unsigned *  qi,
_In_ unsigned  nv,
_In_reads_(nv) unsigned *  qv,
unsigned char *  t 
)

◆ M()

MICROSOFT_QUANTUM_DECL unsigned M ( _In_ unsigned  sid,
_In_ unsigned  q 
)

(External API) Measure bit in |0>/|1> basis

◆ MACAdjS()

MICROSOFT_QUANTUM_DECL void MACAdjS ( _In_ unsigned  sid,
_In_ unsigned  n,
_In_reads_(n) unsigned *  c,
_In_ unsigned  q 
)

(External API) "Anti-"Controlled Inverse "S" Gate

◆ MACAdjT()

MICROSOFT_QUANTUM_DECL void MACAdjT ( _In_ unsigned  sid,
_In_ unsigned  n,
_In_reads_(n) unsigned *  c,
_In_ unsigned  q 
)

(External API) "Anti-"Controlled Inverse "T" Gate

◆ MACH()

MICROSOFT_QUANTUM_DECL void MACH ( _In_ unsigned  sid,
_In_ unsigned  n,
_In_reads_(n) unsigned *  c,
_In_ unsigned  q 
)

(External API) "Anti-"Controlled "H" Gate

◆ MACMtrx()

MICROSOFT_QUANTUM_DECL void MACMtrx ( _In_ unsigned  sid,
_In_ unsigned  n,
_In_reads_(n) unsigned *  c,
_In_reads_(8) double *  m,
_In_ unsigned  q 
)

(External API) Controlled 2x2 complex matrix unitary gate

◆ MACS()

MICROSOFT_QUANTUM_DECL void MACS ( _In_ unsigned  sid,
_In_ unsigned  n,
_In_reads_(n) unsigned *  c,
_In_ unsigned  q 
)

(External API) "Anti-"Controlled "S" Gate

◆ MACT()

MICROSOFT_QUANTUM_DECL void MACT ( _In_ unsigned  sid,
_In_ unsigned  n,
_In_reads_(n) unsigned *  c,
_In_ unsigned  q 
)

(External API) "Anti-"Controlled "T" Gate

◆ MACU()

MICROSOFT_QUANTUM_DECL void MACU ( _In_ unsigned  sid,
_In_ unsigned  n,
_In_reads_(n) unsigned *  c,
_In_ unsigned  q,
_In_ double  theta,
_In_ double  phi,
_In_ double  lambda 
)

(External API) Controlled 3-parameter unitary gate

◆ MACX()

MICROSOFT_QUANTUM_DECL void MACX ( _In_ unsigned  sid,
_In_ unsigned  n,
_In_reads_(n) unsigned *  c,
_In_ unsigned  q 
)

(External API) "Anti-"Controlled "X" Gate

◆ MACY()

MICROSOFT_QUANTUM_DECL void MACY ( _In_ unsigned  sid,
_In_ unsigned  n,
_In_reads_(n) unsigned *  c,
_In_ unsigned  q 
)

(External API) "Anti-"Controlled "Y" Gate

◆ MACZ()

MICROSOFT_QUANTUM_DECL void MACZ ( _In_ unsigned  sid,
_In_ unsigned  n,
_In_reads_(n) unsigned *  c,
_In_ unsigned  q 
)

(External API) "Anti-"Controlled "Z" Gate

◆ make_mask()

std::size_t make_mask ( std::vector< bitLenInt > const &  qs)
inline

◆ MAll()

MICROSOFT_QUANTUM_DECL unsigned MAll ( _In_ unsigned  sid)

(External API) Measure all bits separately in |0>/|1> basis, and return the result in low-to-high order corresponding with first-to-last in original order of allocation.

◆ MapArithmetic()

unsigned MapArithmetic ( QInterfacePtr  simulator,
unsigned  n,
unsigned *  q 
)

◆ MapArithmetic2()

MapArithmeticResult2 MapArithmetic2 ( QInterfacePtr  simulator,
unsigned  n,
unsigned *  q1,
unsigned *  q2 
)

◆ MapArithmetic3()

MapArithmeticResult2 MapArithmetic3 ( QInterfacePtr  simulator,
unsigned  n1,
unsigned *  q1,
unsigned  n2,
unsigned *  q2 
)

◆ MaxShardQubits()

bitLenInt MaxShardQubits ( )

◆ MCADD()

MICROSOFT_QUANTUM_DECL void MCADD ( _In_ unsigned  sid,
unsigned  a,
_In_ unsigned  nc,
_In_reads_(nc) unsigned *  c,
_In_ unsigned  nq,
_In_reads_(nq) unsigned *  q 
)

◆ MCAdjS()

MICROSOFT_QUANTUM_DECL void MCAdjS ( _In_ unsigned  sid,
_In_ unsigned  n,
_In_reads_(n) unsigned *  c,
_In_ unsigned  q 
)

(External API) Controlled Inverse "S" Gate

◆ MCAdjT()

MICROSOFT_QUANTUM_DECL void MCAdjT ( _In_ unsigned  sid,
_In_ unsigned  n,
_In_reads_(n) unsigned *  c,
_In_ unsigned  q 
)

(External API) Controlled Inverse "T" Gate

◆ MCDIV()

MICROSOFT_QUANTUM_DECL void MCDIV ( _In_ unsigned  sid,
unsigned  a,
_In_ unsigned  nc,
_In_reads_(nc) unsigned *  c,
_In_ unsigned  n,
_In_reads_(n) unsigned *  q,
_In_reads_(n) unsigned *  o 
)

◆ MCDIVN()

MICROSOFT_QUANTUM_DECL void MCDIVN ( _In_ unsigned  sid,
unsigned  a,
_In_ unsigned  nc,
_In_reads_(nc) unsigned *  c,
unsigned  m,
_In_ unsigned  n,
_In_reads_(n) unsigned *  q,
_In_reads_(n) unsigned *  o 
)

◆ MCExp()

MICROSOFT_QUANTUM_DECL void MCExp ( _In_ unsigned  sid,
_In_ unsigned  n,
_In_reads_(n) int *  b,
_In_ double  phi,
_In_ unsigned  nc,
_In_reads_(nc) unsigned *  cs,
_In_reads_(n) unsigned *  q 
)

(External API) Controlled exponentiation of Pauli operators

◆ MCH()

MICROSOFT_QUANTUM_DECL void MCH ( _In_ unsigned  sid,
_In_ unsigned  n,
_In_reads_(n) unsigned *  c,
_In_ unsigned  q 
)

(External API) Controlled "H" Gate

◆ MCMtrx()

MICROSOFT_QUANTUM_DECL void MCMtrx ( _In_ unsigned  sid,
_In_ unsigned  n,
_In_reads_(n) unsigned *  c,
_In_reads_(8) double *  m,
_In_ unsigned  q 
)

(External API) Controlled 2x2 complex matrix unitary gate

◆ MCMUL()

MICROSOFT_QUANTUM_DECL void MCMUL ( _In_ unsigned  sid,
unsigned  a,
_In_ unsigned  nc,
_In_reads_(nc) unsigned *  c,
_In_ unsigned  n,
_In_reads_(n) unsigned *  q,
_In_reads_(n) unsigned *  o 
)

◆ MCMULN()

MICROSOFT_QUANTUM_DECL void MCMULN ( _In_ unsigned  sid,
unsigned  a,
_In_ unsigned  nc,
_In_reads_(nc) unsigned *  c,
unsigned  m,
_In_ unsigned  n,
_In_reads_(n) unsigned *  q,
_In_reads_(n) unsigned *  o 
)

◆ MCPOWN()

MICROSOFT_QUANTUM_DECL void MCPOWN ( _In_ unsigned  sid,
unsigned  a,
_In_ unsigned  nc,
_In_reads_(nc) unsigned *  c,
unsigned  m,
_In_ unsigned  n,
_In_reads_(n) unsigned *  q,
_In_reads_(n) unsigned *  o 
)

◆ MCR()

MICROSOFT_QUANTUM_DECL void MCR ( _In_ unsigned  sid,
_In_ unsigned  b,
_In_ double  phi,
_In_ unsigned  n,
_In_reads_(n) unsigned *  c,
_In_ unsigned  q 
)

(External API) Controlled rotation around Pauli axes

◆ MCRHelper()

void MCRHelper ( unsigned  sid,
unsigned  b,
double  phi,
unsigned  n,
unsigned *  c,
unsigned  q 
)

◆ MCS()

MICROSOFT_QUANTUM_DECL void MCS ( _In_ unsigned  sid,
_In_ unsigned  n,
_In_reads_(n) unsigned *  c,
_In_ unsigned  q 
)

(External API) Controlled "S" Gate

◆ MCSUB()

MICROSOFT_QUANTUM_DECL void MCSUB ( _In_ unsigned  sid,
unsigned  a,
_In_ unsigned  nc,
_In_reads_(nc) unsigned *  c,
_In_ unsigned  nq,
_In_reads_(nq) unsigned *  q 
)

◆ MCT()

MICROSOFT_QUANTUM_DECL void MCT ( _In_ unsigned  sid,
_In_ unsigned  n,
_In_reads_(n) unsigned *  c,
_In_ unsigned  q 
)

(External API) Controlled "T" Gate

◆ MCU()

MICROSOFT_QUANTUM_DECL void MCU ( _In_ unsigned  sid,
_In_ unsigned  n,
_In_reads_(n) unsigned *  c,
_In_ unsigned  q,
_In_ double  theta,
_In_ double  phi,
_In_ double  lambda 
)

(External API) Controlled 3-parameter unitary gate

◆ MCX()

MICROSOFT_QUANTUM_DECL void MCX ( _In_ unsigned  sid,
_In_ unsigned  n,
_In_reads_(n) unsigned *  c,
_In_ unsigned  q 
)

(External API) Controlled "X" Gate

◆ MCY()

MICROSOFT_QUANTUM_DECL void MCY ( _In_ unsigned  sid,
_In_ unsigned  n,
_In_reads_(n) unsigned *  c,
_In_ unsigned  q 
)

(External API) Controlled "Y" Gate

◆ MCZ()

MICROSOFT_QUANTUM_DECL void MCZ ( _In_ unsigned  sid,
_In_ unsigned  n,
_In_reads_(n) unsigned *  c,
_In_ unsigned  q 
)

(External API) Controlled "Z" Gate

◆ Measure()

MICROSOFT_QUANTUM_DECL unsigned Measure ( _In_ unsigned  sid,
_In_ unsigned  n,
_In_reads_(n) int *  b,
_In_reads_(n) unsigned *  q 
)

(External API) Measure bits in specified Pauli bases

◆ MeasureShots()

MICROSOFT_QUANTUM_DECL void MeasureShots ( _In_ unsigned  sid,
_In_ unsigned  n,
_In_reads_(n) unsigned *  q,
_In_ unsigned  s,
_In_reads_(s) unsigned *  m 
)

◆ Mtrx()

MICROSOFT_QUANTUM_DECL void Mtrx ( _In_ unsigned  sid,
_In_reads_(8) double *  m,
_In_ unsigned  q 
)

(External API) 2x2 complex matrix unitary gate

◆ MUL()

MICROSOFT_QUANTUM_DECL void MUL ( _In_ unsigned  sid,
unsigned  a,
_In_ unsigned  n,
_In_reads_(n) unsigned *  q,
_In_reads_(n) unsigned *  o 
)

◆ MULN()

MICROSOFT_QUANTUM_DECL void MULN ( _In_ unsigned  sid,
unsigned  a,
unsigned  m,
_In_ unsigned  n,
_In_reads_(n) unsigned *  q,
_In_reads_(n) unsigned *  o 
)

◆ Multiplex1Mtrx()

MICROSOFT_QUANTUM_DECL void Multiplex1Mtrx ( _In_ unsigned  sid,
_In_ unsigned  n,
_In_reads_(n) unsigned *  c,
_In_ unsigned  q,
double *  m 
)

◆ NAND()

MICROSOFT_QUANTUM_DECL void NAND ( _In_ unsigned  sid,
_In_ unsigned  qi1,
_In_ unsigned  qi2,
_In_ unsigned  qo 
)

◆ NOR()

MICROSOFT_QUANTUM_DECL void NOR ( _In_ unsigned  sid,
_In_ unsigned  qi1,
_In_ unsigned  qi2,
_In_ unsigned  qo 
)

◆ num_qubits()

MICROSOFT_QUANTUM_DECL unsigned num_qubits ( _In_ unsigned  sid)

◆ OR()

MICROSOFT_QUANTUM_DECL void OR ( _In_ unsigned  sid,
_In_ unsigned  qi1,
_In_ unsigned  qi2,
_In_ unsigned  qo 
)

◆ PermutationExpectation()

MICROSOFT_QUANTUM_DECL double PermutationExpectation ( _In_ unsigned  sid,
_In_ unsigned  n,
_In_reads_(n) unsigned *  c 
)

(External API) Get the permutation expectation value, based upon the order of input qubits.

◆ PhaseParity()

MICROSOFT_QUANTUM_DECL void PhaseParity ( _In_ unsigned  sid,
_In_ double  lambda,
_In_ unsigned  n,
_In_reads_(n) unsigned *  q 
)

◆ POWN()

MICROSOFT_QUANTUM_DECL void POWN ( _In_ unsigned  sid,
unsigned  a,
unsigned  m,
_In_ unsigned  n,
_In_reads_(n) unsigned *  q,
_In_reads_(n) unsigned *  o 
)

◆ Prob()

MICROSOFT_QUANTUM_DECL double Prob ( _In_ unsigned  sid,
_In_ unsigned  q 
)

(External API) Get the probability that a qubit is in the |1> state.

◆ QFT()

MICROSOFT_QUANTUM_DECL void QFT ( _In_ unsigned  sid,
_In_ unsigned  n,
_In_reads_(n) unsigned *  c 
)

◆ R()

MICROSOFT_QUANTUM_DECL void R ( _In_ unsigned  sid,
_In_ unsigned  b,
_In_ double  phi,
_In_ unsigned  q 
)

(External API) Rotation around Pauli axes

◆ random_choice()

MICROSOFT_QUANTUM_DECL std::size_t random_choice ( _In_ unsigned  sid,
_In_ std::size_t  n,
_In_reads_(n) double *  p 
)

(External API) Select from a distribution of "n" elements according the discrete probabilities in "d."

◆ release()

MICROSOFT_QUANTUM_DECL bool release ( _In_ unsigned  sid,
_In_ unsigned  q 
)

(External API) Release 1 qubit with the given qubit ID, under the simulator ID

◆ removeIdentities()

void removeIdentities ( std::vector< int > *  b,
std::vector< bitLenInt > *  qs 
)

◆ ResetAll()

MICROSOFT_QUANTUM_DECL void ResetAll ( _In_ unsigned  sid)

(External API) Set the simulator to a computational basis permutation.

◆ RevertPauliBasis()

void RevertPauliBasis ( QInterfacePtr  simulator,
unsigned  len,
int *  bases,
unsigned *  qubitIds 
)

◆ RHelper()

void RHelper ( unsigned  sid,
unsigned  b,
double  phi,
unsigned  q 
)

◆ S()

MICROSOFT_QUANTUM_DECL void S ( _In_ unsigned  sid,
_In_ unsigned  q 
)

(External API) "S" Gate

◆ SBC()

MICROSOFT_QUANTUM_DECL void SBC ( _In_ unsigned  sid,
unsigned  s,
_In_ unsigned  ni,
_In_reads_(ni) unsigned *  qi,
_In_ unsigned  nv,
_In_reads_(nv) unsigned *  qv,
unsigned char *  t 
)

◆ seed()

MICROSOFT_QUANTUM_DECL void seed ( _In_ unsigned  sid,
_In_ unsigned  s 
)

(External API) Set RNG seed for simulator ID

◆ set_concurrency()

MICROSOFT_QUANTUM_DECL void set_concurrency ( _In_ unsigned  sid,
_In_ unsigned  p 
)

(External API) Set concurrency level per QEngine shard

◆ SetReactiveSeparate()

MICROSOFT_QUANTUM_DECL void SetReactiveSeparate ( _In_ unsigned  sid,
_In_ bool  irs 
)

◆ SUB()

MICROSOFT_QUANTUM_DECL void SUB ( _In_ unsigned  sid,
unsigned  a,
_In_ unsigned  n,
_In_reads_(n) unsigned *  q 
)

◆ SUBS()

MICROSOFT_QUANTUM_DECL void SUBS ( _In_ unsigned  sid,
unsigned  a,
unsigned  s,
_In_ unsigned  n,
_In_reads_(n) unsigned *  q 
)

◆ SWAP()

MICROSOFT_QUANTUM_DECL void SWAP ( _In_ unsigned  sid,
_In_ unsigned  qi1,
_In_ unsigned  qi2 
)

◆ SwapShardValues()

void SwapShardValues ( bitLenInt  v1,
bitLenInt  v2,
std::map< unsigned, bitLenInt > &  simMap 
)

◆ T()

MICROSOFT_QUANTUM_DECL void T ( _In_ unsigned  sid,
_In_ unsigned  q 
)

(External API) "T" Gate

◆ TransformPauliBasis()

void TransformPauliBasis ( QInterfacePtr  simulator,
unsigned  len,
int *  bases,
unsigned *  qubitIds 
)

◆ TrySeparate1Qb()

MICROSOFT_QUANTUM_DECL bool TrySeparate1Qb ( _In_ unsigned  sid,
_In_ unsigned  qi1 
)

◆ TrySeparate2Qb()

MICROSOFT_QUANTUM_DECL bool TrySeparate2Qb ( _In_ unsigned  sid,
_In_ unsigned  qi1,
_In_ unsigned  qi2 
)

◆ TrySeparateTol()

MICROSOFT_QUANTUM_DECL bool TrySeparateTol ( _In_ unsigned  sid,
_In_ unsigned  n,
_In_reads_(n) unsigned *  q,
_In_ double  tol 
)

◆ U()

MICROSOFT_QUANTUM_DECL void U ( _In_ unsigned  sid,
_In_ unsigned  q,
_In_ double  theta,
_In_ double  phi,
_In_ double  lambda 
)

(External API) 3-parameter unitary gate

◆ X()

MICROSOFT_QUANTUM_DECL void X ( _In_ unsigned  sid,
_In_ unsigned  q 
)

(External API) "X" Gate

◆ XNOR()

MICROSOFT_QUANTUM_DECL void XNOR ( _In_ unsigned  sid,
_In_ unsigned  qi1,
_In_ unsigned  qi2,
_In_ unsigned  qo 
)

◆ XOR()

MICROSOFT_QUANTUM_DECL void XOR ( _In_ unsigned  sid,
_In_ unsigned  qi1,
_In_ unsigned  qi2,
_In_ unsigned  qo 
)

◆ Y()

MICROSOFT_QUANTUM_DECL void Y ( _In_ unsigned  sid,
_In_ unsigned  q 
)

(External API) "Y" Gate

◆ Z()

MICROSOFT_QUANTUM_DECL void Z ( _In_ unsigned  sid,
_In_ unsigned  q 
)

(External API) "Z" Gate

Variable Documentation

◆ _maxShardQubits

bitLenInt _maxShardQubits = 0

◆ metaOperationMutex

std::mutex metaOperationMutex

◆ randNumGen

qrack_rand_gen_ptr randNumGen = std::make_shared<qrack_rand_gen>(time(0))

◆ shards

std::map<QInterface*, std::map<unsigned, bitLenInt> > shards

◆ simulatorErrors

std::vector<int> simulatorErrors

◆ simulatorHostPointer

std::vector<bool> simulatorHostPointer

◆ simulatorMutexes

std::map<QInterface*, std::mutex> simulatorMutexes

◆ simulatorReservations

std::vector<bool> simulatorReservations

◆ simulators

std::vector<QInterfacePtr> simulators

◆ simulatorTypes

std::vector<std::vector<QInterfaceEngine> > simulatorTypes