Qrack  1.7
General classical-emulating-quantum development framework
Classes | Public Member Functions | Protected Types | Protected Member Functions | Protected Attributes | List of all members
Qrack::QUnit Class Reference

#include <qunit.hpp>

Inheritance diagram for Qrack::QUnit:
Inheritance graph
[legend]
Collaboration diagram for Qrack::QUnit:
Collaboration graph
[legend]

Classes

struct  QSortEntry
 

Public Member Functions

 QUnit (QInterfaceEngine eng, bitLenInt qBitCount, bitCapInt initState=0, std::shared_ptr< std::default_random_engine > rgp=nullptr)
 
virtual void SetQuantumState (complex *inputState)
 Set an arbitrary pure quantum state. More...
 
virtual void SetPermutation (bitCapInt perm)
 Set to a specific permutation. More...
 
virtual bitLenInt Cohere (QInterfacePtr toCopy)
 Combine another QInterface with this one, after the last bit index of this one. More...
 
virtual std::map< QInterfacePtr, bitLenIntCohere (std::vector< QInterfacePtr > toCopy)
 
virtual void Decohere (bitLenInt start, bitLenInt length, QInterfacePtr dest)
 Minimally decohere a set of contiguous bits from the full coherent unit, into "destination.". More...
 
virtual void Dispose (bitLenInt start, bitLenInt length)
 Minimally decohere a set of contigious bits from the full coherent unit, throwing these qubits away. More...
 
virtual void CCNOT (bitLenInt control1, bitLenInt control2, bitLenInt target)
 Doubly-controlled NOT gate. More...
 
virtual void AntiCCNOT (bitLenInt control1, bitLenInt control2, bitLenInt target)
 Anti doubly-controlled NOT gate. More...
 
virtual void CNOT (bitLenInt control, bitLenInt target)
 Controlled NOT gate. More...
 
virtual void AntiCNOT (bitLenInt control, bitLenInt target)
 Anti controlled NOT gate. More...
 
virtual void H (bitLenInt qubit)
 Hadamard gate. More...
 
virtual bool M (bitLenInt qubit)
 Measure a bit. More...
 
virtual void X (bitLenInt qubit)
 X gate. More...
 
virtual void Y (bitLenInt qubit)
 Y gate. More...
 
virtual void Z (bitLenInt qubit)
 Z gate. More...
 
virtual void CY (bitLenInt control, bitLenInt target)
 Controlled Y gate. More...
 
virtual void CZ (bitLenInt control, bitLenInt target)
 Controlled Z gate. More...
 
virtual void AND (bitLenInt inputBit1, bitLenInt inputBit2, bitLenInt outputBit)
 Quantum analog of classical "AND" gate. More...
 
virtual void OR (bitLenInt inputBit1, bitLenInt inputBit2, bitLenInt outputBit)
 Quantum analog of classical "OR" gate. More...
 
virtual void XOR (bitLenInt inputBit1, bitLenInt inputBit2, bitLenInt outputBit)
 Quantum analog of classical "XOR" gate. More...
 
virtual void CLAND (bitLenInt inputQBit, bool inputClassicalBit, bitLenInt outputBit)
 Quantum analog of classical "AND" gate. More...
 
virtual void CLOR (bitLenInt inputQBit, bool inputClassicalBit, bitLenInt outputBit)
 Quantum analog of classical "OR" gate. More...
 
virtual void CLXOR (bitLenInt inputQBit, bool inputClassicalBit, bitLenInt outputBit)
 Quantum analog of classical "XOR" gate. More...
 
virtual void RT (double radians, bitLenInt qubit)
 Phase shift gate. More...
 
virtual void RX (double radians, bitLenInt qubit)
 X axis rotation gate. More...
 
virtual void CRX (double radians, bitLenInt control, bitLenInt target)
 Controlled X axis rotation gate. More...
 
virtual void RY (double radians, bitLenInt qubit)
 Y axis rotation gate. More...
 
