28 typedef std::shared_ptr<QUnit>
QUnitPtr;
45 std::shared_ptr<std::default_random_engine> rgp =
nullptr);
47 virtual void SetQuantumState(
complex* inputState);
59 virtual void ApplySingleBit(
const complex* mtrx,
bool doCalcNorm,
bitLenInt qubit);
148 bitLenInt length,
bool clearCarry =
false);
162 virtual void PhaseFlip();
166 bitLenInt valueLength,
unsigned char* values);
181 virtual void CopyState(QUnitPtr orig);
185 virtual void SetBit(
bitLenInt qubit1,
bool value);
192 void INCx(INCxFn fn, bitCapInt toMod, bitLenInt start, bitLenInt length, bitLenInt flagIndex);
194 INCxxFn fn, bitCapInt toMod, bitLenInt start, bitLenInt length, bitLenInt flag1Index, bitLenInt flag2Index);
196 QInterfacePtr Entangle(std::initializer_list<bitLenInt*> bits);
197 QInterfacePtr EntangleRange(bitLenInt start, bitLenInt length);
198 QInterfacePtr EntangleRange(bitLenInt start, bitLenInt length, bitLenInt start2, bitLenInt length2);
200 template <
class It>
QInterfacePtr EntangleIterator(It first, It last);
202 template <
typename F,
typename... B>
void EntangleAndCallMember(F fn, B... bits);
203 template <
typename F,
typename... B>
void EntangleAndCall(F fn, B... bits);
207 void Detach(bitLenInt start, bitLenInt length,
QInterfacePtr dest);
215 void SortUnit(
QInterfacePtr unit, std::vector<QSortEntry>& bits, bitLenInt low, bitLenInt high);
217 void Apply2x2(bitCapInt offset1, bitCapInt offset2,
const complex* mtrx,
const bitLenInt bitCount,
218 const bitCapInt* qPowersSorted,
bool doCalcNorm)
220 throw "Apply2x2 not implemented in interface";
222 void ApplyM(bitCapInt qPower,
bool result,
complex nrm) {
throw "ApplyM not implemented in interface"; }
Definition: qunit.hpp:209
void NormalizeState(real1 nrm=-999.0)
Definition: qunit.hpp:223
virtual void SetQubitCount(bitLenInt qb)
Definition: qinterface.hpp:110
bitLenInt mapped
Definition: qunit.hpp:211
QInterfacePtr unit
Definition: qunit.hpp:23
#define real1
Definition: qinterface.hpp:36
std::shared_ptr< QUnit > QUnitPtr
Definition: qunit.hpp:27
std::shared_ptr< std::default_random_engine > rand_generator
Definition: qunit.hpp:35
virtual void SetQubitCount(bitLenInt qb)
Definition: qunit.hpp:37
void Apply2x2(bitCapInt offset1, bitCapInt offset2, const complex *mtrx, const bitLenInt bitCount, const bitCapInt *qPowersSorted, bool doCalcNorm)
Definition: qunit.hpp:217
QInterfaceEngine engine
Definition: qunit.hpp:32
bool operator<(const QSortEntry &rhs)
Definition: qunit.hpp:212
#define complex
Definition: qinterface.hpp:35
virtual bitLenInt Cohere(QInterfacePtr toCopy)=0
Combine another QInterface with this one, after the last bit index of this one.
std::vector< QEngineShard > shards
Definition: qunit.hpp:33
QInterfaceEngine
Enumerated list of supported engines.
Definition: qinterface.hpp:54
#define bitCapInt
Definition: qinterface.hpp:22
#define bitLenInt
Definition: qinterface.hpp:21
QInterfacePtr GetUnit(bitLenInt bit)
Definition: qunit.hpp:227
Associates a QInterface object with a set of bits.
Definition: qunit.hpp:22
A "Qrack::QInterface" is an abstract interface exposing qubit permutation state vector with methods t...
Definition: qinterface.hpp:99
void ApplyM(bitCapInt qPower, bool result, complex nrm)
Definition: qunit.hpp:222
bool operator>(const QSortEntry &rhs)
Definition: qunit.hpp:213
bitLenInt mapped
Definition: qunit.hpp:24
bitLenInt bit
Definition: qunit.hpp:210
std::shared_ptr< QInterface > QInterfacePtr
Definition: qinterface.hpp:46
virtual void SetPermutation(bitCapInt perm)
Set to a specific permutation.
Definition: qunit.hpp:48
Definition: complex16simd.hpp:21