20 #define bitLenInt uint8_t 21 #define bitCapInt uint64_t 30 #define complex Complex16Simd 147 virtual std::map<QInterfacePtr, bitLenInt>
Cohere(std::vector<QInterfacePtr> toCopy) = 0;
428 virtual void RT(
double radians,
bitLenInt qubitIndex) = 0;
436 virtual void RTDyad(
int numerator,
int denomPower,
bitLenInt qubitIndex);
443 virtual void RX(
double radians,
bitLenInt qubitIndex) = 0;
450 virtual void RXDyad(
int numerator,
int denomPower,
bitLenInt qubitIndex);
472 virtual void RY(
double radians,
bitLenInt qubitIndex) = 0;
480 virtual void RYDyad(
int numerator,
int denomPower,
bitLenInt qubitIndex);
503 virtual void RZ(
double radians,
bitLenInt qubitIndex) = 0;
511 virtual void RZDyad(
int numerator,
int denomPower,
bitLenInt qubitIndex);
904 bitLenInt valueLength,
unsigned char* values) = 0;
969 while ((first < last) && (first < (last - 1))) {
989 virtual void CopyState(QInterfacePtr orig) = 0;
Create a QEngineOCL, derived from QEngineCPU, leveraging OpenCL hardware to increase the speed of cer...
Definition: qinterface.hpp:52
virtual void INC(bitCapInt toAdd, bitLenInt start, bitLenInt length)=0
Add integer (without sign)
virtual void SetQuantumState(complex *inputState)=0
Set an arbitrary pure quantum state.
virtual bool M(bitLenInt qubitIndex)=0
Measurement gate.
virtual void CRTDyad(int numerator, int denomPower, bitLenInt control, bitLenInt target)
Controlled dyadic fraction "phase shift gate".
Definition: qinterface.cpp:401
virtual void H(bitLenInt qubitIndex)=0
Hadamard gate.
virtual void Y(bitLenInt qubitIndex)=0
Y gate.
virtual void RT(double radians, bitLenInt qubitIndex)=0
Phase shift gate.
virtual void INCS(bitCapInt toAdd, bitLenInt start, bitLenInt length, bitLenInt overflowIndex)=0
Add a classical integer to the register, with sign and without carry.
virtual void RXDyad(int numerator, int denomPower, bitLenInt qubitIndex)
Dyadic fraction X axis rotation gate.
Definition: qinterface.cpp:299
virtual void LSL(bitLenInt shift, bitLenInt start, bitLenInt length)
Logical shift left, filling the extra bits with |0>
Definition: qinterface.cpp:209
virtual void ASL(bitLenInt shift, bitLenInt start, bitLenInt length)
Arithmetic shift left, with last 2 bits as sign and carry.
Definition: qinterface.cpp:177
virtual void OR(bitLenInt inputBit1, bitLenInt inputBit2, bitLenInt outputBit)=0
Quantum analog of classical "OR" gate.
virtual void Z(bitLenInt qubitIndex)=0
Z gate.
virtual void DECS(bitCapInt toAdd, bitLenInt start, bitLenInt length, bitLenInt overflowIndex)=0
Subtract a classical integer from the register, with sign and without carry.
QInterface(bitLenInt n)
Definition: qinterface.hpp:93
virtual void SetQubitCount(bitLenInt qb)
Definition: qinterface.hpp:86
virtual void INCBCDC(bitCapInt toAdd, bitLenInt start, bitLenInt length, bitLenInt carryIndex)=0
Add classical BCD integer (without sign, with carry)
virtual void RZDyad(int numerator, int denomPower, bitLenInt qubitIndex)
Dyadic fraction Z axis rotation gate.
Definition: qinterface.cpp:370
bitCapInt maxQPower
Definition: qinterface.hpp:84
Definition: qinterface.hpp:68
virtual void CLAND(bitLenInt inputQBit, bool inputClassicalBit, bitLenInt outputBit)=0
Quantum analog of classical "AND" gate.
virtual void Decohere(bitLenInt start, bitLenInt length, QInterfacePtr dest)=0
Minimally decohere a set of contiguous bits from the full coherent unit, into "destination.".
virtual void CLXOR(bitLenInt inputQBit, bool inputClassicalBit, bitLenInt outputBit)=0
Quantum analog of classical "XOR" gate.
virtual void CRZDyad(int numerator, int denomPower, bitLenInt control, bitLenInt target)
Controlled dyadic fraction Z axis rotation gate.
Definition: qinterface.cpp:499
virtual void CRY(double radians, bitLenInt control, bitLenInt target)=0
Controlled Y axis rotation gate.
virtual void DECC(bitCapInt toSub, bitLenInt start, bitLenInt length, bitLenInt carryIndex)=0
Subtract classical integer (without sign, with carry)
virtual void RTDyad(int numerator, int denomPower, bitLenInt qubitIndex)
Dyadic fraction phase shift gate.
Definition: qinterface.cpp:264
virtual void CNOT(bitLenInt control, bitLenInt target)=0
Controlled NOT gate.
#define complex
Definition: qinterface.hpp:30
virtual void CRZ(double radians, bitLenInt control, bitLenInt target)=0
Controlled Z axis rotation gate.
virtual void RX(double radians, bitLenInt qubitIndex)=0
X axis rotation gate.
virtual void RYDyad(int numerator, int denomPower, bitLenInt qubitIndex)
Dyadic fraction Y axis rotation gate.
Definition: qinterface.cpp:335
virtual void RZ(double radians, bitLenInt qubitIndex)=0
Z axis rotation gate.
virtual void SetPermutation(bitCapInt perm)=0
Set to a specific permutation.
virtual void AntiCCNOT(bitLenInt control1, bitLenInt control2, bitLenInt target)=0
Anti doubly-controlled NOT gate.
virtual void AND(bitLenInt inputBit1, bitLenInt inputBit2, bitLenInt outputBit)=0
Quantum analog of classical "AND" gate.
virtual void X(bitLenInt qubitIndex)=0
X gate.
virtual bitLenInt Cohere(QInterfacePtr toCopy)=0
Combine another QInterface with this one, after the last bit index of this one.
virtual void CRX(double radians, bitLenInt control, bitLenInt target)=0
Controlled X axis rotation gate.
virtual void DECSC(bitCapInt toAdd, bitLenInt start, bitLenInt length, bitLenInt overflowIndex, bitLenInt carryIndex)=0
Subtract a classical integer from the register, with sign and with carry.
virtual void ROL(bitLenInt shift, bitLenInt start, bitLenInt length)=0
Circular shift left - shift bits left, and carry last bits.
QInterfaceEngine
Enumerated list of supported engines.
Definition: qinterface.hpp:42
virtual void CRXDyad(int numerator, int denomPower, bitLenInt control, bitLenInt target)
Controlled dyadic fraction X axis rotation gate.
Definition: qinterface.cpp:435
#define bitCapInt
Definition: qinterface.hpp:21
virtual void RY(double radians, bitLenInt qubitIndex)=0
Y axis rotation gate.
virtual void ROR(bitLenInt shift, bitLenInt start, bitLenInt length)=0
Circular shift right - shift bits right, and carry first bits.
Definition: qinterface.hpp:71
#define bitLenInt
Definition: qinterface.hpp:20
virtual void CY(bitLenInt control, bitLenInt target)=0
Controlled Y gate.
virtual ~QInterface()
Destructor of QInterface.
Definition: qinterface.hpp:96
virtual void DEC(bitCapInt toSub, bitLenInt start, bitLenInt length)=0
Subtract classical integer (without sign)
Definition: qinterface.hpp:64
virtual void XOR(bitLenInt inputBit1, bitLenInt inputBit2, bitLenInt outputBit)=0
Quantum analog of classical "XOR" gate.
virtual void ASR(bitLenInt shift, bitLenInt start, bitLenInt length)
Arithmetic shift right, with last 2 bits as sign and carry.
Definition: qinterface.cpp:193
int GetMaxQPower()
Get the maximum number of basis states, namely for qubits.
Definition: qinterface.hpp:102
virtual void CopyState(QInterfacePtr orig)=0
Direct copy of raw state vector to produce a clone.
virtual void DECBCD(bitCapInt toAdd, bitLenInt start, bitLenInt length)=0
Subtract BCD integer (without sign)
A "Qrack::QInterface" is an abstract interface exposing qubit permutation state vector with methods t...
Definition: qinterface.hpp:81
virtual void SetBit(bitLenInt qubitIndex1, bool value)
Set individual bit to pure |0> (false) or |1> (true) state.
Definition: qinterface.cpp:64
bitLenInt qubitCount
Definition: qinterface.hpp:83
Create a QUnit, which utilizes other QInterface classes to minimize the amount of work that's needed ...
Definition: qinterface.hpp:62
virtual double ProbAll(bitCapInt fullRegister)=0
Direct measure of full register probability to be in permutation state.
virtual void DECBCDC(bitCapInt toSub, bitLenInt start, bitLenInt length, bitLenInt carryIndex)=0
Subtract BCD integer (without sign, with carry)
virtual void INCC(bitCapInt toAdd, bitLenInt start, bitLenInt length, bitLenInt carryIndex)=0
Add integer (without sign, with carry)
virtual void CRYDyad(int numerator, int denomPower, bitLenInt control, bitLenInt target)
Controlled dyadic fraction y axis rotation gate.
Definition: qinterface.cpp:468
virtual void CRT(double radians, bitLenInt control, bitLenInt target)=0
Controlled "phase shift gate".
virtual void CLOR(bitLenInt inputQBit, bool inputClassicalBit, bitLenInt outputBit)=0
Quantum analog of classical "OR" gate.
std::shared_ptr< QInterface > QInterfacePtr
Definition: qinterface.hpp:34
virtual void CCNOT(bitLenInt control1, bitLenInt control2, bitLenInt target)=0
Doubly-controlled NOT gate.
virtual void Dispose(bitLenInt start, bitLenInt length)=0
Minimally decohere a set of contigious bits from the full coherent unit, throwing these qubits away...
Definition: complex16simd.hpp:21
virtual double Prob(bitLenInt qubitIndex)=0
Direct measure of bit probability to be in |1> state.
virtual void INCBCD(bitCapInt toAdd, bitLenInt start, bitLenInt length)=0
Add classical BCD integer (without sign)
virtual void LSR(bitLenInt shift, bitLenInt start, bitLenInt length)
Logical shift right, filling the extra bits with |0>
Definition: qinterface.cpp:222
int GetQubitCount()
Get the count of bits in this register.
Definition: qinterface.hpp:99
virtual void CZ(bitLenInt control, bitLenInt target)=0
Controlled Z gate.
virtual void INCSC(bitCapInt toAdd, bitLenInt start, bitLenInt length, bitLenInt overflowIndex, bitLenInt carryIndex)=0
Add a classical integer to the register, with sign and with carry.
Create a QEngineCPU leveraging only local CPU and memory resources.
Definition: qinterface.hpp:47
virtual void AntiCNOT(bitLenInt control, bitLenInt target)=0
Anti controlled NOT gate.