virtual void CRY (double radians, bitLenInt control, bitLenInt target)
 Controlled Y axis rotation gate. More...
 
virtual void RZ (double radians, bitLenInt qubit)
 Z axis rotation gate. More...
 
virtual void CRZ (double radians, bitLenInt control, bitLenInt target)
 Controlled Z axis rotation gate. More...
 
virtual void CRT (double radians, bitLenInt control, bitLenInt target)
 Controlled "phase shift gate". More...
 
virtual void ROL (bitLenInt shift, bitLenInt start, bitLenInt length)
 "Circular shift right" - (Uses swap-based algorithm for speed) More...
 
virtual void ROR (bitLenInt shift, bitLenInt start, bitLenInt length)
 "Circular shift right" - (Uses swap-based algorithm for speed) More...
 
virtual void INC (bitCapInt toAdd, bitLenInt start, bitLenInt length)
 Add integer (without sign) More...
 
virtual void INCC (bitCapInt toAdd, bitLenInt start, bitLenInt length, bitLenInt carryIndex)
 Add integer (without sign, with carry) More...
 
virtual void INCS (bitCapInt toAdd, bitLenInt start, bitLenInt length, bitLenInt overflowIndex)
 Add a classical integer to the register, with sign and without carry. More...
 
virtual void INCSC (bitCapInt toAdd, bitLenInt start, bitLenInt length, bitLenInt overflowIndex, bitLenInt carryIndex)
 Add a classical integer to the register, with sign and with carry. More...
 
virtual void INCSC (bitCapInt toAdd, bitLenInt start, bitLenInt length, bitLenInt carryIndex)
 Add a classical integer to the register, with sign and with (phase-based) carry. More...
 
virtual void INCBCD (bitCapInt toAdd, bitLenInt start, bitLenInt length)
 Add classical BCD integer (without sign) More...
 
virtual void INCBCDC (bitCapInt toAdd, bitLenInt start, bitLenInt length, bitLenInt carryIndex)
 Add classical BCD integer (without sign, with carry) More...
 
virtual void DEC (bitCapInt toSub, bitLenInt start, bitLenInt length)
 Subtract classical integer (without sign) More...
 
virtual void DECC (bitCapInt toSub, bitLenInt start, bitLenInt length, bitLenInt carryIndex)
 Subtract classical integer (without sign, with carry) More...
 
virtual void DECS (bitCapInt toAdd, bitLenInt start, bitLenInt length, bitLenInt overflowIndex)
 Subtract a classical integer from the register, with sign and without carry. More...
 
virtual void DECSC (bitCapInt toAdd, bitLenInt start, bitLenInt length, bitLenInt overflowIndex, bitLenInt carryIndex)
 Subtract a classical integer from the register, with sign and with carry. More...
 
virtual void DECSC (bitCapInt toAdd, bitLenInt start, bitLenInt length, bitLenInt carryIndex)
 Subtract a classical integer from the register, with sign and with carry. More...
 
virtual void DECBCD (bitCapInt toAdd, bitLenInt start, bitLenInt length)
 Subtract BCD integer (without sign) More...
 
virtual void DECBCDC (bitCapInt toSub, bitLenInt start, bitLenInt length, bitLenInt carryIndex)
 Subtract BCD integer (without sign, with carry) More...
 
virtual void ZeroPhaseFlip (bitLenInt start, bitLenInt length)
 Reverse the phase of the state where the register equals zero. More...
 
virtual void CPhaseFlipIfLess (bitCapInt greaterPerm, bitLenInt start, bitLenInt length, bitLenInt flagIndex)
 The 6502 uses its carry flag also as a greater-than/less-than flag, for the CMP operation. More...
 
virtual void PhaseFlip ()
 Phase flip always - equivalent to Z X Z X on any bit in the QInterface. More...
 
virtual void SetReg (bitLenInt start, bitLenInt length, bitCapInt value)
 Set register bits to given permutation. More...
 
