Qrack
9.13
General classical-emulating-quantum development framework
|
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. More...
Classes | |
union | complex2 |
SIMD implementation of the double precision complex vector type of 2 complex numbers, only for AVX Apply2x2. More... | |
class | DispatchQueue |
struct | OCLKernelHandle |
class | OCLDeviceCall |
class | OCLDeviceContext |
struct | InitOClResult |
class | OCLEngine |
"Qrack::OCLEngine" manages the single OpenCL context. More... | |
class | ParallelFor |
class | RandSupportSingleton |
class | RdRandom |
struct | HamiltonianOp |
A Hamiltonian can be specified in terms of arbitrary controlled single bit gates, each one an "HamiltonianOp.". More... | |
struct | UniformHamiltonianOp |
struct | MpsShard |
class | QAlu |
class | QBdt |
class | QBdtNode |
class | QBdtNodeInterface |
class | QBdtHybrid |
A "Qrack::QBdtHybrid" internally switched between Qrack::QBdt and Qrack::QHybrid to maximize entanglement-dependent performance. More... | |
struct | QCircuitGate |
class | QCircuit |
class | QEngine |
Abstract QEngine implementation, for all "Schroedinger method" engines. More... | |
class | QEngineCPU |
General purpose QEngineCPU implementation. More... | |
struct | QueueItem |
class | PoolItem |
class | QEngineCUDA |
OpenCL enhanced QEngineCPU implementation. More... | |
class | bad_alloc |
class | QEngineOCL |
OpenCL enhanced QEngineCPU implementation. More... | |
struct | PhaseShard |
Caches controlled gate phase between shards, (as a case of "gate fusion" optimization particularly useful to QUnit) More... | |
class | QEngineShard |
Associates a QInterface object with a set of bits. More... | |
class | QEngineShardMap |
class | QHybrid |
A "Qrack::QHybrid" internally switched between Qrack::QEngineCPU and Qrack::QEngineOCL to maximize qubit-count-dependent performance. More... | |
class | QInterface |
A "Qrack::QInterface" is an abstract interface exposing qubit permutation state vector with methods to operate on it as by gates and register-like instructions. More... | |
class | QInterfaceNoisy |
A "Qrack::QInterfaceNoisy" that wraps any other QInterface with a simple noise model. More... | |
class | QNeuron |
class | QPager |
A "Qrack::QPager" splits a "Qrack::QEngine" implementation into equal-length "pages." This helps both optimization and distribution of a single coherent quantum register across multiple devices. More... | |
class | QParity |
struct | AmplitudeEntry |
class | QStabilizer |
struct | QUnitCliffordAmp |
class | QStabilizerHybrid |
A "Qrack::QStabilizerHybrid" internally switched between Qrack::QStabilizer and Qrack::QEngine to maximize performance. More... | |
class | QTensorNetwork |
class | QubitSwapMap |
class | QUnit |
struct | CliffordShard |
class | QUnitClifford |
struct | QEngineInfo |
struct | DeviceInfo |
class | QUnitMulti |
struct | IdOffset |
struct | QUnitStateVector |
class | StateVector |
class | StateVectorArray |
struct | QubitIndexState |
struct | QubitIntegerExpVar |
struct | QubitRealExpVar |
struct | QubitPauliBasis |
struct | QubitU3Basis |
struct | QubitMatrixBasis |
struct | QubitU3BasisEigenVal |
struct | QubitMatrixBasisEigenVal |
struct | MapArithmeticResult2 |
Typedefs | |
typedef std::function< void(void)> | DispatchFn |
typedef std::shared_ptr< OCLDeviceContext > | DeviceContextPtr |
typedef std::vector< cl::Event > | EventVec |
typedef std::shared_ptr< EventVec > | EventVecPtr |
typedef half_float::half | real1 |
typedef float | real1_f |
typedef float | real1_s |
typedef std::complex< real1 > | complex |
typedef std::shared_ptr< complex > | BitOp |
typedef std::function< void(const bitCapIntOcl &, const unsigned &cpu)> | ParallelFunc |
typedef std::function< bitCapIntOcl(const bitCapIntOcl &)> | IncrementFunc |
typedef std::function< bitCapInt(const bitCapInt &)> | BdtFunc |
typedef std::function< void(const bitCapInt &, const unsigned &cpu)> | ParallelFuncBdt |
typedef std::shared_ptr< StateVector > | StateVectorPtr |
typedef std::shared_ptr< StateVectorArray > | StateVectorArrayPtr |
typedef std::shared_ptr< StateVectorSparse > | StateVectorSparsePtr |
typedef std::shared_ptr< QEngine > | QEnginePtr |
typedef std::shared_ptr< HamiltonianOp > | HamiltonianOpPtr |
To define a Hamiltonian, give a vector of controlled single bit gates ("HamiltonianOp" instances) that are applied by left-multiplication in low-to-high vector index order on the state vector. More... | |
typedef std::vector< HamiltonianOpPtr > | Hamiltonian |
typedef std::shared_ptr< MpsShard > | MpsShardPtr |
typedef std::shared_ptr< QAlu > | QAluPtr |
typedef std::shared_ptr< QBdt > | QBdtPtr |
typedef std::shared_ptr< QBdtNode > | QBdtNodePtr |
typedef std::shared_ptr< QBdtNodeInterface > | QBdtNodeInterfacePtr |
typedef std::shared_ptr< QBdtHybrid > | QBdtHybridPtr |
typedef std::shared_ptr< QCircuitGate > | QCircuitGatePtr |
typedef std::shared_ptr< QCircuit > | QCircuitPtr |
typedef std::shared_ptr< QEngineCPU > | QEngineCPUPtr |
typedef unsigned long | cl_map_flags |
typedef unsigned long | cl_mem_flags |
typedef std::shared_ptr< void > | BufferPtr |
typedef std::shared_ptr< QEngineCUDA > | QEngineCUDAPtr |
typedef std::shared_ptr< PoolItem > | PoolItemPtr |
typedef std::shared_ptr< QEngineOCL > | QEngineOCLPtr |
typedef QEngineShard * | QEngineShardPtr |
typedef std::shared_ptr< PhaseShard > | PhaseShardPtr |
typedef std::map< QEngineShardPtr, PhaseShardPtr > | ShardToPhaseMap |
typedef std::shared_ptr< QHybrid > | QHybridPtr |
typedef std::shared_ptr< QInterface > | QInterfacePtr |
typedef std::shared_ptr< QInterfaceNoisy > | QInterfaceNoisyPtr |
typedef std::shared_ptr< QNeuron > | QNeuronPtr |
typedef std::shared_ptr< QPager > | QPagerPtr |
typedef std::shared_ptr< QParity > | QParityPtr |
typedef std::shared_ptr< QStabilizer > | QStabilizerPtr |
typedef std::shared_ptr< QStabilizerHybrid > | QStabilizerHybridPtr |
typedef std::shared_ptr< QTensorNetwork > | QTensorNetworkPtr |
typedef std::shared_ptr< QUnit > | QUnitPtr |
typedef std::shared_ptr< QUnitClifford > | QUnitCliffordPtr |
typedef std::shared_ptr< QUnitMulti > | QUnitMultiPtr |
typedef std::shared_ptr< QUnitStateVector > | QUnitStateVectorPtr |
typedef uint64_t | quid |
Functions | |
complex2 | mtrxColShuff (const complex2 &mtrxCol) |
complex2 | matrixMul (const complex2 &mtrxCol1, const complex2 &mtrxCol2, const complex2 &mtrxCol1Shuff, const complex2 &mtrxCol2Shuff, const complex2 &qubit) |
complex2 | matrixMul (const float &nrm, const complex2 &mtrxCol1, const complex2 &mtrxCol2, const complex2 &mtrxCol1Shuff, const complex2 &mtrxCol2Shuff, const complex2 &qubit) |
complex2 | operator* (const double &lhs, const complex2 &rhs) |
double | norm (const complex2 &c) |
complex2 | operator* (const float &lhs, const complex2 &rhs) |
bitLenInt | log2Ocl (bitCapIntOcl n) |
bitLenInt | popCountOcl (bitCapIntOcl n) |
int | bi_log2 (const bitCapInt &n) |
bitLenInt | log2 (bitCapInt n) |
bitCapInt | pow2 (const bitLenInt &p) |
bitCapIntOcl | pow2Ocl (const bitLenInt &p) |
bitCapInt | pow2Mask (const bitLenInt &p) |
bitCapIntOcl | pow2MaskOcl (const bitLenInt &p) |
bitCapInt | bitSlice (const bitLenInt &bit, const bitCapInt &source) |
bitCapIntOcl | bitSliceOcl (const bitLenInt &bit, const bitCapIntOcl &source) |
bitCapInt | bitRegMask (const bitLenInt &start, const bitLenInt &length) |
bitCapIntOcl | bitRegMaskOcl (const bitLenInt &start, const bitLenInt &length) |
bool | isPowerOfTwo (const bitCapInt &x) |
bool | isPowerOfTwoOcl (const bitCapIntOcl &x) |
bool | isBadBitRange (const bitLenInt &start, const bitLenInt &length, const bitLenInt &qubitCount) |
bool | isBadPermRange (const bitCapIntOcl &start, const bitCapIntOcl &length, const bitCapIntOcl &maxQPowerOcl) |
void | ThrowIfQbIdArrayIsBad (const std::vector< bitLenInt > &controls, const bitLenInt &qubitCount, std::string message) |
unsigned char * | cl_alloc (size_t ucharCount) |
void | cl_free (void *toFree) |
void | mul2x2 (const complex *left, const complex *right, complex *out) |
void | exp2x2 (const complex *matrix2x2, complex *outMatrix2x2) |
void | log2x2 (const complex *matrix2x2, complex *outMatrix2x2) |
void | inv2x2 (const complex *matrix2x2, complex *outMatrix2x2) |
bool | isOverflowAdd (bitCapIntOcl inOutInt, bitCapIntOcl inInt, const bitCapIntOcl &signMask, const bitCapIntOcl &lengthPower) |
Check if an addition with overflow sets the flag. More... | |
bool | isOverflowSub (bitCapIntOcl inOutInt, bitCapIntOcl inInt, const bitCapIntOcl &signMask, const bitCapIntOcl &lengthPower) |
Check if a subtraction with overflow sets the flag. More... | |
bitCapInt | pushApartBits (const bitCapInt &perm, const std::vector< bitCapInt > &skipPowers) |
bitCapInt | intPow (const bitCapInt &base, const bitCapInt &power) |
bitCapIntOcl | intPowOcl (bitCapIntOcl base, bitCapIntOcl power) |
bool | operator== (QBdtNodeInterfacePtr lhs, QBdtNodeInterfacePtr rhs) |
bool | operator!= (QBdtNodeInterfacePtr lhs, QBdtNodeInterfacePtr rhs) |
std::ostream & | operator<< (std::ostream &os, const QCircuitGatePtr g) |
std::istream & | operator>> (std::istream &os, QCircuitGatePtr &g) |
std::ostream & | operator<< (std::ostream &os, const QCircuitPtr g) |
std::istream & | operator>> (std::istream &os, QCircuitPtr &g) |
template<class BidirectionalIterator > | |
void | reverse (BidirectionalIterator first, BidirectionalIterator last, const bitCapInt &stride) |
template<class BidirectionalIterator > | |
void | rotate (BidirectionalIterator first, BidirectionalIterator middle, BidirectionalIterator last, const bitCapInt &stride) |
template<typename... Ts> | |
QInterfacePtr | CreateQuantumInterface (QInterfaceEngine engine1, QInterfaceEngine engine2, QInterfaceEngine engine3, Ts... args) |
Factory method to create specific engine implementations. More... | |
template<typename... Ts> | |
QInterfacePtr | CreateQuantumInterface (QInterfaceEngine engine1, QInterfaceEngine engine2, Ts... args) |
template<typename... Ts> | |
QInterfacePtr | CreateQuantumInterface (QInterfaceEngine engine, Ts... args) |
template<typename... Ts> | |
QInterfacePtr | CreateQuantumInterface (std::vector< QInterfaceEngine > engines, Ts... args) |
template<typename... Ts> | |
QInterfacePtr | CreateArrangedLayersFull (bool nw, bool md, bool sd, bool sh, bool bdt, bool pg, bool tn, bool hy, bool oc, Ts... args) |
template<typename... Ts> | |
QInterfacePtr | CreateArrangedLayers (bool md, bool sd, bool sh, bool bdt, bool pg, bool tn, bool hy, bool oc, Ts... args) |
quid | init_count_type (bitLenInt q, bool tn, bool md, bool sd, bool sh, bool bdt, bool pg, bool nw, bool hy, bool oc, bool hp) |
Options for simulator type in initialization (any set of options theoretically functions together): tn - "Tensor network" layer - JIT local circuit simplification, light-cone optimization md - "Multi-device" (TURN OFF IN SERIAL BUILDS) - distribute Schmidt-decomposed or factorized subsytems to different OpenCL devices. More... | |
quid | init_count (bitLenInt q, bool dm) |
"Default optimal" (BQP-complete-targeted) simulator type initialization (with "direct memory" option) More... | |
quid | init () |
"Quasi-default constructor" (for an empty simulator) More... | |
quid | init_clone (quid sid) |
"Clone" simulator (no-clone theorem does not apply to classical simulation) More... | |
quid | init_qbdd_count (bitLenInt q) |
"Default optimal" (BQP-complete-targeted) simulator type initialization (with "direct memory" option) More... | |
void | destroy (quid sid) |
"Destroy" or release simulator allocation More... | |
void | seed (quid sid, unsigned s) |
"Seed" random number generator (if pseudo-random Mersenne twister is in use) More... | |
void | set_concurrency (quid sid, unsigned p) |
Set CPU concurrency (if build isn't serial) More... | |
void | allocateQubit (quid sid, bitLenInt qid) |
Allocate new qubit with ID. More... | |
bool | release (quid sid, bitLenInt q) |
Release qubit ID. More... | |
bitLenInt | num_qubits (quid sid) |
Total count of qubits in simulator instance. More... | |
void | SetPermutation (quid sid, bitCapInt p) |
Set bit string permutation eigenstate of simulator instance. More... | |
void | qstabilizer_out_to_file (quid sid, std::string f) |
Output stabilizer simulation tableau to file (or raise exception for "get_error()" if incompatible simulator type) More... | |
void | qstabilizer_in_from_file (quid sid, std::string f) |
Initialize stabilizer simulation from a tableau file (or raise exception for "get_error()" if incompatible simulator type) More... | |
std::vector< real1 > | ProbAll (quid sid, std::vector< bitLenInt > q) |
Get the probabilities of all permutations of the requested subset of qubits. More... | |
real1_f | Prob (quid sid, bitLenInt q) |
Z-basis expectation value of qubit. More... | |
real1_f | ProbRdm (quid sid, bitLenInt q) |
"Reduced density matrix" Z-basis expectation value of qubit More... | |
real1_f | PermutationProb (quid sid, std::vector< QubitIndexState > q) |
Probability of specified (single) permutation of any arbitrary group of qubits. More... | |
real1_f | PermutationProbRdm (quid sid, std::vector< QubitIndexState > q, bool r) |
"Reduced density matrix" probability of specified (single) permutation of any arbitrary group of qubits More... | |
real1_f | PermutationExpectation (quid sid, std::vector< bitLenInt > q) |
Expectation value for bit-string integer equivalent of specified arbitrary group of qubits. More... | |
real1_f | PermutationExpectationRdm (quid sid, std::vector< bitLenInt > q, bool r) |
"Reduced density matrix" expectation value for bit-string integer equivalent of specified arbitrary group of qubits More... | |
real1_f | FactorizedExpectation (quid sid, std::vector< QubitIntegerExpVar > q) |
Expectation value for bit-string integer from group of qubits with per-qubit integer expectation value. More... | |
real1_f | FactorizedExpectationRdm (quid sid, std::vector< QubitIntegerExpVar > q, bool r) |
"Reduced density matrix" Expectation value for bit-string integer from group of qubits with per-qubit integer expectation value More... | |
real1_f | FactorizedExpectationFp (quid sid, std::vector< QubitRealExpVar > q) |
Expectation value for bit-string integer from group of qubits with per-qubit real1 expectation value. More... | |
real1_f | FactorizedExpectationFpRdm (quid sid, std::vector< QubitRealExpVar > q, bool r) |
"Reduced density matrix" Expectation value for bit-string integer from group of qubits with per-qubit real1 expectation value More... | |
real1_f | UnitaryExpectation (quid sid, std::vector< QubitU3Basis > q) |
Get the single-qubit (3-parameter) operator expectation value for the array of qubits and bases. More... | |
real1_f | MatrixExpectation (quid sid, std::vector< QubitMatrixBasis > q) |
Get the single-qubit (2x2) operator expectation value for the array of qubits and bases. More... | |
real1_f | UnitaryExpectationEigenVal (quid sid, std::vector< QubitU3BasisEigenVal > q) |
Get the single-qubit (3-parameter) operator expectation value for the array of qubits and bases. More... | |
real1_f | MatrixExpectationEigenVal (quid sid, std::vector< QubitMatrixBasisEigenVal > q) |
Get the single-qubit (2x2) operator expectation value for the array of qubits and bases. More... | |
real1_f | PauliExpectation (quid sid, std::vector< QubitPauliBasis > q) |
Pauli operator expectation value for the array of qubits and bases. More... | |
real1_f | Variance (quid sid, std::vector< bitLenInt > q) |
Variance for bit-string integer equivalent of specified arbitrary group of qubits. More... | |
real1_f | VarianceRdm (quid sid, std::vector< bitLenInt > q, bool r) |
"Reduced density matrix" variance for bit-string integer equivalent of specified arbitrary group of qubits More... | |
real1_f | FactorizedVariance (quid sid, std::vector< QubitIntegerExpVar > q) |
Variance for bit-string integer from group of qubits with per-qubit integer variance. More... | |
real1_f | FactorizedVarianceRdm (quid sid, std::vector< QubitIntegerExpVar > q, bool r) |
"Reduced density matrix" variance for bit-string integer from group of qubits with per-qubit integer variance More... | |
real1_f | FactorizedVarianceFp (quid sid, std::vector< QubitRealExpVar > q) |
Variance for bit-string integer from group of qubits with per-qubit real1 variance. More... | |
real1_f | FactorizedVarianceFpRdm (quid sid, std::vector< QubitRealExpVar > q, bool r) |
"Reduced density matrix" variance for bit-string integer from group of qubits with per-qubit real1 variance More... | |
real1_f | UnitaryVariance (quid sid, std::vector< QubitU3Basis > q) |
Get the single-qubit (3-parameter) operator variance for the array of qubits and bases. More... | |
real1_f | MatrixVariance (quid sid, std::vector< QubitMatrixBasis > q) |
Get the single-qubit (2x2) operator variance for the array of qubits and bases. More... | |
real1_f | UnitaryVarianceEigenVal (quid sid, std::vector< QubitU3BasisEigenVal > q) |
Get the single-qubit (3-parameter) operator variance for the array of qubits and bases. More... | |
real1_f | MatrixVarianceEigenVal (quid sid, std::vector< QubitMatrixBasisEigenVal > q) |
Get the single-qubit (2x2) operator variance for the array of qubits and bases. More... | |
real1_f | PauliVariance (quid sid, std::vector< QubitPauliBasis > q) |
Pauli operator variance for the array of qubits and bases. More... | |
size_t | random_choice (quid sid, std::vector< real1 > p) |
Select from a distribution of "p.size()" count of elements according to the discrete probabilities in "p.". More... | |
void | PhaseParity (quid sid, real1_f lambda, std::vector< bitLenInt > q) |
Applies e^(i*angle) phase factor to all combinations of bits with odd parity, based upon permutations of qubits. More... | |
void | PhaseRootN (quid sid, bitLenInt p, std::vector< bitLenInt > q) |
Applies a -2 * PI_R1 / (2^N) phase rotation to each qubit. More... | |
real1_f | JointEnsembleProbability (quid sid, std::vector< QubitPauliBasis > q) |
Overall probability of any odd permutation of the masked set of bits. More... | |
bool | M (quid sid, bitLenInt q) |
Measure single qubit (according to Born rules) and return the result. More... | |
bool | ForceM (quid sid, bitLenInt q, bool r) |
(PSEUDO-QUANTUM:) Force measurement result of single qubit (and return the result) More... | |
bool | Measure (quid sid, std::vector< QubitPauliBasis > q) |
Each in its specified Pauli basis, collapse an ensemble of qubits jointly via measurement. More... | |
bitCapInt | MAll (quid sid) |
Measure all qubits (according to Born rules) and return the result as a bit string (integer). More... | |
std::vector< long long unsigned int > | MeasureShots (quid sid, std::vector< bitLenInt > q, unsigned s) |
Repeat (Z-basis) measurement of a set of qubits for a count of "shots" (without collapsing the simulator) More... | |
void | ResetAll (quid sid) |
Set simulator to |0> permutation state. More... | |
void | X (quid sid, bitLenInt q) |
(External API) "X" Gate More... | |
void | Y (quid sid, bitLenInt q) |
(External API) "Y" Gate More... | |
void | Z (quid sid, bitLenInt q) |
(External API) "Z" Gate More... | |
void | H (quid sid, bitLenInt q) |
(External API) Walsh-Hadamard transform applied for simulator ID and qubit ID More... | |
void | S (quid sid, bitLenInt q) |
(External API) "S" Gate More... | |
void | SX (quid sid, bitLenInt q) |
(External API) Square root of X gate More... | |
void | SY (quid sid, bitLenInt q) |
(External API) Square root of Y gate More... | |
void | T (quid sid, bitLenInt q) |
(External API) "T" Gate More... | |
void | AdjS (quid sid, bitLenInt q) |
(External API) Inverse "S" Gate More... | |
void | AdjSX (quid sid, bitLenInt q) |
(External API) Inverse square root of X gate More... | |
void | AdjSY (quid sid, bitLenInt q) |
(External API) Inverse square root of Y gate More... | |
void | AdjT (quid sid, bitLenInt q) |
(External API) Inverse "T" Gate More... | |
void | U (quid sid, bitLenInt q, real1_f theta, real1_f phi, real1_f lambda) |
(External API) 3-parameter unitary gate More... | |
void | Mtrx (quid sid, std::vector< complex > m, bitLenInt q) |
(External API) 2x2 complex matrix unitary gate More... | |
void | MCX (quid sid, std::vector< bitLenInt > c, bitLenInt q) |
(External API) Controlled "X" Gate More... | |
void | MCY (quid sid, std::vector< bitLenInt > c, bitLenInt q) |
(External API) Controlled "Y" Gate More... | |
void | MCZ (quid sid, std::vector< bitLenInt > c, bitLenInt q) |
(External API) Controlled "Z" Gate More... | |
void | MCH (quid sid, std::vector< bitLenInt > c, bitLenInt q) |
(External API) Controlled "H" Gate More... | |
void | MCS (quid sid, std::vector< bitLenInt > c, bitLenInt q) |
(External API) Controlled "S" Gate More... | |
void | MCT (quid sid, std::vector< bitLenInt > c, bitLenInt q) |
(External API) Controlled "T" Gate More... | |
void | MCAdjS (quid sid, std::vector< bitLenInt > c, bitLenInt q) |
(External API) Controlled Inverse "S" Gate More... | |
void | MCAdjT (quid sid, std::vector< bitLenInt > c, bitLenInt q) |
(External API) Controlled Inverse "T" Gate More... | |
void | MCU (quid sid, std::vector< bitLenInt > c, bitLenInt q, real1_f theta, real1_f phi, real1_f lambda) |
(External API) Controlled 3-parameter unitary gate More... | |
void | MCMtrx (quid sid, std::vector< bitLenInt > c, std::vector< complex > m, bitLenInt q) |
(External API) Controlled 2x2 complex matrix unitary gate More... | |
void | MACX (quid sid, std::vector< bitLenInt > c, bitLenInt q) |
(External API) "Anti-"Controlled "X" Gate More... | |
void | MACY (quid sid, std::vector< bitLenInt > c, bitLenInt q) |
(External API) "Anti-"Controlled "Y" Gate More... | |
void | MACZ (quid sid, std::vector< bitLenInt > c, bitLenInt q) |
(External API) "Anti-"Controlled "Z" Gate More... | |
void | MACH (quid sid, std::vector< bitLenInt > c, bitLenInt q) |
(External API) "Anti-"Controlled "H" Gate More... | |
void | MACS (quid sid, std::vector< bitLenInt > c, bitLenInt q) |
(External API) "Anti-"Controlled "S" Gate More... | |
void | MACT (quid sid, std::vector< bitLenInt > c, bitLenInt q) |
(External API) "Anti-"Controlled "T" Gate More... | |
void | MACAdjS (quid sid, std::vector< bitLenInt > c, bitLenInt q) |
(External API) "Anti-"Controlled Inverse "S" Gate More... | |
void | MACAdjT (quid sid, std::vector< bitLenInt > c, bitLenInt q) |
(External API) "Anti-"Controlled Inverse "T" Gate More... | |
void | MACU (quid sid, std::vector< bitLenInt > c, bitLenInt q, real1_f theta, real1_f phi, real1_f lambda) |
(External API) Controlled 3-parameter unitary gate More... | |
void | MACMtrx (quid sid, std::vector< bitLenInt > c, std::vector< complex > m, bitLenInt q) |
(External API) Controlled 2x2 complex matrix unitary gate More... | |
void | UCMtrx (quid sid, std::vector< bitLenInt > c, std::vector< complex > m, bitLenInt q, bitCapIntOcl p) |
Multi-controlled gate that activates only for the specified permutation of controls, "p". More... | |
void | Multiplex1Mtrx (quid sid, std::vector< bitLenInt > c, bitLenInt q, std::vector< complex > m) |
Multi-controlled, single-target multiplexer gate. More... | |
void | MX (quid sid, std::vector< bitLenInt > q) |
(External API) Multiple "X" Gate More... | |
void | MY (quid sid, std::vector< bitLenInt > q) |
(External API) Multiple "Y" Gate More... | |
void | MZ (quid sid, std::vector< bitLenInt > q) |
(External API) Multiple "Z" Gate More... | |
void | R (quid sid, real1_f phi, QubitPauliBasis q) |
(External API) Rotation around Pauli axes More... | |
void | MCR (quid sid, real1_f phi, std::vector< bitLenInt > c, QubitPauliBasis q) |
(External API) Controlled rotation around Pauli axes More... | |
void | Exp (quid sid, real1_f phi, std::vector< QubitPauliBasis > q) |
(External API) Exponentiation of Pauli operators More... | |
void | MCExp (quid sid, real1_f phi, std::vector< bitLenInt > cs, std::vector< QubitPauliBasis > q) |
(External API) Controlled exponentiation of Pauli operators More... | |
void | SWAP (quid sid, bitLenInt qi1, bitLenInt qi2) |
void | ISWAP (quid sid, bitLenInt qi1, bitLenInt qi2) |
void | AdjISWAP (quid sid, bitLenInt qi1, bitLenInt qi2) |
void | FSim (quid sid, real1_f theta, real1_f phi, bitLenInt qi1, bitLenInt qi2) |
void | CSWAP (quid sid, std::vector< bitLenInt > c, bitLenInt qi1, bitLenInt qi2) |
void | ACSWAP (quid sid, std::vector< bitLenInt > c, bitLenInt qi1, bitLenInt qi2) |
void | Compose (quid sid1, quid sid2, std::vector< bitLenInt > q) |
quid | Decompose (quid sid, std::vector< bitLenInt > q) |
void | Dispose (quid sid, std::vector< bitLenInt > q) |
void | AND (quid sid, bitLenInt qi1, bitLenInt qi2, bitLenInt qo) |
void | OR (quid sid, bitLenInt qi1, bitLenInt qi2, bitLenInt qo) |
void | XOR (quid sid, bitLenInt qi1, bitLenInt qi2, bitLenInt qo) |
void | NAND (quid sid, bitLenInt qi1, bitLenInt qi2, bitLenInt qo) |
void | NOR (quid sid, bitLenInt qi1, bitLenInt qi2, bitLenInt qo) |
void | XNOR (quid sid, bitLenInt qi1, bitLenInt qi2, bitLenInt qo) |
void | CLAND (quid sid, bool ci, bitLenInt qi, bitLenInt qo) |
void | CLOR (quid sid, bool ci, bitLenInt qi, bitLenInt qo) |
void | CLXOR (quid sid, bool ci, bitLenInt qi, bitLenInt qo) |
void | CLNAND (quid sid, bool ci, bitLenInt qi, bitLenInt qo) |
void | CLNOR (quid sid, bool ci, bitLenInt qi, bitLenInt qo) |
void | CLXNOR (quid sid, bool ci, bitLenInt qi, bitLenInt qo) |
void | QFT (quid sid, std::vector< bitLenInt > q) |
Quantum Fourier Transform. More... | |
void | IQFT (quid sid, std::vector< bitLenInt > q) |
(Inverse) Quantum Fourier Transform More... | |
void | ADD (quid sid, bitCapInt a, std::vector< bitLenInt > q) |
void | SUB (quid sid, bitCapInt a, std::vector< bitLenInt > q) |
void | ADDS (quid sid, bitCapInt a, bitLenInt s, std::vector< bitLenInt > q) |
void | SUBS (quid sid, bitCapInt a, bitLenInt s, std::vector< bitLenInt > q) |
void | MCADD (quid sid, bitCapInt a, std::vector< bitLenInt > c, std::vector< bitLenInt > q) |
void | MCSUB (quid sid, bitCapInt a, std::vector< bitLenInt > c, std::vector< bitLenInt > q) |
void | MUL (quid sid, bitCapInt a, std::vector< bitLenInt > q, std::vector< bitLenInt > o) |
void | DIV (quid sid, bitCapInt a, std::vector< bitLenInt > q, std::vector< bitLenInt > o) |
void | MULN (quid sid, bitCapInt a, bitCapInt m, std::vector< bitLenInt > q, std::vector< bitLenInt > o) |
void | DIVN (quid sid, bitCapInt a, bitCapInt m, std::vector< bitLenInt > q, std::vector< bitLenInt > o) |
void | POWN (quid sid, bitCapInt a, bitCapInt m, std::vector< bitLenInt > q, std::vector< bitLenInt > o) |
void | MCMUL (quid sid, bitCapInt a, std::vector< bitLenInt > c, std::vector< bitLenInt > q, std::vector< bitLenInt > o) |
void | MCDIV (quid sid, bitCapInt a, std::vector< bitLenInt > c, std::vector< bitLenInt > q, std::vector< bitLenInt > o) |
void | MCMULN (quid sid, bitCapInt a, std::vector< bitLenInt > c, bitCapInt m, std::vector< bitLenInt > q, std::vector< bitLenInt > o) |
void | MCDIVN (quid sid, bitCapInt a, std::vector< bitLenInt > c, bitCapInt m, std::vector< bitLenInt > q, std::vector< bitLenInt > o) |
void | MCPOWN (quid sid, bitCapInt a, std::vector< bitLenInt > c, bitCapInt m, std::vector< bitLenInt > q, std::vector< bitLenInt > o) |
bool | TrySeparate1Qb (quid sid, bitLenInt qi1) |
Try to factorize a single-qubit subsystem out of "bulk" simulator state. More... | |
bool | TrySeparate2Qb (quid sid, bitLenInt qi1, bitLenInt qi2) |
Try to factorize a two-qubit subsystem out of "bulk" simulator state. More... | |
bool | TrySeparateTol (quid sid, std::vector< bitLenInt > q, real1_f tol) |
Try to factorize a qubit subsystem out of "bulk" simulator state. More... | |
void | Separate (quid sid, std::vector< bitLenInt > q) |
Force (inexact) factorization of qubit subsystem out of "bulk" simulator state. More... | |
double | GetUnitaryFidelity (quid sid) |
Report fidelity for "Schmidt decomposition rounding parameter" (SDRP) and "near-Clifford rounding". More... | |
void | ResetUnitaryFidelity (quid sid) |
Reset fidelity to 1 for "Schmidt decomposition rounding parameter" (SDRP) and "near-Clifford rounding". More... | |
void | SetSdrp (quid sid, double sdrp) |
Set "Schmidt decomposition rounding parameter" (SDRP) value (see https://arxiv.org/abs/2304.14969) More... | |
void | SetNcrp (quid sid, double sdrp) |
Set "Near-Clifford rounding parameter". More... | |
void | SetReactiveSeparate (quid sid, bool irs) |
Turn off/on "reactive separation" feature (for less/more aggressive automatic state factorization) More... | |
void | SetTInjection (quid sid, bool iti) |
Turn off/on "T-injection" feature (for "near-Clifford" simulation with RZ gates) More... | |
void | SetNoiseParameter (quid sid, double np) |
Set noise parameter (for QInterfaceNoisy) More... | |
void | Normalize (quid sid) |
Normalize the state (which should never be necessary unless Decompose() is "abused") More... | |
quid | init_qneuron (quid sid, std::vector< bitLenInt > c, bitLenInt q, QNeuronActivationFn f, real1_f a, real1_f tol) |
Initialize a "quantum neuron" that takes a list of qubit "controls" for input and acts on a single "target" output qubit. More... | |
quid | clone_qneuron (quid nid) |
"Clone" a quantum neuron (which is a classical state) More... | |
void | destroy_qneuron (quid nid) |
"Destroy" or release simulator allocation More... | |
void | set_qneuron_angles (quid nid, std::vector< real1 > angles) |
Set the (RY-rotation) angle parameters for each permutation of quantum neuron input qubits. More... | |
std::vector< real1 > | get_qneuron_angles (quid nid) |
Get the (RY-rotation) angle parameters for each permutation of quantum neuron input qubits. More... | |
void | set_qneuron_alpha (quid nid, real1_f alpha) |
Set the "leakage" parameter for "leaky" quantum neuron activation functions. More... | |
real1_f | get_qneuron_alpha (quid nid) |
Get the "leakage" parameter for "leaky" quantum neuron activation functions. More... | |
void | set_qneuron_activation_fn (quid nid, QNeuronActivationFn f) |
Set the activation function for a quantum neuron. More... | |
QNeuronActivationFn | get_qneuron_activation_fn (quid nid) |
Get the activation function for a quantum neuron. More... | |
real1_f | qneuron_predict (quid nid, bool e, bool r) |
Infer quantum neuron output from inputs (after training) More... | |
real1_f | qneuron_unpredict (quid nid, bool e) |
Perform the inverse of quantum neuron inference (for "uncomputation") More... | |
real1_f | qneuron_learn_cycle (quid nid, bool e) |
Train a quantum neuron for one epoch, and also uncompute the intermediate side-effects. More... | |
void | qneuron_learn (quid nid, real1_f eta, bool e, bool r) |
Train a quantum neuron for one epoh (without uncomputing any intermediate side-effects) More... | |
void | qneuron_learn_permutation (quid nid, real1_f eta, bool e, bool r) |
Train a quantum neuron for one epoch, assuming that the input state is a Z-basis eigenstate. More... | |
quid | init_qcircuit (bool collapse, bool clifford) |
quid | init_qcircuit_clone (quid cid) |
quid | qcircuit_inverse (quid cid) |
quid | qcircuit_past_light_cone (quid cid, std::set< bitLenInt > q) |
void | destroy_qcircuit (quid cid) |
bitLenInt | get_qcircuit_qubit_count (quid cid) |
void | qcircuit_swap (quid cid, bitLenInt q1, bitLenInt q2) |
void | qcircuit_append_1qb (quid cid, std::vector< complex > m, bitLenInt q) |
void | qcircuit_append_mc (quid cid, std::vector< complex > m, std::vector< bitLenInt > c, bitLenInt q, bitCapInt p) |
void | qcircuit_run (quid cid, quid sid) |
void | qcircuit_out_to_file (quid cid, std::string f) |
void | qcircuit_in_from_file (quid cid, std::string f) |
std::string | qcircuit_out_to_string (quid cid) |
void | _expLog2x2 (const complex *matrix2x2, complex *outMatrix2x2, bool isExp) |
std::vector< std::string > | _readDirectoryFileNames (const std::string &path) |
std::string | _getDefaultRandomNumberFilePath () |
void CL_CALLBACK | _PopQueue (cl_event event, cl_int type, void *user_data) |
REG_GATE_1 (H) | |
Apply Hadamard gate to each bit in "length," starting from bit index "start". More... | |
real1_f | dyadAngle (int numerator, int denomPower) |
std::ostream & | operator<< (std::ostream &os, const QStabilizerPtr s) |
std::istream & | operator>> (std::istream &is, const QStabilizerPtr s) |
std::ostream & | operator<< (std::ostream &os, const QStabilizerHybridPtr s) |
std::istream & | operator>> (std::istream &is, const QStabilizerHybridPtr s) |
std::ostream & | operator<< (std::ostream &os, const QUnitCliffordPtr s) |
std::istream & | operator>> (std::istream &is, const QUnitCliffordPtr s) |
bitLenInt | GetSimShardId (QInterfacePtr simulator, bitLenInt i) |
void | FillSimShards (QInterfacePtr simulator) |
void | TransformPauliBasis (QInterfacePtr simulator, std::vector< QubitPauliBasis > qb) |
void | RevertPauliBasis (QInterfacePtr simulator, std::vector< QubitPauliBasis > qb) |
void | removeIdentities (std::vector< QubitPauliBasis > *qb) |
void | RHelper (quid sid, real1_f phi, QubitPauliBasis qb) |
void | MCRHelper (quid sid, real1_f phi, std::vector< bitLenInt > c, QubitPauliBasis qb) |
size_t | make_mask (std::vector< QubitPauliBasis > const &qs) |
std::map< quid, bitLenInt >::iterator | FindShardValue (bitLenInt v, std::map< quid, bitLenInt > &simMap) |
void | SwapShardValues (bitLenInt v1, bitLenInt v2, std::map< quid, bitLenInt > &simMap) |
bitLenInt | MapArithmetic (QInterfacePtr simulator, std::vector< bitLenInt > q) |
MapArithmeticResult2 | MapArithmetic2 (QInterfacePtr simulator, std::vector< bitLenInt > q1, std::vector< bitLenInt > q2) |
MapArithmeticResult2 | MapArithmetic3 (QInterfacePtr simulator, std::vector< bitLenInt > q1, std::vector< bitLenInt > q2) |
quid | init_clone_size (quid sid, bitLenInt n) |
void | _PhaseMask (quid sid, real1_f lambda, bitLenInt p, std::vector< bitLenInt > q, bool isParity) |
real1_f | _JointEnsembleProbabilityHelper (QInterfacePtr simulator, std::vector< QubitPauliBasis > q, bool doMeasure) |
real1_f | _Prob (quid sid, bitLenInt q, bool isRdm) |
real1_f | _PermutationProb (quid sid, std::vector< QubitIndexState > q, bool isRdm, bool r) |
real1_f | _PermutationExpVar (quid sid, std::vector< bitLenInt > q, bool r, bool isRdm, bool isExp) |
real1_f | FactorizedExpVar (bool isExp, bool isRdm, quid sid, std::vector< QubitIntegerExpVar > q, bool r) |
real1_f | FactorizedExpVarFp (bool isExp, bool isRdm, quid sid, std::vector< QubitRealExpVar > q, bool r) |
real1_f | UnitaryExpVar (bool isExp, quid sid, std::vector< QubitU3Basis > q) |
real1_f | MatrixExpVar (bool isExp, quid sid, std::vector< QubitMatrixBasis > q) |
real1_f | UnitaryExpVarEigenVal (bool isExp, quid sid, std::vector< QubitU3BasisEigenVal > q) |
real1_f | MatrixExpVarEigenVal (bool isExp, quid sid, std::vector< QubitMatrixBasisEigenVal > q) |
real1_f | PauliExpVar (bool isExp, quid sid, std::vector< QubitPauliBasis > q) |
quid | _init_qcircuit_copy (quid cid, bool isInverse, std::set< bitLenInt > q) |
void | qcircuit_append_1qb (quid cid, std::vector< real1_f > m, bitLenInt q) |
void | qcircuit_append_mc (quid cid, std::vector< real1_f > m, std::vector< bitLenInt > c, bitLenInt q, bitCapInt p) |
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.
typedef std::function<bitCapInt(const bitCapInt&)> Qrack::BdtFunc |
typedef std::shared_ptr<complex> Qrack::BitOp |
typedef std::shared_ptr< cl::Buffer > Qrack::BufferPtr |
typedef unsigned long Qrack::cl_map_flags |
typedef unsigned long Qrack::cl_mem_flags |
typedef std::complex<real1> Qrack::complex |
typedef std::shared_ptr<OCLDeviceContext> Qrack::DeviceContextPtr |
typedef std::function< void(void)> Qrack::DispatchFn |
typedef std::vector<cl::Event> Qrack::EventVec |
typedef std::shared_ptr<EventVec> Qrack::EventVecPtr |
typedef std::vector<HamiltonianOpPtr> Qrack::Hamiltonian |
typedef std::shared_ptr<HamiltonianOp> Qrack::HamiltonianOpPtr |
To define a Hamiltonian, give a vector of controlled single bit gates ("HamiltonianOp" instances) that are applied by left-multiplication in low-to-high vector index order on the state vector.
To specify Hamiltonians with interaction terms, arbitrary sets of control bits may be specified for each term, in which case the term is acted only if the (superposable) control bits are true. The "antiCtrled" bool flips the overall convention, such that the term is acted only if all control bits are false. Additionally, for a combination of control bits and "anti-control" bits, an array of booleans, "ctrlToggles," of length "ctrlLen" may be specified that flips the activation state for each control bit, (relative the global anti- on/off convention,) without altering the state of the control bits.
The point of this "toggle" behavior is to allow enumeration of arbitrary local Hamiltonian terms with permutations of a set of control bits. For example, a Hamiltonian might represent an array of local electromagnetic potential wells. If there are 4 wells, each with independent potentials, control "toggles" could be used on two control bits, to enumerate all four permutations of two control bits with four different local Hamiltonian terms.
As a general point of linear algebra, where A and B are linear operators, e^{i * (A + B) * t} = e^{i * A * t} * e^{i * B * t} might NOT hold, if the operators A and B do not commute. As a rule of thumb, A will commute with B at least in the case that A and B act on entirely different sets of qubits. However, for defining the intended Hamiltonian, the programmer can be guaranteed that the exponential factors will be applied right-to-left, by left multiplication, in the order e^(i * H_(N - 1) * t) * e^(i * H_(N - 2) * t) * ... e^(i * H_0 * t) * |psi>. (For example, if A and B are single bit gates acting on the same bit, form their composition into one gate by the intended right-to-left fusion and apply them as a single HamiltonianOp.)
typedef std::function<bitCapIntOcl(const bitCapIntOcl&)> Qrack::IncrementFunc |
typedef std::shared_ptr<MpsShard> Qrack::MpsShardPtr |
typedef std::function<void(const bitCapIntOcl&, const unsigned& cpu)> Qrack::ParallelFunc |
typedef std::function<void(const bitCapInt&, const unsigned& cpu)> Qrack::ParallelFuncBdt |
typedef std::shared_ptr<PhaseShard> Qrack::PhaseShardPtr |
typedef std::shared_ptr< PoolItem > Qrack::PoolItemPtr |
typedef std::shared_ptr<QAlu> Qrack::QAluPtr |
typedef std::shared_ptr<QBdtHybrid> Qrack::QBdtHybridPtr |
typedef std::shared_ptr<QBdtNodeInterface> Qrack::QBdtNodeInterfacePtr |
typedef std::shared_ptr<QBdtNode> Qrack::QBdtNodePtr |
typedef std::shared_ptr<QBdt> Qrack::QBdtPtr |
typedef std::shared_ptr<QCircuitGate> Qrack::QCircuitGatePtr |
typedef std::shared_ptr<QCircuit> Qrack::QCircuitPtr |
typedef std::shared_ptr<QEngineCPU> Qrack::QEngineCPUPtr |
typedef std::shared_ptr<QEngineCUDA> Qrack::QEngineCUDAPtr |
typedef std::shared_ptr<QEngineOCL> Qrack::QEngineOCLPtr |
typedef std::shared_ptr< QEngine > Qrack::QEnginePtr |
typedef QEngineShard* Qrack::QEngineShardPtr |
typedef std::shared_ptr<QHybrid> Qrack::QHybridPtr |
typedef std::shared_ptr<QInterfaceNoisy> Qrack::QInterfaceNoisyPtr |
typedef std::shared_ptr<QInterface> Qrack::QInterfacePtr |
typedef std::shared_ptr<QNeuron> Qrack::QNeuronPtr |
typedef std::shared_ptr<QPager> Qrack::QPagerPtr |
typedef std::shared_ptr<QParity> Qrack::QParityPtr |
typedef std::shared_ptr<QStabilizerHybrid> Qrack::QStabilizerHybridPtr |
typedef std::shared_ptr<QStabilizer> Qrack::QStabilizerPtr |
typedef std::shared_ptr<QTensorNetwork> Qrack::QTensorNetworkPtr |
typedef uint64_t Qrack::quid |
typedef std::shared_ptr<QUnitClifford> Qrack::QUnitCliffordPtr |
typedef std::shared_ptr<QUnitMulti> Qrack::QUnitMultiPtr |
typedef std::shared_ptr<QUnit> Qrack::QUnitPtr |
typedef std::shared_ptr<QUnitStateVector> Qrack::QUnitStateVectorPtr |
typedef half_float::half Qrack::real1 |
typedef float Qrack::real1_f |
typedef float Qrack::real1_s |
typedef std::map<QEngineShardPtr, PhaseShardPtr> Qrack::ShardToPhaseMap |
typedef std::shared_ptr<StateVectorArray> Qrack::StateVectorArrayPtr |
typedef std::shared_ptr<StateVector> Qrack::StateVectorPtr |
typedef std::shared_ptr<StateVectorSparse> Qrack::StateVectorSparsePtr |
enum Qrack::OCLAPI |
enum Qrack::Pauli |
Enumerated list of Pauli bases.
Enumerated list of supported engines.
Use QINTERFACE_OPTIMAL for the best supported engine.
Enumerator | |
---|---|
QINTERFACE_CPU | Create a QEngineCPU leveraging only local CPU and memory resources. |
QINTERFACE_OPENCL | Create a QEngineOCL, leveraging OpenCL hardware to increase the speed of certain calculations. |
QINTERFACE_CUDA | Create a QEngineCUDA, leveraging CUDA hardware to increase the speed of certain calculations. |
QINTERFACE_HYBRID | Create a QHybrid, switching between QEngineCPU and QEngineOCL as efficient. |
QINTERFACE_BDT | Create a QBinaryDecisionTree, (CPU-based). |
QINTERFACE_BDT_HYBRID | Create a QBinaryDecisionTree, (CPU-based). |
QINTERFACE_STABILIZER | Create a QStabilizer, limited to Clifford/Pauli operations, but efficient. |
QINTERFACE_STABILIZER_HYBRID | Create a QStabilizerHybrid, switching between a QStabilizer and a QHybrid as efficient. |
QINTERFACE_QPAGER | Create a QPager, which breaks up the work of a QEngine into equally sized "pages.". |
QINTERFACE_QUNIT | Create a QUnit, which utilizes other QInterface classes to minimize the amount of work that's needed for any given operation based on the entanglement of the bits involved. This, combined with QINTERFACE_OPTIMAL, is the recommended object to use as a library consumer. |
QINTERFACE_QUNIT_MULTI | Create a QUnitMulti, which distributes the explicitly separated "shards" of a QUnit across available OpenCL devices. |
QINTERFACE_QUNIT_CLIFFORD | Clifford-specialized QUnit. |
QINTERFACE_TENSOR_NETWORK | Circuit-simplification layer. |
QINTERFACE_NOISY | Noisy wrapper layer. |
QINTERFACE_OPTIMAL_SCHROEDINGER | |
QINTERFACE_OPTIMAL_BASE | |
QINTERFACE_OPTIMAL | |
QINTERFACE_OPTIMAL_MULTI | |
QINTERFACE_MAX |
enum Qrack::SPECIAL_2X2 |
std::string Qrack::_getDefaultRandomNumberFilePath | ( | ) |
real1_f Qrack::_JointEnsembleProbabilityHelper | ( | QInterfacePtr | simulator, |
std::vector< QubitPauliBasis > | q, | ||
bool | doMeasure | ||
) |
real1_f Qrack::_PermutationExpVar | ( | quid | sid, |
std::vector< bitLenInt > | q, | ||
bool | r, | ||
bool | isRdm, | ||
bool | isExp | ||
) |
real1_f Qrack::_PermutationProb | ( | quid | sid, |
std::vector< QubitIndexState > | q, | ||
bool | isRdm, | ||
bool | r | ||
) |
void Qrack::_PhaseMask | ( | quid | sid, |
real1_f | lambda, | ||
bitLenInt | p, | ||
std::vector< bitLenInt > | q, | ||
bool | isParity | ||
) |
void CL_CALLBACK Qrack::_PopQueue | ( | cl_event | event, |
cl_int | type, | ||
void * | user_data | ||
) |
std::vector<std::string> Qrack::_readDirectoryFileNames | ( | const std::string & | path | ) |
Allocate new qubit with ID.
(External API) Allocate 1 new qubit with the given qubit ID, under the simulator ID
|
inline |
|
inline |
|
inline |
unsigned char * Qrack::cl_alloc | ( | size_t | ucharCount | ) |
void Qrack::cl_free | ( | void * | toFree | ) |
QInterfacePtr Qrack::CreateArrangedLayers | ( | bool | md, |
bool | sd, | ||
bool | sh, | ||
bool | bdt, | ||
bool | pg, | ||
bool | tn, | ||
bool | hy, | ||
bool | oc, | ||
Ts... | args | ||
) |
QInterfacePtr Qrack::CreateArrangedLayersFull | ( | bool | nw, |
bool | md, | ||
bool | sd, | ||
bool | sh, | ||
bool | bdt, | ||
bool | pg, | ||
bool | tn, | ||
bool | hy, | ||
bool | oc, | ||
Ts... | args | ||
) |
QInterfacePtr Qrack::CreateQuantumInterface | ( | QInterfaceEngine | engine, |
Ts... | args | ||
) |
QInterfacePtr Qrack::CreateQuantumInterface | ( | QInterfaceEngine | engine1, |
QInterfaceEngine | engine2, | ||
QInterfaceEngine | engine3, | ||
Ts... | args | ||
) |
Factory method to create specific engine implementations.
QInterfacePtr Qrack::CreateQuantumInterface | ( | QInterfaceEngine | engine1, |
QInterfaceEngine | engine2, | ||
Ts... | args | ||
) |
QInterfacePtr Qrack::CreateQuantumInterface | ( | std::vector< QInterfaceEngine > | engines, |
Ts... | args | ||
) |
void Qrack::destroy | ( | quid | sid | ) |
"Destroy" or release simulator allocation
(External API) Destroy a simulator (ID will not be reused)
void Qrack::destroy_qcircuit | ( | quid | cid | ) |
void Qrack::destroy_qneuron | ( | quid | nid | ) |
"Destroy" or release simulator allocation
void Qrack::DIVN | ( | quid | sid, |
bitCapInt | a, | ||
bitCapInt | m, | ||
std::vector< bitLenInt > | q, | ||
std::vector< bitLenInt > | o | ||
) |
|
inline |
void Qrack::Exp | ( | quid | sid, |
real1_f | phi, | ||
std::vector< QubitPauliBasis > | q | ||
) |
(External API) Exponentiation of Pauli operators
real1_f Qrack::FactorizedExpectation | ( | quid | sid, |
std::vector< QubitIntegerExpVar > | q | ||
) |
Expectation value for bit-string integer from group of qubits with per-qubit integer expectation value.
(External API) Get the permutation expectation value, based upon the order of input qubits.
real1_f Qrack::FactorizedExpectationFp | ( | quid | sid, |
std::vector< QubitRealExpVar > | q | ||
) |
Expectation value for bit-string integer from group of qubits with per-qubit real1 expectation value.
(External API) Get the permutation expectation value, based upon the order of input qubits.
real1_f Qrack::FactorizedExpectationFpRdm | ( | quid | sid, |
std::vector< QubitRealExpVar > | q, | ||
bool | r | ||
) |
"Reduced density matrix" Expectation value for bit-string integer from group of qubits with per-qubit real1 expectation value
(External API) Get the permutation expectation value, based upon the order of input qubits, treating all ancillary qubits as post-selected T gate gadgets.
real1_f Qrack::FactorizedExpectationRdm | ( | quid | sid, |
std::vector< QubitIntegerExpVar > | q, | ||
bool | r | ||
) |
"Reduced density matrix" Expectation value for bit-string integer from group of qubits with per-qubit integer expectation value
(External API) Get the permutation expectation value, based upon the order of input qubits, treating all ancillary qubits as post-selected T gate gadgets.
real1_f Qrack::FactorizedExpVar | ( | bool | isExp, |
bool | isRdm, | ||
quid | sid, | ||
std::vector< QubitIntegerExpVar > | q, | ||
bool | r | ||
) |
real1_f Qrack::FactorizedExpVarFp | ( | bool | isExp, |
bool | isRdm, | ||
quid | sid, | ||
std::vector< QubitRealExpVar > | q, | ||
bool | r | ||
) |
real1_f Qrack::FactorizedVariance | ( | quid | sid, |
std::vector< QubitIntegerExpVar > | q | ||
) |
Variance for bit-string integer from group of qubits with per-qubit integer variance.
(External API) Get the permutation variance, based upon the order of input qubits.
real1_f Qrack::FactorizedVarianceFp | ( | quid | sid, |
std::vector< QubitRealExpVar > | q | ||
) |
Variance for bit-string integer from group of qubits with per-qubit real1 variance.
(External API) Get the permutation variance, based upon the order of input qubits.
real1_f Qrack::FactorizedVarianceFpRdm | ( | quid | sid, |
std::vector< QubitRealExpVar > | q, | ||
bool | r | ||
) |
"Reduced density matrix" variance for bit-string integer from group of qubits with per-qubit real1 variance
(External API) Get the permutation variance, based upon the order of input qubits, treating all ancillary qubits as post-selected T gate gadgets.
real1_f Qrack::FactorizedVarianceRdm | ( | quid | sid, |
std::vector< QubitIntegerExpVar > | q, | ||
bool | r | ||
) |
"Reduced density matrix" variance for bit-string integer from group of qubits with per-qubit integer variance
(External API) Get the permutation variance, based upon the order of input qubits, treating all ancillary qubits as post-selected T gate gadgets.
void Qrack::FillSimShards | ( | QInterfacePtr | simulator | ) |
std::map<quid, bitLenInt>::iterator Qrack::FindShardValue | ( | bitLenInt | v, |
std::map< quid, bitLenInt > & | simMap | ||
) |
(PSEUDO-QUANTUM:) Force measurement result of single qubit (and return the result)
(External API) PSEUDO-QUANTUM: Post-select bit in |0>/|1> basis
QNeuronActivationFn Qrack::get_qneuron_activation_fn | ( | quid | nid | ) |
Get the activation function for a quantum neuron.
Get the "leakage" parameter for "leaky" quantum neuron activation functions.
Get the (RY-rotation) angle parameters for each permutation of quantum neuron input qubits.
bitLenInt Qrack::GetSimShardId | ( | QInterfacePtr | simulator, |
bitLenInt | i | ||
) |
double Qrack::GetUnitaryFidelity | ( | quid | sid | ) |
Report fidelity for "Schmidt decomposition rounding parameter" (SDRP) and "near-Clifford rounding".
(External API) Walsh-Hadamard transform applied for simulator ID and qubit ID
quid Qrack::init | ( | ) |
"Quasi-default constructor" (for an empty simulator)
"Clone" simulator (no-clone theorem does not apply to classical simulation)
(External API) Initialize a simulator ID that clones simulator ID "sid"
"Default optimal" (BQP-complete-targeted) simulator type initialization (with "direct memory" option)
(External API) Initialize a simulator ID with "q" qubits and implicit default layer options.
quid Qrack::init_count_type | ( | bitLenInt | q, |
bool | tn, | ||
bool | md, | ||
bool | sd, | ||
bool | sh, | ||
bool | bdt, | ||
bool | pg, | ||
bool | nw, | ||
bool | hy, | ||
bool | oc, | ||
bool | hp | ||
) |
Options for simulator type in initialization (any set of options theoretically functions together): tn - "Tensor network" layer - JIT local circuit simplification, light-cone optimization md - "Multi-device" (TURN OFF IN SERIAL BUILDS) - distribute Schmidt-decomposed or factorized subsytems to different OpenCL devices.
(External API) Initialize a simulator ID with "q" qubits and explicit layer options on/off
sd - "Schmidt decomposition" - use state-factorization optimizations sh - "Stabilizer hybrid" - use ("hybrid") stabilizer and near-Clifford optimizations (does not work well with "tn," "tensor network") bdt - "Binary decision tree" - use "quantum binary decision diagram" (QBDD) optimization. This can optionally "hybridize" with state vector, for speed. pg - "Pager" (TURN OFF IN SERIAL BUILDS) - split large simulations into a power-of-2 of smaller simulation "pages," for multi-device distribution hy - "(State vector) Hybrid" (TURN OFF IN SERIAL BUILD) - for state vector, "hybridize" CPU/GPU/multi-GPU simulation qubit width thresholds, for speed. oc - "OpenCL" (TURN OFF IN SERIAL BUILD) - use OpenCL acceleration (in general) hp - "Host pointer" (TURN OFF IN SERIAL BUILD) - allocate OpenCL state vectors on "host" instead of "device" (useful for certain accelerators, like Intel HD)
"Default optimal" (BQP-complete-targeted) simulator type initialization (with "direct memory" option)
(External API) Initialize a simulator ID with "q" qubits and implicit default layer options.
quid Qrack::init_qcircuit | ( | bool | collapse, |
bool | clifford | ||
) |
quid Qrack::init_qneuron | ( | quid | sid, |
std::vector< bitLenInt > | c, | ||
bitLenInt | q, | ||
QNeuronActivationFn | f, | ||
real1_f | a, | ||
real1_f | tol | ||
) |
Initialize a "quantum neuron" that takes a list of qubit "controls" for input and acts on a single "target" output qubit.
bitCapIntOcl Qrack::intPowOcl | ( | bitCapIntOcl | base, |
bitCapIntOcl | power | ||
) |
|
inline |
|
inline |
bool Qrack::isOverflowAdd | ( | bitCapIntOcl | inOutInt, |
bitCapIntOcl | inInt, | ||
const bitCapIntOcl & | signMask, | ||
const bitCapIntOcl & | lengthPower | ||
) |
Check if an addition with overflow sets the flag.
bool Qrack::isOverflowSub | ( | bitCapIntOcl | inOutInt, |
bitCapIntOcl | inInt, | ||
const bitCapIntOcl & | signMask, | ||
const bitCapIntOcl & | lengthPower | ||
) |
Check if a subtraction with overflow sets the flag.
|
inline |
|
inline |
real1_f Qrack::JointEnsembleProbability | ( | quid | sid, |
std::vector< QubitPauliBasis > | q | ||
) |
Overall probability of any odd permutation of the masked set of bits.
(External API) Find the joint probability for all specified qubits under the respective Pauli basis transformations.
|
inline |
Measure single qubit (according to Born rules) and return the result.
(External API) Measure bit in |0>/|1> basis
(External API) "Anti-"Controlled Inverse "S" Gate
(External API) "Anti-"Controlled Inverse "T" Gate
(External API) "Anti-"Controlled "H" Gate
(External API) Controlled 2x2 complex matrix unitary gate
(External API) "Anti-"Controlled "S" Gate
(External API) "Anti-"Controlled "T" Gate
void Qrack::MACU | ( | quid | sid, |
std::vector< bitLenInt > | c, | ||
bitLenInt | q, | ||
real1_f | theta, | ||
real1_f | phi, | ||
real1_f | lambda | ||
) |
(External API) Controlled 3-parameter unitary gate
(External API) "Anti-"Controlled "X" Gate
(External API) "Anti-"Controlled "Y" Gate
(External API) "Anti-"Controlled "Z" Gate
|
inline |
Measure all qubits (according to Born rules) and return the result as a bit string (integer).
(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.
bitLenInt Qrack::MapArithmetic | ( | QInterfacePtr | simulator, |
std::vector< bitLenInt > | q | ||
) |
MapArithmeticResult2 Qrack::MapArithmetic2 | ( | QInterfacePtr | simulator, |
std::vector< bitLenInt > | q1, | ||
std::vector< bitLenInt > | q2 | ||
) |
MapArithmeticResult2 Qrack::MapArithmetic3 | ( | QInterfacePtr | simulator, |
std::vector< bitLenInt > | q1, | ||
std::vector< bitLenInt > | q2 | ||
) |
real1_f Qrack::MatrixExpectation | ( | quid | sid, |
std::vector< QubitMatrixBasis > | q | ||
) |
Get the single-qubit (2x2) operator expectation value for the array of qubits and bases.
(External API) Get the single-qubit (2x2) operator expectation value for the array of qubits and bases.
real1_f Qrack::MatrixExpectationEigenVal | ( | quid | sid, |
std::vector< QubitMatrixBasisEigenVal > | q | ||
) |
Get the single-qubit (2x2) operator expectation value for the array of qubits and bases.
(External API) Get the single-qubit (2x2) operator expectation value for the array of qubits and bases.
real1_f Qrack::MatrixExpVar | ( | bool | isExp, |
quid | sid, | ||
std::vector< QubitMatrixBasis > | q | ||
) |
real1_f Qrack::MatrixExpVarEigenVal | ( | bool | isExp, |
quid | sid, | ||
std::vector< QubitMatrixBasisEigenVal > | q | ||
) |
|
inline |
|
inline |
real1_f Qrack::MatrixVariance | ( | quid | sid, |
std::vector< QubitMatrixBasis > | q | ||
) |
Get the single-qubit (2x2) operator variance for the array of qubits and bases.
(External API) Get the single-qubit (2x2) operator variance for the array of qubits and bases.
real1_f Qrack::MatrixVarianceEigenVal | ( | quid | sid, |
std::vector< QubitMatrixBasisEigenVal > | q | ||
) |
Get the single-qubit (2x2) operator variance for the array of qubits and bases.
(External API) Get the single-qubit (2x2) operator variance for the array of qubits and bases.
(External API) Controlled Inverse "S" Gate
(External API) Controlled Inverse "T" Gate
void Qrack::MCDIV | ( | quid | sid, |
bitCapInt | a, | ||
std::vector< bitLenInt > | c, | ||
std::vector< bitLenInt > | q, | ||
std::vector< bitLenInt > | o | ||
) |
void Qrack::MCDIVN | ( | quid | sid, |
bitCapInt | a, | ||
std::vector< bitLenInt > | c, | ||
bitCapInt | m, | ||
std::vector< bitLenInt > | q, | ||
std::vector< bitLenInt > | o | ||
) |
void Qrack::MCExp | ( | quid | sid, |
real1_f | phi, | ||
std::vector< bitLenInt > | c, | ||
std::vector< QubitPauliBasis > | q | ||
) |
(External API) Controlled exponentiation of Pauli operators
(External API) Controlled "H" Gate
(External API) Controlled 2x2 complex matrix unitary gate
void Qrack::MCMUL | ( | quid | sid, |
bitCapInt | a, | ||
std::vector< bitLenInt > | c, | ||
std::vector< bitLenInt > | q, | ||
std::vector< bitLenInt > | o | ||
) |
void Qrack::MCMULN | ( | quid | sid, |
bitCapInt | a, | ||
std::vector< bitLenInt > | c, | ||
bitCapInt | m, | ||
std::vector< bitLenInt > | q, | ||
std::vector< bitLenInt > | o | ||
) |
void Qrack::MCPOWN | ( | quid | sid, |
bitCapInt | a, | ||
std::vector< bitLenInt > | c, | ||
bitCapInt | m, | ||
std::vector< bitLenInt > | q, | ||
std::vector< bitLenInt > | o | ||
) |
void Qrack::MCR | ( | quid | sid, |
real1_f | phi, | ||
std::vector< bitLenInt > | c, | ||
QubitPauliBasis | q | ||
) |
(External API) Controlled rotation around Pauli axes
void Qrack::MCRHelper | ( | quid | sid, |
real1_f | phi, | ||
std::vector< bitLenInt > | c, | ||
QubitPauliBasis | qb | ||
) |
(External API) Controlled "S" Gate
(External API) Controlled "T" Gate
void Qrack::MCU | ( | quid | sid, |
std::vector< bitLenInt > | c, | ||
bitLenInt | q, | ||
real1_f | theta, | ||
real1_f | phi, | ||
real1_f | lambda | ||
) |
(External API) Controlled 3-parameter unitary gate
(External API) Controlled "X" Gate
(External API) Controlled "Y" Gate
(External API) Controlled "Z" Gate
bool Qrack::Measure | ( | quid | sid, |
std::vector< QubitPauliBasis > | q | ||
) |
Each in its specified Pauli basis, collapse an ensemble of qubits jointly via measurement.
(External API) Measure bits in specified Pauli bases
std::vector< long long unsigned int > Qrack::MeasureShots | ( | quid | sid, |
std::vector< bitLenInt > | q, | ||
unsigned | s | ||
) |
Repeat (Z-basis) measurement of a set of qubits for a count of "shots" (without collapsing the simulator)
(External API) 2x2 complex matrix unitary gate
void Qrack::MULN | ( | quid | sid, |
bitCapInt | a, | ||
bitCapInt | m, | ||
std::vector< bitLenInt > | q, | ||
std::vector< bitLenInt > | o | ||
) |
void Qrack::Multiplex1Mtrx | ( | quid | sid, |
std::vector< bitLenInt > | c, | ||
bitLenInt | q, | ||
std::vector< complex > | m | ||
) |
Multi-controlled, single-target multiplexer gate.
|
inline |
void Qrack::Normalize | ( | quid | sid | ) |
Normalize the state (which should never be necessary unless Decompose() is "abused")
bool Qrack::operator!= | ( | QBdtNodeInterfacePtr | lhs, |
QBdtNodeInterfacePtr | rhs | ||
) |
std::ostream & Qrack::operator<< | ( | std::ostream & | os, |
const QCircuitGatePtr | g | ||
) |
std::ostream & Qrack::operator<< | ( | std::ostream & | os, |
const QCircuitPtr | g | ||
) |
std::ostream& Qrack::operator<< | ( | std::ostream & | os, |
const QStabilizerHybridPtr | s | ||
) |
std::ostream& Qrack::operator<< | ( | std::ostream & | os, |
const QStabilizerPtr | s | ||
) |
std::ostream& Qrack::operator<< | ( | std::ostream & | os, |
const QUnitCliffordPtr | s | ||
) |
bool Qrack::operator== | ( | QBdtNodeInterfacePtr | lhs, |
QBdtNodeInterfacePtr | rhs | ||
) |
std::istream& Qrack::operator>> | ( | std::istream & | is, |
const QStabilizerHybridPtr | s | ||
) |
std::istream& Qrack::operator>> | ( | std::istream & | is, |
const QStabilizerPtr | s | ||
) |
std::istream& Qrack::operator>> | ( | std::istream & | is, |
const QUnitCliffordPtr | s | ||
) |
std::istream & Qrack::operator>> | ( | std::istream & | os, |
QCircuitGatePtr & | g | ||
) |
std::istream & Qrack::operator>> | ( | std::istream & | os, |
QCircuitPtr & | g | ||
) |
real1_f Qrack::PauliExpectation | ( | quid | sid, |
std::vector< QubitPauliBasis > | q | ||
) |
Pauli operator expectation value for the array of qubits and bases.
(External API) Get the Pauli operator expectation value for the array of qubits and bases.
real1_f Qrack::PauliExpVar | ( | bool | isExp, |
quid | sid, | ||
std::vector< QubitPauliBasis > | q | ||
) |
real1_f Qrack::PauliVariance | ( | quid | sid, |
std::vector< QubitPauliBasis > | q | ||
) |
Pauli operator variance for the array of qubits and bases.
(External API) Get the Pauli operator variance for the array of qubits and bases.
Expectation value for bit-string integer equivalent of specified arbitrary group of qubits.
(External API) Get the permutation expectation value, based upon the order of input qubits.
"Reduced density matrix" expectation value for bit-string integer equivalent of specified arbitrary group of qubits
(External API) Get the permutation expectation value, based upon the order of input qubits, treating all ancillary qubits as post-selected T gate gadgets.
real1_f Qrack::PermutationProb | ( | quid | sid, |
std::vector< QubitIndexState > | q | ||
) |
Probability of specified (single) permutation of any arbitrary group of qubits.
(External API) Get the permutation expectation value, based upon the order of input qubits.
real1_f Qrack::PermutationProbRdm | ( | quid | sid, |
std::vector< QubitIndexState > | q, | ||
bool | r | ||
) |
"Reduced density matrix" probability of specified (single) permutation of any arbitrary group of qubits
(External API) Get the permutation expectation value, based upon the order of input qubits, treating all ancillary qubits as post-selected T gate gadgets.
Applies e^(i*angle) phase factor to all combinations of bits with odd parity, based upon permutations of qubits.
Applies a -2 * PI_R1 / (2^N) phase rotation to each qubit.
|
inline |
|
inline |
|
inline |
void Qrack::POWN | ( | quid | sid, |
bitCapInt | a, | ||
bitCapInt | m, | ||
std::vector< bitLenInt > | q, | ||
std::vector< bitLenInt > | o | ||
) |
Z-basis expectation value of qubit.
(External API) Get the probability that a qubit is in the |1> state.
Get the probabilities of all permutations of the requested subset of qubits.
"Reduced density matrix" Z-basis expectation value of qubit
(External API) Get the probability that a qubit is in the |1> state, treating all ancillary qubits as post-selected T gate gadgets.
bitCapInt Qrack::pushApartBits | ( | const bitCapInt & | perm, |
const std::vector< bitCapInt > & | skipPowers | ||
) |
void Qrack::qcircuit_append_mc | ( | quid | cid, |
std::vector< complex > | m, | ||
std::vector< bitLenInt > | c, | ||
bitLenInt | q, | ||
bitCapInt | p | ||
) |
void Qrack::qcircuit_append_mc | ( | quid | cid, |
std::vector< real1_f > | m, | ||
std::vector< bitLenInt > | c, | ||
bitLenInt | q, | ||
bitCapInt | p | ||
) |
void Qrack::qcircuit_in_from_file | ( | quid | cid, |
std::string | f | ||
) |
void Qrack::qcircuit_out_to_file | ( | quid | cid, |
std::string | f | ||
) |
std::string Qrack::qcircuit_out_to_string | ( | quid | cid | ) |
Train a quantum neuron for one epoh (without uncomputing any intermediate side-effects)
Train a quantum neuron for one epoch, and also uncompute the intermediate side-effects.
Train a quantum neuron for one epoch, assuming that the input state is a Z-basis eigenstate.
Infer quantum neuron output from inputs (after training)
Perform the inverse of quantum neuron inference (for "uncomputation")
void Qrack::qstabilizer_in_from_file | ( | quid | sid, |
std::string | f | ||
) |
Initialize stabilizer simulation from a tableau file (or raise exception for "get_error()" if incompatible simulator type)
void Qrack::qstabilizer_out_to_file | ( | quid | sid, |
std::string | f | ||
) |
Output stabilizer simulation tableau to file (or raise exception for "get_error()" if incompatible simulator type)
void Qrack::R | ( | quid | sid, |
real1_f | phi, | ||
QubitPauliBasis | q | ||
) |
(External API) Rotation around Pauli axes
Select from a distribution of "p.size()" count of elements according to the discrete probabilities in "p.".
Select from a distribution of "p.size()" count of elements according the discrete probabilities in "p.".
Qrack::REG_GATE_1 | ( | H | ) |
Apply Hadamard gate to each bit in "length," starting from bit index "start".
Release qubit ID.
(External API) Release 1 qubit with the given qubit ID, under the simulator ID
void Qrack::removeIdentities | ( | std::vector< QubitPauliBasis > * | qb | ) |
void Qrack::ResetAll | ( | quid | sid | ) |
Set simulator to |0> permutation state.
(External API) Set the simulator to a computational basis permutation.
void Qrack::ResetUnitaryFidelity | ( | quid | sid | ) |
Reset fidelity to 1 for "Schmidt decomposition rounding parameter" (SDRP) and "near-Clifford rounding".
void Qrack::reverse | ( | BidirectionalIterator | first, |
BidirectionalIterator | last, | ||
const bitCapInt & | stride | ||
) |
void Qrack::RevertPauliBasis | ( | QInterfacePtr | simulator, |
std::vector< QubitPauliBasis > | qb | ||
) |
void Qrack::RHelper | ( | quid | sid, |
real1_f | phi, | ||
QubitPauliBasis | qb | ||
) |
void Qrack::rotate | ( | BidirectionalIterator | first, |
BidirectionalIterator | middle, | ||
BidirectionalIterator | last, | ||
const bitCapInt & | stride | ||
) |
void Qrack::seed | ( | quid | sid, |
unsigned | s | ||
) |
"Seed" random number generator (if pseudo-random Mersenne twister is in use)
(External API) Set RNG seed for simulator ID
Force (inexact) factorization of qubit subsystem out of "bulk" simulator state.
void Qrack::set_concurrency | ( | quid | sid, |
unsigned | p | ||
) |
Set CPU concurrency (if build isn't serial)
(External API) Set concurrency level per QEngine shard
void Qrack::set_qneuron_activation_fn | ( | quid | nid, |
QNeuronActivationFn | f | ||
) |
Set the activation function for a quantum neuron.
Set the "leakage" parameter for "leaky" quantum neuron activation functions.
Set the (RY-rotation) angle parameters for each permutation of quantum neuron input qubits.
void Qrack::SetNcrp | ( | quid | sid, |
double | sdrp | ||
) |
Set "Near-Clifford rounding parameter".
void Qrack::SetNoiseParameter | ( | quid | sid, |
double | np | ||
) |
Set noise parameter (for QInterfaceNoisy)
Set bit string permutation eigenstate of simulator instance.
void Qrack::SetReactiveSeparate | ( | quid | sid, |
bool | irs | ||
) |
Turn off/on "reactive separation" feature (for less/more aggressive automatic state factorization)
void Qrack::SetSdrp | ( | quid | sid, |
double | sdrp | ||
) |
Set "Schmidt decomposition rounding parameter" (SDRP) value (see https://arxiv.org/abs/2304.14969)
void Qrack::SetTInjection | ( | quid | sid, |
bool | iti | ||
) |
Turn off/on "T-injection" feature (for "near-Clifford" simulation with RZ gates)
|
inline |
void Qrack::TransformPauliBasis | ( | QInterfacePtr | simulator, |
std::vector< QubitPauliBasis > | qb | ||
) |
Try to factorize a single-qubit subsystem out of "bulk" simulator state.
(This can improve efficiency but has no logical effect.)
Try to factorize a two-qubit subsystem out of "bulk" simulator state.
(This can improve efficiency but has no logical effect.)
Try to factorize a qubit subsystem out of "bulk" simulator state.
(This can improve efficiency but has no logical effect.)
(External API) 3-parameter unitary gate
void Qrack::UCMtrx | ( | quid | sid, |
std::vector< bitLenInt > | c, | ||
std::vector< complex > | m, | ||
bitLenInt | q, | ||
bitCapIntOcl | p | ||
) |
Multi-controlled gate that activates only for the specified permutation of controls, "p".
(External API) Controlled 2x2 complex matrix unitary gate with arbitrary control permutation
real1_f Qrack::UnitaryExpectation | ( | quid | sid, |
std::vector< QubitU3Basis > | q | ||
) |
Get the single-qubit (3-parameter) operator expectation value for the array of qubits and bases.
(External API) Get the single-qubit (3-parameter) operator expectation value for the array of qubits and bases.
real1_f Qrack::UnitaryExpectationEigenVal | ( | quid | sid, |
std::vector< QubitU3BasisEigenVal > | q | ||
) |
Get the single-qubit (3-parameter) operator expectation value for the array of qubits and bases.
(External API) Get the single-qubit (3-parameter) operator expectation value for the array of qubits and bases.
real1_f Qrack::UnitaryExpVar | ( | bool | isExp, |
quid | sid, | ||
std::vector< QubitU3Basis > | q | ||
) |
real1_f Qrack::UnitaryExpVarEigenVal | ( | bool | isExp, |
quid | sid, | ||
std::vector< QubitU3BasisEigenVal > | q | ||
) |
real1_f Qrack::UnitaryVariance | ( | quid | sid, |
std::vector< QubitU3Basis > | q | ||
) |
Get the single-qubit (3-parameter) operator variance for the array of qubits and bases.
(External API) Get the single-qubit (3-parameter) operator variance for the array of qubits and bases.
real1_f Qrack::UnitaryVarianceEigenVal | ( | quid | sid, |
std::vector< QubitU3BasisEigenVal > | q | ||
) |
Get the single-qubit (3-parameter) operator variance for the array of qubits and bases.
(External API) Get the single-qubit (3-parameter) operator variance for the array of qubits and bases.
Variance for bit-string integer equivalent of specified arbitrary group of qubits.
(External API) Get the permutation variance, based upon the order of input qubits.
"Reduced density matrix" variance for bit-string integer equivalent of specified arbitrary group of qubits
(External API) Get the permutation variance, based upon the order of input qubits, treating all ancillary qubits as post-selected T gate gadgets.
const real1_f Qrack::_qrack_qbdt_sep_thresh = FP_NORM_EPSILON |
const real1_f Qrack::_qrack_qunit_sep_thresh = FP_NORM_EPSILON |
QRACK_CONST complex Qrack::C_SQRT1_2 = complex(SQRT1_2_R1, ZERO_R1) |
QRACK_CONST complex Qrack::C_SQRT1_2_NEG = complex(-SQRT1_2_R1, ZERO_R1) |
QRACK_CONST complex Qrack::C_SQRT_I = complex(SQRT1_2_R1, SQRT1_2_R1) |
QRACK_CONST complex Qrack::C_SQRT_N_I = complex(SQRT1_2_R1, -SQRT1_2_R1) |
std::map<QCircuit*, std::mutex> Qrack::circuitMutexes |
std::vector<bool> Qrack::circuitReservations |
std::vector<QCircuitPtr> Qrack::circuits |
QRACK_CONST complex Qrack::CMPLX_DEFAULT_ARG = complex((real1)REAL1_DEFAULT_ARG, (real1)REAL1_DEFAULT_ARG) |
const double Qrack::FIDELITY_MIN = log((double)FP_NORM_EPSILON) |
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 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 real1 Qrack::HALF_R1 = (real1)0.5f |
QRACK_CONST complex Qrack::I_CMPLX = complex(ZERO_R1, ONE_R1) |
QRACK_CONST complex Qrack::I_CMPLX_NEG = complex(ZERO_R1, -ONE_R1) |
std::mutex Qrack::metaOperationMutex |
std::vector<int> Qrack::neuronErrors |
std::map<QNeuron*, std::mutex> Qrack::neuronMutexes |
std::vector<bool> Qrack::neuronReservations |
std::vector<QNeuronPtr> Qrack::neurons |
std::map<QNeuronPtr, QInterface*> Qrack::neuronSimulators |
QRACK_CONST complex Qrack::ONE_CMPLX = complex(ONE_R1, ZERO_R1) |
QRACK_CONST real1 Qrack::ONE_R1 = (real1)1.0f |
QRACK_CONST real1 Qrack::PI_R1 = (real1)M_PI |
const bitLenInt Qrack::PSTRIDEPOW_DEFAULT = PSTRIDEPOW |
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 |
qrack_rand_gen_ptr Qrack::randNumGen = std::make_shared<qrack_rand_gen>(time(0)) |
QRACK_CONST real1 Qrack::REAL1_EPSILON = (real1)0.000000477f |
std::map<QInterface*, std::map<quid, bitLenInt> > Qrack::shards |
|
static |
|
static |
std::vector<bool> Qrack::simulatorHostPointer |
std::map<QInterface*, std::mutex> Qrack::simulatorMutexes |
std::vector<bool> Qrack::simulatorReservations |
std::vector<QInterfacePtr> Qrack::simulators |
std::vector<std::vector<QInterfaceEngine> > Qrack::simulatorTypes |
QRACK_CONST real1 Qrack::SQRT1_2_R1 = (real1)M_SQRT1_2 |
QRACK_CONST real1 Qrack::SQRT2_R1 = (real1)M_SQRT2 |
QRACK_CONST real1_f Qrack::TRYDECOMPOSE_EPSILON = 32 * FP_NORM_EPSILON_F |
const bitCapInt Qrack::ZERO_BCI = 0U |
QRACK_CONST complex Qrack::ZERO_CMPLX = complex(ZERO_R1, ZERO_R1) |
QRACK_CONST real1 Qrack::ZERO_R1 = (real1)0.0f |