virtual bitCapInt MReg (bitLenInt start, bitLenInt length)
 Measure permutation state of a register. More...
 
virtual bitCapInt IndexedLDA (bitLenInt indexStart, bitLenInt indexLength, bitLenInt valueStart, bitLenInt valueLength, unsigned char *values)
 Set 8 bit register bits by a superposed index-offset-based read from classical memory. More...
 
virtual bitCapInt IndexedADC (bitLenInt indexStart, bitLenInt indexLength, bitLenInt valueStart, bitLenInt valueLength, bitLenInt carryIndex, unsigned char *values)
 Add to entangled 8 bit register state with a superposed index-offset-based read from classical memory. More...
 
virtual bitCapInt IndexedSBC (bitLenInt indexStart, bitLenInt indexLength, bitLenInt valueStart, bitLenInt valueLength, bitLenInt carryIndex, unsigned char *values)
 Subtract from an entangled 8 bit register state with a superposed index-offset-based read from classical memory. More...
 
virtual void Swap (bitLenInt qubit1, bitLenInt qubit2)
 Swap values of two bits in register. More...
 
virtual void CopyState (QUnitPtr orig)
 
virtual void CopyState (QInterfacePtr orig)
 Direct copy of raw state vector to produce a clone. More...
 
virtual double Prob (bitLenInt qubit)
 Direct measure of bit probability to be in |1> state. More...
 
virtual double ProbAll (bitCapInt fullRegister)
 Direct measure of full register probability to be in permutation state. More...
 
virtual void SetBit (bitLenInt qubit1, bool value)
 Set individual bit to pure |0> (false) or |1> (true) state. More...
 
- Public Member Functions inherited from Qrack::QInterface
 QInterface (bitLenInt n)
 
virtual ~QInterface ()
 Destructor of QInterface. More...
 
int GetQubitCount ()
 Get the count of bits in this register. More...
 
int GetMaxQPower ()
 Get the maximum number of basis states, namely $ n^2 $ for $ n $ qubits. More...
 
virtual void RTDyad (int numerator, int denomPower, bitLenInt qubitIndex)
 Dyadic fraction phase shift gate. More...
 
virtual void RXDyad (int numerator, int denomPower, bitLenInt qubitIndex)
 Dyadic fraction X axis rotation gate. More...
 
virtual void CRXDyad (int numerator, int denomPower, bitLenInt control, bitLenInt target)
 Controlled dyadic fraction X axis rotation gate. More...
 
virtual void RYDyad (int numerator, int denomPower, bitLenInt qubitIndex)
 Dyadic fraction Y axis rotation gate. More...
 
virtual void CRYDyad (int numerator, int denomPower, bitLenInt control, bitLenInt target)
 Controlled dyadic fraction y axis rotation gate. More...
 
virtual void RZDyad (int numerator, int denomPower, bitLenInt qubitIndex)
 Dyadic fraction Z axis rotation gate. More...
 
virtual void CRZDyad (int numerator, int denomPower, bitLenInt control, bitLenInt target)
 Controlled dyadic fraction Z axis rotation gate. More...
 
virtual void CRTDyad (int numerator, int denomPower, bitLenInt control, bitLenInt target)
 Controlled dyadic fraction "phase shift gate". More...
 
virtual void H (bitLenInt start, bitLenInt length)
 Bitwise Hadamard. More...
 
virtual void X (bitLenInt start, bitLenInt length)
 Bitwise Pauli X (or logical "NOT") operator. More...
 
virtual void Y (bitLenInt start, bitLenInt length)
 Bitwise Pauli Y operator. More...
 
virtual void Z (bitLenInt start, bitLenInt length)
 Bitwise Pauli Z operator. More...
 
virtual void CNOT (bitLenInt inputBits, bitLenInt targetBits, bitLenInt length)
 Bitwise controlled-not. More...
 
virtual void AntiCNOT (bitLenInt inputBits, bitLenInt targetBits, bitLenInt length)
 Bitwise "anti-"controlled-not. More...
 
virtual void CCNOT (bitLenInt control1, bitLenInt control2, bitLenInt target, bitLenInt length)
 Bitwise doubly controlled-not. More...
 
virtual void AntiCCNOT (bitLenInt control1, bitLenInt control2, bitLenInt target, bitLenInt length)
 Bitwise doubly "anti-"controlled-not. More...
 
virtual void AND (bitLenInt inputStart1, bitLenInt inputStart2, bitLenInt outputStart, bitLenInt length)
 Bitwise "AND". More...
 
virtual void CLAND (bitLenInt qInputStart, bitCapInt classicalInput, bitLenInt outputStart, bitLenInt length)
 Classical bitwise "AND". More...
 
virtual void OR (bitLenInt inputStart1, bitLenInt inputStart2, bitLenInt outputStart, bitLenInt length)
 Bitwise "OR". More...
 
virtual void CLOR (bitLenInt qInputStart, bitCapInt classicalInput, bitLenInt outputStart, bitLenInt length)
 Classical bitwise "OR". More...
 
virtual void XOR (bitLenInt inputStart1, bitLenInt inputStart2, bitLenInt outputStart, bitLenInt length)
 Bitwise "XOR". More...
 
virtual void CLXOR (bitLenInt qInputStart, bitCapInt classicalInput, bitLenInt outputStart, bitLenInt length)
 Classical bitwise "XOR". More...
 
virtual void RT (double radians, bitLenInt start, bitLenInt length)
 Bitwise phase shift gate. More...
 
virtual void RTDyad (int numerator, int denomPower, bitLenInt start, bitLenInt length)
 Bitwise dyadic fraction phase shift gate. More...
 
virtual void RX (double radians, bitLenInt start, bitLenInt length)
 Bitwise X axis rotation gate. More...
 
virtual void RXDyad (int numerator, int denomPower, bitLenInt start, bitLenInt length)
 Bitwise dyadic fraction X axis rotation gate. More...
 
virtual void CRX (double radians, bitLenInt control, bitLenInt target, bitLenInt length)
 Bitwise controlled X axis rotation gate. More...
 
virtual void CRXDyad (int numerator, int denomPower, bitLenInt control, bitLenInt target, bitLenInt length)
 Bitwise controlled dyadic fraction X axis rotation gate. More...
 
virtual void RY (double radians, bitLenInt start, bitLenInt length)
 Bitwise Y axis rotation gate. More...
 
virtual void RYDyad (int numerator, int denomPower, bitLenInt start, bitLenInt length)
 Bitwise dyadic fraction Y axis rotation gate. More...
 
virtual void CRY (double radians, bitLenInt control, bitLenInt target, bitLenInt length)
 Bitwise controlled Y axis rotation gate. More...
 
virtual void CRYDyad (int numerator, int denomPower, bitLenInt control, bitLenInt target, bitLenInt length)
 Bitwise controlled dyadic fraction y axis rotation gate. More...
 
virtual void RZ (double radians, bitLenInt start, bitLenInt length)
 Bitwise Z axis rotation gate. More...
 
virtual void RZDyad (int numerator, int denomPower, bitLenInt start, bitLenInt length)
 Bitwise dyadic fraction Z axis rotation gate. More...
 
virtual void CRZ (double radians, bitLenInt control, bitLenInt target, bitLenInt length)
 Bitwise controlled Z axis rotation gate. More...
 
virtual void CRZDyad (int numerator, int denomPower, bitLenInt control, bitLenInt target, bitLenInt length)
 Bitwise controlled dyadic fraction Z axis rotation gate. More...
 
virtual void CRT (double radians, bitLenInt control, bitLenInt target, bitLenInt length)
 Bitwise controlled "phase shift gate". More...
 
virtual void CRTDyad (int numerator, int denomPower, bitLenInt control, bitLenInt target, bitLenInt length)
 Bitwise controlled dyadic fraction "phase shift gate". More...
 
virtual void CY (bitLenInt control, bitLenInt target, bitLenInt length)
 Bitwise controlled Y gate. More...
 
virtual void CZ (bitLenInt control, bitLenInt target, bitLenInt length)
 Bitwise controlled Z gate. More...
 
virtual void ASL (bitLenInt shift, bitLenInt start, bitLenInt length)
 Arithmetic shift left, with last 2 bits as sign and carry. More...
 
virtual void ASR (bitLenInt shift, bitLenInt start, bitLenInt length)
 Arithmetic shift right, with last 2 bits as sign and carry. More...
 
virtual void LSL (bitLenInt shift, bitLenInt start, bitLenInt length)
 Logical shift left, filling the extra bits with |0> More...
 
virtual void LSR (bitLenInt shift, bitLenInt start, bitLenInt length)
 Logical shift right, filling the extra bits with |0> More...
 
virtual void QFT (bitLenInt start, bitLenInt length)
 Quantum Fourier Transform - Apply the quantum Fourier transform to the register. More...
 
virtual void Swap (bitLenInt start1, bitLenInt start2, bitLenInt length)
 Bitwise swap. More...
 
virtual void Reverse (bitLenInt first, bitLenInt last)
 Reverse all of the bits in a sequence. More...
 

Protected Types

typedef void(QInterface::* INCxFn) (bitCapInt, bitLenInt, bitLenInt, bitLenInt)
 
typedef void(QInterface::* INCxxFn) (bitCapInt, bitLenInt, bitLenInt, bitLenInt, bitLenInt)
 

Protected Member Functions

virtual void SetQubitCount (bitLenInt qb)
 
void INCx (INCxFn fn, bitCapInt toMod, bitLenInt start, bitLenInt length, bitLenInt flagIndex)
 
void INCxx (INCxxFn fn, bitCapInt toMod, bitLenInt start, bitLenInt length, bitLenInt flag1Index, bitLenInt flag2Index)
 
QInterfacePtr Entangle (std::initializer_list< bitLenInt * > bits)
 
QInterfacePtr EntangleRange (bitLenInt start, bitLenInt length)
 
QInterfacePtr EntangleRange (bitLenInt start, bitLenInt length, bitLenInt start2, bitLenInt length2)
 
template<class It >
QInterfacePtr EntangleIterator (It first, It last)
 
template<typename F , typename... B>
void EntangleAndCallMember (F fn, B...bits)
 
template<typename F , typename... B>
void EntangleAndCall (F fn, B...bits)
 
void OrderContiguous (QInterfacePtr unit)
 
void Detach (bitLenInt start, bitLenInt length, QInterfacePtr dest)
 
void SortUnit (QInterfacePtr unit, std::vector< QSortEntry > &bits, bitLenInt low, bitLenInt high)
 
void DumpShards ()
 
QInterfacePtr GetUnit (bitLenInt bit)
 

Protected Attributes

QInterfaceEngine engine
 
std::vector< QEngineShardshards
 
std::shared_ptr< std::default_random_engine > rand_generator
 
- Protected Attributes inherited from Qrack::QInterface
bitLenInt qubitCount
 
bitCapInt maxQPower
 

Member Typedef Documentation

typedef void(QInterface::* Qrack::QUnit::INCxFn) (bitCapInt, bitLenInt, bitLenInt, bitLenInt)
protected
typedef void(QInterface::* Qrack::QUnit::INCxxFn) (bitCapInt, bitLenInt, bitLenInt, bitLenInt, bitLenInt)
protected

Constructor & Destructor Documentation

Qrack::QUnit::QUnit ( QInterfaceEngine  eng,
bitLenInt  qBitCount,
bitCapInt  initState = 0,
std::shared_ptr< std::default_random_engine >  rgp = nullptr 
)

Member Function Documentation

bitLenInt Qrack::QUnit::Cohere ( QInterfacePtr  toCopy)
virtual

Combine another QInterface with this one, after the last bit index of this one.

"Cohere" combines the quantum description of state of two independent QInterface objects into one object, containing the full permutation basis of the full object. The "inputState" bits are added after the last qubit index of the QInterface to which we "Cohere." Informally, "Cohere" is equivalent to "just setting another group of qubits down next to the first" without interacting them. Schroedinger's equation can form a description of state for two independent subsystems at once or "separable quantum subsystems" without interacting them. Once the description of state of the independent systems is combined, we can interact them, and we can describe their entanglements to each other, in which case they are no longer independent. A full entangled description of quantum state is not possible for two independent quantum subsystems until we "Cohere" them.

"Cohere" multiplies the probabilities of the indepedent permutation states of the two subsystems to find the probabilites of the entire set of combined permutations, by simple combinatorial reasoning. If the probablity of the "left-hand" subsystem being in |00> is 1/4, and the probablity of the "right-hand" subsystem being in |101> is 1/8, than the probability of the combined |00101> permutation state is 1/32, and so on for all permutations of the new combined state.

If the programmer doesn't want to "cheat" quantum mechanically, then the original copy of the state which is duplicated into the larger QInterface should be "thrown away" to satisfy "no clone theorem." This is not semantically enforced in Qrack, because optimization of an emulator might be acheived by "cloning" "under-the-hood" while only exposing a quantum mechanically consistent API or instruction set.

Returns the quantum bit offset that the QInterface was appended at, such that bit 5 in toCopy is equal to offset+5 in this object.

Implements Qrack::QInterface.

std::map< QInterfacePtr, bitLenInt > Qrack::QUnit::Cohere ( std::vector< QInterfacePtr toCopy)
virtual

Implements Qrack::QInterface.

void Qrack::QUnit::Decohere ( bitLenInt  start,
bitLenInt  length,
QInterfacePtr  dest 
)
virtual

Minimally decohere a set of contiguous bits from the full coherent unit, into "destination.".

Minimally decohere a set of contigious bits from the full coherent unit. The length of this coherent unit is reduced by the length of bits decohered, and the bits removed are output in the destination QInterface pointer. The destination object must be initialized to the correct number of bits, in 0 permutation state. For quantum mechanical accuracy, the bit set removed and the bit set left behind should be quantum mechanically "separable."

Like how "Cohere" is like "just setting another group of qubits down next to the first," if two sets of qubits are not entangled, then "Decohere" is like "just moving a few qubits away from the rest." Schroedinger's equation does not require bits to be explicitly interacted in order to describe their permutation basis, and the descriptions of state of separable subsystems, those which are not entangled with other subsystems, are just as easily removed from the description of state.

If we have for example 5 qubits, and we wish to separate into "left" and "right" subsystems of 3 and 2 qubits, we sum probabilities of one permutation of the "left" three over ALL permutations of the "right" two, for all permutations, and vice versa, like so:

$ prob(|(left) 1000>) = prob(|1000 00>) + prob(|1000 10>) + prob(|1000 01>) + prob(|1000 11>). $

If the subsystems are not "separable," i.e. if they are entangled, this operation is not well-motivated, and its output is not necessarily defined. (The summing of probabilities over permutations of subsytems will be performed as described above, but this is not quantum mechanically meaningful.) To ensure that the subsystem is "separable," i.e. that it has no entanglements to other subsystems in the QInterface, it can be measured with M(), or else all qubits other than the subsystem can be measured.

Implements Qrack::QInterface.

void Qrack::QUnit::Detach ( bitLenInt  start,
bitLenInt  length,
QInterfacePtr  dest 
)
protected
void Qrack::QUnit::Dispose ( bitLenInt  start,
bitLenInt  length 
)
virtual

Minimally decohere a set of contigious bits from the full coherent unit, throwing these qubits away.

Minimally decohere a set of contigious bits from the full coherent unit, discarding these bits. The length of this coherent unit is reduced by the length of bits decohered. For quantum mechanical accuracy, the bit set removed and the bit set left behind should be quantum mechanically "separable."

Like how "Cohere" is like "just setting another group of qubits down next to the first," if two sets of qubits are not entangled, then "Dispose" is like "just moving a few qubits away from the rest, and throwing them in the trash." Schroedinger's equation does not require bits to be explicitly interacted in order to describe their permutation basis, and the descriptions of state of separable subsystems, those which are not entangled with other subsystems, are just as easily removed from the description of state.

If we have for example 5 qubits, and we wish to separate into "left" and "right" subsystems of 3 and 2 qubits, we sum probabilities of one permutation of the "left" three over ALL permutations of the "right" two, for all permutations, and vice versa, like so:

$ prob(|(left) 1000>) = prob(|1000 00>) + prob(|1000 10>) + prob(|1000 01>) + prob(|1000 11>). $

If the subsystems are not "separable," i.e. if they are entangled, this operation is not well-motivated, and its output is not necessarily defined. (The summing of probabilities over permutations of subsytems will be performed as described above, but this is not quantum mechanically meaningful.) To ensure that the subsystem is "separable," i.e. that it has no entanglements to other subsystems in the QInterface, it can be measured with M(), or else all qubits other than the subsystem can be measured.

Implements Qrack::QInterface.

void Qrack::QUnit::DumpShards ( )
protected
QInterfacePtr Qrack::QUnit::Entangle ( std::initializer_list< bitLenInt * >  bits)
protected
template<typename F , typename... B>
void Qrack::QUnit::EntangleAndCall ( fn,
B...  bits 
)
protected
template<typename F , typename... B>
void Qrack::QUnit::EntangleAndCallMember ( fn,
B...  bits 
)
protected
template<class It >
QInterfacePtr Qrack::QUnit::EntangleIterator ( It  first,
It  last 
)
protected
QInterfacePtr Qrack::QUnit::EntangleRange ( bitLenInt  start,
bitLenInt  length 
)
protected
QInterfacePtr Qrack::QUnit::EntangleRange ( bitLenInt  start,
bitLenInt  length,
bitLenInt  start2,
bitLenInt  length2 
)
protected
QInterfacePtr Qrack::QUnit::GetUnit ( bitLenInt  bit)
inlineprotected
void Qrack::QUnit::INCx ( INCxFn  fn,
bitCapInt  toMod,
bitLenInt  start,
bitLenInt  length,
bitLenInt  flagIndex 
)
protected
void Qrack::QUnit::INCxx ( INCxxFn  fn,
bitCapInt  toMod,
bitLenInt  start,
bitLenInt  length,
bitLenInt  flag1Index,
bitLenInt  flag2Index 
)
protected
void Qrack::QUnit::OrderContiguous ( QInterfacePtr  unit)
protected
virtual void Qrack::QUnit::SetPermutation ( bitCapInt  perm)
inlinevirtual

Set to a specific permutation.

Implements Qrack::QInterface.

void Qrack::QUnit::SetQuantumState ( complex inputState)
virtual

Set an arbitrary pure quantum state.

Implements Qrack::QInterface.

virtual void Qrack::QUnit::SetQubitCount ( bitLenInt  qb)
inlineprotectedvirtual

Reimplemented from Qrack::QInterface.

void Qrack::QUnit::SortUnit ( QInterfacePtr  unit,
std::vector< QSortEntry > &  bits,
bitLenInt  low,
bitLenInt  high 
)
protected

Member Data Documentation

QInterfaceEngine Qrack::QUnit::engine
protected
std::shared_ptr<std::default_random_engine> Qrack::QUnit::rand_generator
protected
std::vector<QEngineShard> Qrack::QUnit::shards
protected

The documentation for this class was generated from the following files: