Qrack
9.9
General classical-emulating-quantum development framework
|
Functions | |
virtual void | Qrack::QAlu::PhaseFlipIfLess (const bitCapInt &greaterPerm, bitLenInt start, bitLenInt length)=0 |
This is an expedient for an adaptive Grover's search for a function's global minimum. More... | |
virtual void | Qrack::QAlu::CPhaseFlipIfLess (const bitCapInt &greaterPerm, bitLenInt start, bitLenInt length, bitLenInt flagIndex)=0 |
The 6502 uses its carry flag also as a greater-than/less-than flag, for the CMP operation. More... | |
virtual void | Qrack::QAlu::INC (const bitCapInt &toAdd, bitLenInt start, bitLenInt length)=0 |
Add integer (without sign) More... | |
virtual void | Qrack::QAlu::DEC (const bitCapInt &toSub, bitLenInt start, bitLenInt length)=0 |
Add integer (without sign) More... | |
virtual void | Qrack::QAlu::CINC (const bitCapInt &toAdd, bitLenInt start, bitLenInt length, const std::vector< bitLenInt > &controls)=0 |
Add integer (without sign, with controls) More... | |
virtual void | Qrack::QAlu::CDEC (const bitCapInt &toSub, bitLenInt start, bitLenInt length, const std::vector< bitLenInt > &controls) |
Subtract integer (without sign, with controls) More... | |
virtual void | Qrack::QAlu::INCC (const bitCapInt &toAdd, bitLenInt start, bitLenInt length, bitLenInt carryIndex) |
Add integer (without sign, with carry) More... | |
virtual void | Qrack::QAlu::DECC (const bitCapInt &toSub, bitLenInt start, bitLenInt length, bitLenInt carryIndex) |
Subtract classical integer (without sign, with carry) More... | |
virtual void | Qrack::QAlu::INCDECC (const bitCapInt &toMod, bitLenInt start, bitLenInt length, bitLenInt carryIndex)=0 |
Common driver method behind INCC and DECC (without sign, with carry) More... | |
virtual void | Qrack::QAlu::INCS (const bitCapInt &toAdd, bitLenInt start, bitLenInt length, bitLenInt overflowIndex)=0 |
Add a classical integer to the register, with sign and without carry. More... | |
virtual void | Qrack::QAlu::DECS (const bitCapInt &toAdd, bitLenInt start, bitLenInt length, bitLenInt overflowIndex)=0 |
Add a classical integer to the register, with sign and without carry. More... | |
virtual void | Qrack::QAlu::INCSC (const 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 | Qrack::QAlu::INCSC (const 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 | Qrack::QAlu::DECSC (const bitCapInt &toSub, bitLenInt start, bitLenInt length, bitLenInt overflowIndex, bitLenInt carryIndex) |
Subtract a classical integer from the register, with sign and with carry. More... | |
virtual void | Qrack::QAlu::DECSC (const bitCapInt &toSub, bitLenInt start, bitLenInt length, bitLenInt carryIndex) |
Subtract a classical integer from the register, with sign and with carry. More... | |
virtual void | Qrack::QAlu::INCDECSC (const bitCapInt &toMod, bitLenInt start, bitLenInt length, bitLenInt carryIndex)=0 |
Common driver method behind INCSC and DECSC (without overflow flag) More... | |
virtual void | Qrack::QAlu::INCDECSC (const bitCapInt &toMod, bitLenInt start, bitLenInt length, bitLenInt overflowIndex, bitLenInt carryIndex)=0 |
Common driver method behind INCSC and DECSC (with overflow flag) More... | |
virtual void | Qrack::QAlu::MUL (const bitCapInt &toMul, bitLenInt start, bitLenInt carryStart, bitLenInt length)=0 |
Multiply by integer. More... | |
virtual void | Qrack::QAlu::DIV (const bitCapInt &toDiv, bitLenInt start, bitLenInt carryStart, bitLenInt length)=0 |
Divide by integer. More... | |
virtual void | Qrack::QAlu::MULModNOut (const bitCapInt &toMul, const bitCapInt &modN, bitLenInt inStart, bitLenInt outStart, bitLenInt length)=0 |
Multiplication modulo N by integer, (out of place) More... | |
virtual void | Qrack::QAlu::IMULModNOut (const bitCapInt &toMul, const bitCapInt &modN, bitLenInt inStart, bitLenInt outStart, bitLenInt length)=0 |
Inverse of multiplication modulo N by integer, (out of place) More... | |
virtual void | Qrack::QAlu::POWModNOut (const bitCapInt &base, const bitCapInt &modN, bitLenInt inStart, bitLenInt outStart, bitLenInt length)=0 |
Raise a classical base to a quantum power, modulo N, (out of place) More... | |
virtual void | Qrack::QAlu::CMUL (const bitCapInt &toMul, bitLenInt start, bitLenInt carryStart, bitLenInt length, const std::vector< bitLenInt > &controls)=0 |
Controlled multiplication by integer. More... | |
virtual void | Qrack::QAlu::CDIV (const bitCapInt &toDiv, bitLenInt start, bitLenInt carryStart, bitLenInt length, const std::vector< bitLenInt > &controls)=0 |
Controlled division by power of integer. More... | |
virtual void | Qrack::QAlu::CMULModNOut (const bitCapInt &toMul, const bitCapInt &modN, bitLenInt inStart, bitLenInt outStart, bitLenInt length, const std::vector< bitLenInt > &controls)=0 |
Controlled multiplication modulo N by integer, (out of place) More... | |
virtual void | Qrack::QAlu::CIMULModNOut (const bitCapInt &toMul, const bitCapInt &modN, bitLenInt inStart, bitLenInt outStart, bitLenInt length, const std::vector< bitLenInt > &controls)=0 |
Inverse of controlled multiplication modulo N by integer, (out of place) More... | |
virtual void | Qrack::QAlu::CPOWModNOut (const bitCapInt &base, const bitCapInt &modN, bitLenInt inStart, bitLenInt outStart, bitLenInt length, const std::vector< bitLenInt > &controls)=0 |
Controlled, raise a classical base to a quantum power, modulo N, (out of place) More... | |
virtual void | Qrack::QAlu::INCBCD (const bitCapInt &toAdd, bitLenInt start, bitLenInt length)=0 |
Add classical BCD integer (without sign) More... | |
virtual void | Qrack::QAlu::DECBCD (const bitCapInt &toSub, bitLenInt start, bitLenInt length) |
Subtract classical BCD integer (without sign) More... | |
virtual void | Qrack::QAlu::INCDECBCDC (const bitCapInt &toMod, bitLenInt start, bitLenInt length, bitLenInt carryIndex)=0 |
Common driver method behind INCSC and DECSC (without overflow flag) More... | |
virtual bitCapInt | Qrack::QAlu::IndexedLDA (bitLenInt indexStart, bitLenInt indexLength, bitLenInt valueStart, bitLenInt valueLength, const unsigned char *values, bool resetValue=true)=0 |
Set 8 bit register bits by a superposed index-offset-based read from classical memory. More... | |
virtual bitCapInt | Qrack::QAlu::IndexedADC (bitLenInt indexStart, bitLenInt indexLength, bitLenInt valueStart, bitLenInt valueLength, bitLenInt carryIndex, const unsigned char *values)=0 |
Add to entangled 8 bit register state with a superposed index-offset-based read from classical memory. More... | |
virtual bitCapInt | Qrack::QAlu::IndexedSBC (bitLenInt indexStart, bitLenInt indexLength, bitLenInt valueStart, bitLenInt valueLength, bitLenInt carryIndex, const unsigned char *values)=0 |
Subtract from an entangled 8 bit register state with a superposed index-offset-based read from classical memory. More... | |
virtual void | Qrack::QAlu::Hash (bitLenInt start, bitLenInt length, const unsigned char *values)=0 |
Transform a length of qubit register via lookup through a hash table. More... | |
virtual void | Qrack::QAlu::INCBCDC (const bitCapInt &toAdd, bitLenInt start, bitLenInt length, bitLenInt carryIndex) |
Add classical BCD integer (without sign, with carry) More... | |
virtual void | Qrack::QAlu::DECBCDC (const bitCapInt &toSub, bitLenInt start, bitLenInt length, bitLenInt carryIndex) |
Subtract BCD integer (without sign, with carry) More... | |
void | Qrack::QEngineCPU::ROL (bitLenInt shift, bitLenInt start, bitLenInt length) |
"Circular shift left" - shift bits left, and carry last bits. More... | |
void | Qrack::QEngineCPU::INC (const bitCapInt &toAdd, bitLenInt start, bitLenInt length) |
Add integer (without sign) More... | |
void | Qrack::QEngineCPU::CINC (const bitCapInt &toAdd, bitLenInt inOutStart, bitLenInt length, const std::vector< bitLenInt > &controls) |
Add integer (without sign, with controls) More... | |
void | Qrack::QEngineCPU::INCS (const bitCapInt &toAdd, bitLenInt start, bitLenInt length, bitLenInt overflowIndex) |
Add an integer to the register, with sign and without carry. More... | |
void | Qrack::QEngineCPU::INCBCD (const bitCapInt &toAdd, bitLenInt start, bitLenInt length) |
Add BCD integer (without sign) More... | |
void | Qrack::QEngineCPU::MUL (const bitCapInt &toMul, bitLenInt inOutStart, bitLenInt carryStart, bitLenInt length) |
Multiply by integer. More... | |
void | Qrack::QEngineCPU::DIV (const bitCapInt &toDiv, bitLenInt inOutStart, bitLenInt carryStart, bitLenInt length) |
Divide by integer. More... | |
void | Qrack::QEngineCPU::MULModNOut (const bitCapInt &toMul, const bitCapInt &modN, bitLenInt inStart, bitLenInt outStart, bitLenInt length) |
Multiplication modulo N by integer, (out of place) More... | |
void | Qrack::QEngineCPU::IMULModNOut (const bitCapInt &toMul, const bitCapInt &modN, bitLenInt inStart, bitLenInt outStart, bitLenInt length) |
Inverse of multiplication modulo N by integer, (out of place) More... | |
void | Qrack::QEngineCPU::POWModNOut (const bitCapInt &base, const bitCapInt &modN, bitLenInt inStart, bitLenInt outStart, bitLenInt length) |
Raise a classical base to a quantum power, modulo N, (out of place) More... | |
void | Qrack::QEngineCPU::CMUL (const bitCapInt &toMul, bitLenInt inOutStart, bitLenInt carryStart, bitLenInt length, const std::vector< bitLenInt > &controls) |
Controlled multiplication by integer. More... | |
void | Qrack::QEngineCPU::CDIV (const bitCapInt &toDiv, bitLenInt inOutStart, bitLenInt carryStart, bitLenInt length, const std::vector< bitLenInt > &controls) |
Controlled division by power of integer. More... | |
void | Qrack::QEngineCPU::CMULModNOut (const bitCapInt &toMul, const bitCapInt &modN, bitLenInt inStart, bitLenInt outStart, bitLenInt length, const std::vector< bitLenInt > &controls) |
Controlled multiplication modulo N by integer, (out of place) More... | |
void | Qrack::QEngineCPU::CIMULModNOut (const bitCapInt &toMul, const bitCapInt &modN, bitLenInt inStart, bitLenInt outStart, bitLenInt length, const std::vector< bitLenInt > &controls) |
Inverse of controlled multiplication modulo N by integer, (out of place) More... | |
void | Qrack::QEngineCPU::CPOWModNOut (const bitCapInt &base, const bitCapInt &modN, bitLenInt inStart, bitLenInt outStart, bitLenInt length, const std::vector< bitLenInt > &controls) |
Controlled, raise a classical base to a quantum power, modulo N, (out of place) More... | |
void | Qrack::QEngineCPU::FullAdd (bitLenInt inputBit1, bitLenInt inputBit2, bitLenInt carryInSumOut, bitLenInt carryOut) |
Quantum analog of classical "Full Adder" gate. More... | |
void | Qrack::QEngineCPU::IFullAdd (bitLenInt inputBit1, bitLenInt inputBit2, bitLenInt carryInSumOut, bitLenInt carryOut) |
Inverse of FullAdd. More... | |
bitCapInt | Qrack::QEngineCPU::IndexedLDA (bitLenInt indexStart, bitLenInt indexLength, bitLenInt valueStart, bitLenInt valueLength, const unsigned char *values, bool resetValue=true) |
Set 8 bit register bits based on read from classical memory. More... | |
bitCapInt | Qrack::QEngineCPU::IndexedADC (bitLenInt indexStart, bitLenInt indexLength, bitLenInt valueStart, bitLenInt valueLength, bitLenInt carryIndex, const unsigned char *values) |
Add based on an indexed load from classical memory. More... | |
bitCapInt | Qrack::QEngineCPU::IndexedSBC (bitLenInt indexStart, bitLenInt indexLength, bitLenInt valueStart, bitLenInt valueLength, bitLenInt carryIndex, const unsigned char *values) |
Subtract based on an indexed load from classical memory. More... | |
void | Qrack::QEngineCPU::Hash (bitLenInt start, bitLenInt length, const unsigned char *values) |
Transform a length of qubit register via lookup through a hash table. More... | |
void | Qrack::QEngineCPU::CPhaseFlipIfLess (const 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... | |
void | Qrack::QEngineCPU::PhaseFlipIfLess (const bitCapInt &greaterPerm, bitLenInt start, bitLenInt length) |
This is an expedient for an adaptive Grover's search for a function's global minimum. More... | |
virtual void | Qrack::QInterface::ROL (bitLenInt shift, bitLenInt start, bitLenInt length) |
Circular shift left - shift bits left, and carry last bits. More... | |
virtual void | Qrack::QInterface::ROR (bitLenInt shift, bitLenInt start, bitLenInt length) |
Circular shift right - shift bits right, and carry first bits. More... | |
virtual void | Qrack::QInterface::ASL (bitLenInt shift, bitLenInt start, bitLenInt length) |
Arithmetic shift left, with last 2 bits as sign and carry. More... | |
virtual void | Qrack::QInterface::ASR (bitLenInt shift, bitLenInt start, bitLenInt length) |
Arithmetic shift right, with last 2 bits as sign and carry. More... | |
virtual void | Qrack::QInterface::LSL (bitLenInt shift, bitLenInt start, bitLenInt length) |
Logical shift left, filling the extra bits with |0> More... | |
virtual void | Qrack::QInterface::LSR (bitLenInt shift, bitLenInt start, bitLenInt length) |
Logical shift right, filling the extra bits with |0> More... | |
virtual void | Qrack::QInterface::INC (const bitCapInt &toAdd, bitLenInt start, bitLenInt length) |
Add integer (without sign) More... | |
virtual void | Qrack::QInterface::DEC (const bitCapInt &toSub, bitLenInt start, bitLenInt length) |
Subtract classical integer (without sign) More... | |
virtual void | Qrack::QInterface::INCDECC (const bitCapInt &toAdd, bitLenInt start, bitLenInt length, bitLenInt carryIndex) |
Common driver method behind INCC and DECC. More... | |
virtual void | Qrack::QInterface::INCC (const bitCapInt &toAdd, bitLenInt start, bitLenInt length, bitLenInt carryIndex) |
Add integer (without sign, with carry) More... | |
virtual void | Qrack::QInterface::DECC (const bitCapInt &toSub, bitLenInt start, bitLenInt length, bitLenInt carryIndex) |
Subtract classical integer (without sign, with carry) More... | |
virtual void | Qrack::QInterface::CINC (const bitCapInt &toAdd, bitLenInt inOutStart, bitLenInt length, const std::vector< bitLenInt > &controls) |
Add integer (without sign, with controls) More... | |
virtual void | Qrack::QInterface::CDEC (const bitCapInt &toSub, bitLenInt inOutStart, bitLenInt length, const std::vector< bitLenInt > &controls) |
Subtract classical integer (without sign, with controls) More... | |
virtual void | Qrack::QInterface::INCS (const bitCapInt &toAdd, bitLenInt start, bitLenInt length, bitLenInt overflowIndex) |
Add a classical integer to the register, with sign and without carry. More... | |
virtual void | Qrack::QInterface::DECS (const bitCapInt &toSub, bitLenInt start, bitLenInt length, bitLenInt overflowIndex) |
Subtract a classical integer from the register, with sign and without carry. More... | |
virtual void | Qrack::QInterface::MULModNOut (const bitCapInt &toMul, const bitCapInt &modN, bitLenInt inStart, bitLenInt outStart, bitLenInt length) |
Multiplication modulo N by integer, (out of place) More... | |
virtual void | Qrack::QInterface::IMULModNOut (const bitCapInt &toMul, const bitCapInt &modN, bitLenInt inStart, bitLenInt outStart, bitLenInt length) |
Inverse of multiplication modulo N by integer, (out of place) More... | |
virtual void | Qrack::QInterface::CMULModNOut (const bitCapInt &toMul, const bitCapInt &modN, bitLenInt inStart, bitLenInt outStart, bitLenInt length, const std::vector< bitLenInt > &controls) |
Controlled multiplication modulo N by integer, (out of place) More... | |
virtual void | Qrack::QInterface::CIMULModNOut (const bitCapInt &toMul, const bitCapInt &modN, bitLenInt inStart, bitLenInt outStart, bitLenInt length, const std::vector< bitLenInt > &controls) |
Inverse of controlled multiplication modulo N by integer, (out of place) More... | |
virtual void | Qrack::QInterface::FullAdd (bitLenInt inputBit1, bitLenInt inputBit2, bitLenInt carryInSumOut, bitLenInt carryOut) |
Quantum analog of classical "Full Adder" gate. More... | |
virtual void | Qrack::QInterface::IFullAdd (bitLenInt inputBit1, bitLenInt inputBit2, bitLenInt carryInSumOut, bitLenInt carryOut) |
Inverse of FullAdd. More... | |
virtual void | Qrack::QInterface::CFullAdd (const std::vector< bitLenInt > &controls, bitLenInt inputBit1, bitLenInt inputBit2, bitLenInt carryInSumOut, bitLenInt carryOut) |
Controlled quantum analog of classical "Full Adder" gate. More... | |
virtual void | Qrack::QInterface::CIFullAdd (const std::vector< bitLenInt > &controls, bitLenInt inputBit1, bitLenInt inputBit2, bitLenInt carryInSumOut, bitLenInt carryOut) |
Inverse of CFullAdd. More... | |
virtual void | Qrack::QInterface::ADC (bitLenInt input1, bitLenInt input2, bitLenInt output, bitLenInt length, bitLenInt carry) |
Add a quantum integer to a quantum integer, with carry. More... | |
virtual void | Qrack::QInterface::IADC (bitLenInt input1, bitLenInt input2, bitLenInt output, bitLenInt length, bitLenInt carry) |
Inverse of ADC. More... | |
virtual void | Qrack::QInterface::CADC (const std::vector< bitLenInt > &controls, bitLenInt input1, bitLenInt input2, bitLenInt output, bitLenInt length, bitLenInt carry) |
Add a quantum integer to a quantum integer, with carry and with controls. More... | |
virtual void | Qrack::QInterface::CIADC (const std::vector< bitLenInt > &controls, bitLenInt input1, bitLenInt input2, bitLenInt output, bitLenInt length, bitLenInt carry) |
Inverse of CADC. More... | |
virtual void | Qrack::QUnit::DEC (const bitCapInt &toSub, bitLenInt start, bitLenInt length) |
Add integer (without sign) More... | |
virtual void | Qrack::QUnit::DECS (const bitCapInt &toSub, bitLenInt start, bitLenInt length, bitLenInt overflowIndex) |
Add a classical integer to the register, with sign and without carry. More... | |
virtual void | Qrack::QUnit::CDEC (const bitCapInt &toSub, bitLenInt inOutStart, bitLenInt length, const std::vector< bitLenInt > &controls) |
Subtract integer (without sign, with controls) More... | |
virtual void | Qrack::QUnit::INCDECC (const bitCapInt &toAdd, bitLenInt start, bitLenInt length, bitLenInt carryIndex) |
Common driver method behind INCC and DECC (without sign, with carry) More... | |
virtual void | Qrack::QUnit::MULModNOut (const bitCapInt &toMul, const bitCapInt &modN, bitLenInt inStart, bitLenInt outStart, bitLenInt length) |
Multiplication modulo N by integer, (out of place) More... | |
virtual void | Qrack::QUnit::IMULModNOut (const bitCapInt &toMul, const bitCapInt &modN, bitLenInt inStart, bitLenInt outStart, bitLenInt length) |
Inverse of multiplication modulo N by integer, (out of place) More... | |
virtual void | Qrack::QUnit::CMULModNOut (const bitCapInt &toMul, const bitCapInt &modN, bitLenInt inStart, bitLenInt outStart, bitLenInt length, const std::vector< bitLenInt > &controls) |
Controlled multiplication modulo N by integer, (out of place) More... | |
virtual void | Qrack::QUnit::CIMULModNOut (const bitCapInt &toMul, const bitCapInt &modN, bitLenInt inStart, bitLenInt outStart, bitLenInt length, const std::vector< bitLenInt > &controls) |
Inverse of controlled multiplication modulo N by integer, (out of place) More... | |
virtual void | Qrack::QUnit::INC (const bitCapInt &toAdd, bitLenInt start, bitLenInt length) |
Add integer (without sign) More... | |
virtual void | Qrack::QUnit::CINC (const bitCapInt &toAdd, bitLenInt inOutStart, bitLenInt length, const std::vector< bitLenInt > &controls) |
Add integer (without sign, with controls) More... | |
virtual void | Qrack::QUnit::INCC (const bitCapInt &toAdd, bitLenInt start, bitLenInt length, bitLenInt carryIndex) |
Add integer (without sign, with carry) More... | |
virtual void | Qrack::QUnit::INCS (const bitCapInt &toAdd, bitLenInt start, bitLenInt length, bitLenInt overflowIndex) |
Add a classical integer to the register, with sign and without carry. More... | |
virtual void | Qrack::QUnit::INCDECSC (const bitCapInt &toAdd, bitLenInt start, bitLenInt length, bitLenInt overflowIndex, bitLenInt carryIndex) |
Common driver method behind INCSC and DECSC (with overflow flag) More... | |
virtual void | Qrack::QUnit::INCDECSC (const bitCapInt &toAdd, bitLenInt start, bitLenInt length, bitLenInt carryIndex) |
Common driver method behind INCSC and DECSC (without overflow flag) More... | |
virtual void | Qrack::QUnit::DECC (const bitCapInt &toSub, bitLenInt start, bitLenInt length, bitLenInt carryIndex) |
Subtract integer (without sign, with carry) More... | |
virtual void | Qrack::QUnit::INCBCD (const bitCapInt &toAdd, bitLenInt start, bitLenInt length) |
Add classical BCD integer (without sign) More... | |
virtual void | Qrack::QUnit::DECBCD (const bitCapInt &toAdd, bitLenInt start, bitLenInt length) |
Subtract classical BCD integer (without sign) More... | |
virtual void | Qrack::QUnit::INCDECBCDC (const bitCapInt &toSub, bitLenInt start, bitLenInt length, bitLenInt carryIndex) |
Common driver method behind INCSC and DECSC (without overflow flag) More... | |
virtual void | Qrack::QUnit::MUL (const bitCapInt &toMul, bitLenInt inOutStart, bitLenInt carryStart, bitLenInt length) |
Multiply by integer. More... | |
virtual void | Qrack::QUnit::DIV (const bitCapInt &toDiv, bitLenInt inOutStart, bitLenInt carryStart, bitLenInt length) |
Divide by integer. More... | |
virtual void | Qrack::QUnit::POWModNOut (const bitCapInt &base, const bitCapInt &modN, bitLenInt inStart, bitLenInt outStart, bitLenInt length) |
Raise a classical base to a quantum power, modulo N, (out of place) More... | |
virtual void | Qrack::QUnit::CMUL (const bitCapInt &toMul, bitLenInt inOutStart, bitLenInt carryStart, bitLenInt length, const std::vector< bitLenInt > &controls) |
Controlled multiplication by integer. More... | |
virtual void | Qrack::QUnit::CDIV (const bitCapInt &toDiv, bitLenInt inOutStart, bitLenInt carryStart, bitLenInt length, const std::vector< bitLenInt > &controls) |
Controlled division by power of integer. More... | |
virtual void | Qrack::QUnit::CPOWModNOut (const bitCapInt &base, const bitCapInt &modN, bitLenInt inStart, bitLenInt outStart, bitLenInt length, const std::vector< bitLenInt > &controls) |
Controlled, raise a classical base to a quantum power, modulo N, (out of place) More... | |
virtual bitCapInt | Qrack::QUnit::IndexedLDA (bitLenInt indexStart, bitLenInt indexLength, bitLenInt valueStart, bitLenInt valueLength, const unsigned char *values, bool resetValue=true) |
Set 8 bit register bits by a superposed index-offset-based read from classical memory. More... | |
virtual bitCapInt | Qrack::QUnit::IndexedADC (bitLenInt indexStart, bitLenInt indexLength, bitLenInt valueStart, bitLenInt valueLength, bitLenInt carryIndex, const unsigned char *values) |
Add to entangled 8 bit register state with a superposed index-offset-based read from classical memory. More... | |
virtual bitCapInt | Qrack::QUnit::IndexedSBC (bitLenInt indexStart, bitLenInt indexLength, bitLenInt valueStart, bitLenInt valueLength, bitLenInt carryIndex, const unsigned char *values) |
Subtract from an entangled 8 bit register state with a superposed index-offset-based read from classical memory. More... | |
virtual void | Qrack::QUnit::Hash (bitLenInt start, bitLenInt length, const unsigned char *values) |
Transform a length of qubit register via lookup through a hash table. More... | |
virtual void | Qrack::QUnit::CPhaseFlipIfLess (const 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 | Qrack::QUnit::PhaseFlipIfLess (const bitCapInt &greaterPerm, bitLenInt start, bitLenInt length) |
This is an expedient for an adaptive Grover's search for a function's global minimum. More... | |
|
virtual |
Add a quantum integer to a quantum integer, with carry.
(Assumes the output register is in the 0 state)
Arithmetic shift left, with last 2 bits as sign and carry.
Arithmetic shift right, with last 2 bits as sign and carry.
|
virtual |
Add a quantum integer to a quantum integer, with carry and with controls.
(Assumes the output register is in the 0 state)
|
inlinevirtual |
Subtract classical integer (without sign, with controls)
Reimplemented in Qrack::QUnit, Qrack::QEngine, Qrack::QBdtHybrid, and Qrack::QBdt.
|
inlinevirtual |
Subtract integer (without sign, with controls)
Reimplemented from Qrack::QAlu.
|
virtual |
Subtract integer (without sign, with controls)
Reimplemented in Qrack::QUnit, Qrack::QEngine, Qrack::QBdtHybrid, and Qrack::QBdt.
|
virtual |
Controlled division by power of integer.
Implements Qrack::QAlu.
|
virtual |
Controlled division by power of integer.
Implements Qrack::QAlu.
|
pure virtual |
Controlled division by power of integer.
Implemented in Qrack::QUnit, Qrack::QStabilizerHybrid, Qrack::QPager, Qrack::QHybrid, Qrack::QEngineOCL, Qrack::QEngineCUDA, Qrack::QEngineCPU, Qrack::QBdtHybrid, and Qrack::QBdt.
|
virtual |
Controlled quantum analog of classical "Full Adder" gate.
Quantum analog of classical "Full Adder" gate.
(Assumes the outputBit is in the 0 state)
|
virtual |
Inverse of CADC.
(Can be thought of as "subtraction," but with a register convention that the same inputs invert CADC.)
|
virtual |
Inverse of CFullAdd.
Inverse of FullAdd.
(Can be thought of as "subtraction," but with a register convention that the same inputs invert CFullAdd.)
|
virtual |
Inverse of controlled multiplication modulo N by integer, (out of place)
Reimplemented from Qrack::QEngine.
|
virtual |
Inverse of controlled multiplication modulo N by integer, (out of place)
Reimplemented in Qrack::QUnit, Qrack::QStabilizerHybrid, Qrack::QPager, Qrack::QHybrid, Qrack::QEngineOCL, Qrack::QEngineCUDA, Qrack::QEngineCPU, Qrack::QEngine, Qrack::QBdtHybrid, and Qrack::QBdt.
|
inlinevirtual |
Inverse of controlled multiplication modulo N by integer, (out of place)
Implements Qrack::QAlu.
|
pure virtual |
Inverse of controlled multiplication modulo N by integer, (out of place)
Implemented in Qrack::QUnit, Qrack::QStabilizerHybrid, Qrack::QPager, Qrack::QHybrid, Qrack::QEngineOCL, Qrack::QEngineCUDA, Qrack::QEngineCPU, Qrack::QEngine, Qrack::QBdtHybrid, and Qrack::QBdt.
|
virtual |
Add integer (without sign, with controls)
Reimplemented from Qrack::QEngine.
|
virtual |
Add integer (without sign, with controls)
Reimplemented in Qrack::QUnit, Qrack::QStabilizerHybrid, Qrack::QHybrid, Qrack::QEngineOCL, Qrack::QEngineCUDA, Qrack::QEngineCPU, Qrack::QEngine, Qrack::QBdtHybrid, and Qrack::QBdt.
|
virtual |
Add integer (without sign, with controls)
Implements Qrack::QAlu.
|
pure virtual |
Add integer (without sign, with controls)
Implemented in Qrack::QUnit, Qrack::QStabilizerHybrid, Qrack::QHybrid, Qrack::QEngineOCL, Qrack::QEngineCUDA, Qrack::QEngineCPU, Qrack::QEngine, Qrack::QBdtHybrid, and Qrack::QBdt.
|
virtual |
Controlled multiplication by integer.
Implements Qrack::QAlu.
|
virtual |
Controlled multiplication by integer.
Implements Qrack::QAlu.
|
pure virtual |
Controlled multiplication by integer.
Implemented in Qrack::QUnit, Qrack::QStabilizerHybrid, Qrack::QPager, Qrack::QHybrid, Qrack::QEngineOCL, Qrack::QEngineCUDA, Qrack::QEngineCPU, Qrack::QBdtHybrid, and Qrack::QBdt.
|
virtual |
Controlled multiplication modulo N by integer, (out of place)
Reimplemented from Qrack::QEngine.
|
virtual |
Controlled multiplication modulo N by integer, (out of place)
Reimplemented in Qrack::QUnit, Qrack::QStabilizerHybrid, Qrack::QPager, Qrack::QHybrid, Qrack::QEngineOCL, Qrack::QEngineCUDA, Qrack::QEngineCPU, Qrack::QEngine, Qrack::QBdtHybrid, and Qrack::QBdt.
|
inlinevirtual |
Controlled multiplication modulo N by integer, (out of place)
Implements Qrack::QAlu.
|
pure virtual |
Controlled multiplication modulo N by integer, (out of place)
Implemented in Qrack::QUnit, Qrack::QStabilizerHybrid, Qrack::QPager, Qrack::QHybrid, Qrack::QEngineOCL, Qrack::QEngineCUDA, Qrack::QEngineCPU, Qrack::QEngine, Qrack::QBdtHybrid, and Qrack::QBdt.
|
virtual |
The 6502 uses its carry flag also as a greater-than/less-than flag, for the CMP operation.
Implements Qrack::QAlu.
|
virtual |
The 6502 uses its carry flag also as a greater-than/less-than flag, for the CMP operation.
Implements Qrack::QAlu.
|
pure virtual |
The 6502 uses its carry flag also as a greater-than/less-than flag, for the CMP operation.
Implemented in Qrack::QUnit, Qrack::QStabilizerHybrid, Qrack::QPager, Qrack::QHybrid, Qrack::QEngineOCL, Qrack::QEngineCUDA, Qrack::QEngineCPU, Qrack::QBdtHybrid, and Qrack::QBdt.
|
virtual |
Controlled, raise a classical base to a quantum power, modulo N, (out of place)
Implements Qrack::QAlu.
|
virtual |
Controlled, raise a classical base to a quantum power, modulo N, (out of place)
Implements Qrack::QAlu.
|
pure virtual |
Controlled, raise a classical base to a quantum power, modulo N, (out of place)
Implemented in Qrack::QUnit, Qrack::QStabilizerHybrid, Qrack::QPager, Qrack::QHybrid, Qrack::QEngineOCL, Qrack::QEngineCUDA, Qrack::QEngineCPU, Qrack::QBdtHybrid, and Qrack::QBdt.
|
inlinevirtual |
Subtract classical integer (without sign)
Reimplemented in Qrack::QUnit, Qrack::QStabilizerHybrid, Qrack::QEngine, Qrack::QBdtHybrid, and Qrack::QBdt.
Add integer (without sign)
Subtract integer (without sign)
Implemented in Qrack::QUnit, Qrack::QStabilizerHybrid, Qrack::QEngine, Qrack::QBdtHybrid, and Qrack::QBdt.
Subtract classical BCD integer (without sign)
Subtract BCD integer (without sign)
Reimplemented from Qrack::QAlu.
Subtract classical BCD integer (without sign)
Subtract BCD integer (without sign)
Reimplemented in Qrack::QUnit.
|
virtual |
Subtract BCD integer (without sign, with carry)
Reimplemented in Qrack::QHybrid, and Qrack::QBdtHybrid.
|
virtual |
Subtract classical integer (without sign, with carry)
Subtract integer (without sign, with carry)
Reimplemented in Qrack::QUnit, Qrack::QHybrid, Qrack::QEngine, Qrack::QBdtHybrid, and Qrack::QBdt.
|
inlinevirtual |
Subtract classical integer (without sign, with carry)
Reimplemented in Qrack::QUnit, Qrack::QHybrid, Qrack::QEngine, Qrack::QBdtHybrid, and Qrack::QBdt.
|
virtual |
Subtract integer (without sign, with carry)
Reimplemented from Qrack::QAlu.
|
pure virtual |
Add a classical integer to the register, with sign and without carry.
Subtract an integer from the register, with sign and without carry.
Because the register length is an arbitrary number of bits, the sign bit position on the integer to add is variable. Hence, the integer to add is specified as cast to an unsigned format, with the sign bit assumed to be set at the appropriate position before the cast.
Implemented in Qrack::QUnit, Qrack::QStabilizerHybrid, Qrack::QEngine, Qrack::QBdt, and Qrack::QBdtHybrid.
|
inlinevirtual |
Subtract a classical integer from the register, with sign and without carry.
Reimplemented in Qrack::QUnit, Qrack::QStabilizerHybrid, Qrack::QEngine, Qrack::QBdt, and Qrack::QBdtHybrid.
|
inlinevirtual |
Add a classical integer to the register, with sign and without carry.
Subtract an integer from the register, with sign and without carry.
Because the register length is an arbitrary number of bits, the sign bit position on the integer to add is variable. Hence, the integer to add is specified as cast to an unsigned format, with the sign bit assumed to be set at the appropriate position before the cast.
Implements Qrack::QAlu.
|
virtual |
Subtract a classical integer from the register, with sign and with carry.
Subtract an integer from the register, with sign and with carry.
If the overflow is set, flip phase on overflow. Because the register length is an arbitrary number of bits, the sign bit position on the integer to add is variable. Hence, the integer to add is specified as cast to an unsigned format, with the sign bit assumed to be set at the appropriate position before the cast.
Reimplemented in Qrack::QHybrid, and Qrack::QBdtHybrid.
|
virtual |
Subtract a classical integer from the register, with sign and with carry.
Subtract an integer from the register, with sign and without carry.
Because the register length is an arbitrary number of bits, the sign bit position on the integer to add is variable. Hence, the integer to add is specified as cast to an unsigned format, with the sign bit assumed to be set at the appropriate position before the cast.
Reimplemented in Qrack::QHybrid, and Qrack::QBdtHybrid.
|
virtual |
Divide by integer.
Implements Qrack::QAlu.
|
virtual |
Divide by integer.
Implements Qrack::QAlu.
|
pure virtual |
Divide by integer.
Implemented in Qrack::QUnit, Qrack::QStabilizerHybrid, Qrack::QPager, Qrack::QHybrid, Qrack::QEngineOCL, Qrack::QEngineCUDA, Qrack::QEngineCPU, Qrack::QBdtHybrid, and Qrack::QBdt.
|
virtual |
Quantum analog of classical "Full Adder" gate.
(Assumes the outputBit is in the 0 state)
Reimplemented from Qrack::QInterface.
|
inlinevirtual |
Quantum analog of classical "Full Adder" gate.
(Assumes the outputBit is in the 0 state)
Reimplemented in Qrack::QEngineOCL, Qrack::QEngineCUDA, and Qrack::QEngineCPU.
|
virtual |
Transform a length of qubit register via lookup through a hash table.
Implements Qrack::QAlu.
Transform a length of qubit register via lookup through a hash table.
The hash table must be a one-to-one function, otherwise the behavior of this method is undefined. The value array definition convention is the same as IndexedLDA(). Essentially, this is an IndexedLDA() operation that replaces the index register with the value register, but the lookup table must therefore be one-to-one, for this operation to be unitary, as required.
Implements Qrack::QAlu.
|
pure virtual |
Transform a length of qubit register via lookup through a hash table.
The hash table must be a one-to-one function, otherwise the behavior of this method is undefined. The value array definition convention is the same as IndexedLDA(). Essentially, this is an IndexedLDA() operation that replaces the index register with the value register, but the lookup table must therefore be one-to-one, for this operation to be unitary, as required.
Implemented in Qrack::QUnit, Qrack::QStabilizerHybrid, Qrack::QPager, Qrack::QHybrid, Qrack::QEngineOCL, Qrack::QEngineCUDA, Qrack::QEngineCPU, Qrack::QBdtHybrid, and Qrack::QBdt.
|
virtual |
Inverse of ADC.
(Can be thought of as "subtraction," but with a register convention that the same inputs invert ADC.)
|
virtual |
Inverse of FullAdd.
(Can be thought of as "subtraction," but with a register convention that the same inputs invert FullAdd.)
Reimplemented from Qrack::QInterface.
|
inlinevirtual |
Inverse of FullAdd.
(Can be thought of as "subtraction," but with a register convention that the same inputs invert FullAdd.)
Reimplemented in Qrack::QEngineOCL, Qrack::QEngineCUDA, and Qrack::QEngineCPU.
|
virtual |
Inverse of multiplication modulo N by integer, (out of place)
Reimplemented from Qrack::QEngine.
|
virtual |
Inverse of multiplication modulo N by integer, (out of place)
Reimplemented in Qrack::QUnit, Qrack::QStabilizerHybrid, Qrack::QPager, Qrack::QHybrid, Qrack::QEngineOCL, Qrack::QEngineCUDA, Qrack::QEngineCPU, Qrack::QEngine, Qrack::QBdtHybrid, and Qrack::QBdt.
|
inlinevirtual |
Inverse of multiplication modulo N by integer, (out of place)
Implements Qrack::QAlu.
|
pure virtual |
Inverse of multiplication modulo N by integer, (out of place)
Implemented in Qrack::QUnit, Qrack::QStabilizerHybrid, Qrack::QPager, Qrack::QHybrid, Qrack::QEngineOCL, Qrack::QEngineCUDA, Qrack::QEngineCPU, Qrack::QEngine, Qrack::QBdtHybrid, and Qrack::QBdt.
Add integer (without sign)
Reimplemented from Qrack::QEngine.
Add integer (without sign)
Reimplemented in Qrack::QUnit, Qrack::QStabilizerHybrid, Qrack::QHybrid, Qrack::QEngineOCL, Qrack::QEngineCUDA, Qrack::QEngineCPU, Qrack::QEngine, Qrack::QBdtHybrid, and Qrack::QBdt.
Add integer (without sign)
Implements Qrack::QAlu.
|
pure virtual |
Add integer (without sign)
Implemented in Qrack::QUnit, Qrack::QStabilizerHybrid, Qrack::QHybrid, Qrack::QEngineOCL, Qrack::QEngineCUDA, Qrack::QEngineCPU, Qrack::QEngine, Qrack::QBdtHybrid, and Qrack::QBdt.
|
virtual |
Add BCD integer (without sign)
Implements Qrack::QAlu.
Add classical BCD integer (without sign)
Implements Qrack::QAlu.
|
pure virtual |
Add classical BCD integer (without sign)
Implemented in Qrack::QUnit, Qrack::QStabilizerHybrid, Qrack::QPager, Qrack::QHybrid, Qrack::QEngineOCL, Qrack::QEngineCUDA, Qrack::QEngineCPU, Qrack::QBdtHybrid, and Qrack::QBdt.
|
virtual |
Add classical BCD integer (without sign, with carry)
Add BCD integer (without sign, with carry)
Reimplemented in Qrack::QHybrid, and Qrack::QBdtHybrid.
|
virtual |
Add integer (without sign, with carry)
Reimplemented in Qrack::QUnit, Qrack::QHybrid, Qrack::QEngine, Qrack::QBdtHybrid, and Qrack::QBdt.
|
inlinevirtual |
Add integer (without sign, with carry)
Reimplemented in Qrack::QUnit, Qrack::QHybrid, Qrack::QEngine, Qrack::QBdtHybrid, and Qrack::QBdt.
|
virtual |
Add integer (without sign, with carry)
Reimplemented from Qrack::QAlu.
|
pure virtual |
Common driver method behind INCSC and DECSC (without overflow flag)
Implemented in Qrack::QUnit, Qrack::QHybrid, Qrack::QEngineOCL, Qrack::QEngineCUDA, Qrack::QEngineCPU, Qrack::QStabilizerHybrid, Qrack::QPager, and Qrack::QBdt.
|
virtual |
Common driver method behind INCSC and DECSC (without overflow flag)
Implements Qrack::QAlu.
|
virtual |
Common driver method behind INCC and DECC.
Reimplemented in Qrack::QHybrid, Qrack::QEngineOCL, Qrack::QEngineCUDA, Qrack::QEngineCPU, Qrack::QUnit, Qrack::QStabilizerHybrid, Qrack::QEngine, Qrack::QBdtHybrid, and Qrack::QBdt.
|
inlinevirtual |
Common driver method behind INCC and DECC (without sign, with carry)
Implements Qrack::QAlu.
|
pure virtual |
Common driver method behind INCC and DECC (without sign, with carry)
Implemented in Qrack::QHybrid, Qrack::QEngineOCL, Qrack::QEngineCUDA, Qrack::QEngineCPU, Qrack::QUnit, Qrack::QStabilizerHybrid, Qrack::QEngine, Qrack::QBdtHybrid, and Qrack::QBdt.
|
virtual |
Common driver method behind INCSC and DECSC (without overflow flag)
Implements Qrack::QAlu.
|
virtual |
Common driver method behind INCSC and DECSC (with overflow flag)
Implements Qrack::QAlu.
|
pure virtual |
Common driver method behind INCSC and DECSC (without overflow flag)
Implemented in Qrack::QHybrid, Qrack::QEngineOCL, Qrack::QEngineCUDA, Qrack::QEngineCPU, Qrack::QUnit, Qrack::QStabilizerHybrid, Qrack::QPager, Qrack::QBdtHybrid, and Qrack::QBdt.
|
pure virtual |
Common driver method behind INCSC and DECSC (with overflow flag)
Implemented in Qrack::QHybrid, Qrack::QEngineOCL, Qrack::QEngineCUDA, Qrack::QEngineCPU, Qrack::QUnit, Qrack::QStabilizerHybrid, Qrack::QPager, Qrack::QBdtHybrid, and Qrack::QBdt.
|
virtual |
Add an integer to the register, with sign and without carry.
Because the register length is an arbitrary number of bits, the sign bit position on the integer to add is variable. Hence, the integer to add is specified as cast to an unsigned format, with the sign bit assumed to be set at the appropriate position before the cast.
Reimplemented from Qrack::QEngine.
|
inlinevirtual |
Add a classical integer to the register, with sign and without carry.
Reimplemented in Qrack::QUnit, Qrack::QStabilizerHybrid, Qrack::QHybrid, Qrack::QEngineCPU, Qrack::QEngine, Qrack::QBdtHybrid, Qrack::QBdt, Qrack::QEngineOCL, and Qrack::QEngineCUDA.
|
virtual |
Add a classical integer to the register, with sign and without carry.
Implements Qrack::QAlu.
|
pure virtual |
Add a classical integer to the register, with sign and without carry.
Implemented in Qrack::QUnit, Qrack::QStabilizerHybrid, Qrack::QHybrid, Qrack::QEngineCPU, Qrack::QEngine, Qrack::QBdtHybrid, Qrack::QBdt, Qrack::QEngineOCL, and Qrack::QEngineCUDA.
|
virtual |
Add a classical integer to the register, with sign and with (phase-based) carry.
Add an integer to the register, with sign and with carry.
Flip phase on overflow. Because the register length is an arbitrary number of bits, the sign bit position on the integer to add is variable. Hence, the integer to add is specified as cast to an unsigned format, with the sign bit assumed to be set at the appropriate position before the cast.
Reimplemented in Qrack::QHybrid, and Qrack::QBdtHybrid.
|
virtual |
Add a classical integer to the register, with sign and with carry.
Add an integer to the register, with sign and with carry.
If the overflow is set, flip phase on overflow. Because the register length is an arbitrary number of bits, the sign bit position on the integer to add is variable. Hence, the integer to add is specified as cast to an unsigned format, with the sign bit assumed to be set at the appropriate position before the cast.
Reimplemented in Qrack::QHybrid, and Qrack::QBdtHybrid.
|
virtual |
Add based on an indexed load from classical memory.
Implements Qrack::QAlu.
|
virtual |
Add to entangled 8 bit register state with a superposed index-offset-based read from classical memory.
"inputStart" is the start index of 8 qubits that act as an index into the 256 byte "values" array. The "outputStart" bits would usually already be entangled with the "inputStart" bits via a IndexedLDA() operation. With the "inputStart" bits being a "key" and the "outputStart" bits being a value, the permutation state |key, value> is mapped to |key, value + values[key]>. This is similar to classical parallel addition of two arrays. However, when either of the registers are measured, both registers will collapse into one random VALID key-value pair, with any addition or subtraction done to the "value." See IndexedLDA() for context.
FOR BEST EFFICIENCY, the "values" array should be allocated aligned to a 64-byte boundary. (See the unit tests suite code for an example of how to align the allocation.)
While a QInterface represents an interacting set of qubit-based registers, or a virtual quantum chip, the registers need to interact in some way with (classical or quantum) RAM. IndexedLDA is a RAM access method similar to the X addressing mode of the MOS 6502 chip, if the X register can be in a state of coherent superposition when it loads from RAM. "IndexedADC" and "IndexedSBC" perform add and subtract (with carry) operations on a state usually initially prepared with IndexedLDA().
Implements Qrack::QAlu.
|
pure virtual |
Add to entangled 8 bit register state with a superposed index-offset-based read from classical memory.
"inputStart" is the start index of 8 qubits that act as an index into the 256 byte "values" array. The "outputStart" bits would usually already be entangled with the "inputStart" bits via a IndexedLDA() operation. With the "inputStart" bits being a "key" and the "outputStart" bits being a value, the permutation state |key, value> is mapped to |key, value + values[key]>. This is similar to classical parallel addition of two arrays. However, when either of the registers are measured, both registers will collapse into one random VALID key-value pair, with any addition or subtraction done to the "value." See IndexedLDA() for context.
FOR BEST EFFICIENCY, the "values" array should be allocated aligned to a 64-byte boundary. (See the unit tests suite code for an example of how to align the allocation.)
While a QInterface represents an interacting set of qubit-based registers, or a virtual quantum chip, the registers need to interact in some way with (classical or quantum) RAM. IndexedLDA is a RAM access method similar to the X addressing mode of the MOS 6502 chip, if the X register can be in a state of coherent superposition when it loads from RAM. "IndexedADC" and "IndexedSBC" perform add and subtract (with carry) operations on a state usually initially prepared with IndexedLDA().
Implemented in Qrack::QUnit, Qrack::QStabilizerHybrid, Qrack::QPager, Qrack::QHybrid, Qrack::QEngineOCL, Qrack::QEngineCUDA, Qrack::QEngineCPU, Qrack::QBdtHybrid, and Qrack::QBdt.
|
virtual |
Set 8 bit register bits based on read from classical memory.
Implements Qrack::QAlu.
|
virtual |
Set 8 bit register bits by a superposed index-offset-based read from classical memory.
"inputStart" is the start index of 8 qubits that act as an index into the 256 byte "values" array. The "outputStart" bits are first cleared, then the separable |input, 00000000> permutation state is mapped to |input, values[input]>, with "values[input]" placed in the "outputStart" register. FOR BEST EFFICIENCY, the "values" array should be allocated aligned to a 64-byte boundary. (See the unit tests suite code for an example of how to align the allocation.)
While a QInterface represents an interacting set of qubit-based registers, or a virtual quantum chip, the registers need to interact in some way with (classical or quantum) RAM. IndexedLDA is a RAM access method similar to the X addressing mode of the MOS 6502 chip, if the X register can be in a state of coherent superposition when it loads from RAM.
The physical motivation for this addressing mode can be explained as follows: say that we have a superconducting quantum interface device (SQUID) based chip. SQUIDs have already been demonstrated passing coherently superposed electrical currents. In a sufficiently quantum-mechanically isolated qubit chip with a classical cache, with both classical RAM and registers likely cryogenically isolated from the environment, SQUIDs could (hopefully) pass coherently superposed electrical currents into the classical RAM cache to load values into a qubit register. The state loaded would be a superposition of the values of all RAM to which coherently superposed electrical currents were passed.
In qubit system similar to the MOS 6502, say we have qubit-based "accumulator" and "X index" registers, and say that we start with a superposed X index register. In (classical) X addressing mode, the X index register value acts an offset into RAM from a specified starting address. The X addressing mode of a LoaD Accumulator (LDA) instruction, by the physical mechanism described above, should load the accumulator in quantum parallel with the values of every different address of RAM pointed to in superposition by the X index register. The superposed values in the accumulator are entangled with those in the X index register, by way of whatever values the classical RAM pointed to by X held at the time of the load. (If the RAM at index "36" held an unsigned char value of "27," then the value "36" in the X index register becomes entangled with the value "27" in the accumulator, and so on in quantum parallel for all superposed values of the X index register, at once.) If the X index register or accumulator are then measured, the two registers will both always collapse into a random but valid key-value pair of X index offset and value at that classical RAM address.
Note that a "superposed store operation in classical RAM" is not possible by analagous reasoning. Classical RAM would become entangled with both the accumulator and the X register. When the state of the registers was collapsed, we would find that only one "store" operation to a single memory address had actually been carried out, consistent with the address offset in the collapsed X register and the byte value in the collapsed accumulator. It would not be possible by this model to write in quantum parallel to more than one address of classical memory at a time.
Implements Qrack::QAlu.
|
pure virtual |
Set 8 bit register bits by a superposed index-offset-based read from classical memory.
"inputStart" is the start index of 8 qubits that act as an index into the 256 byte "values" array. The "outputStart" bits are first cleared, then the separable |input, 00000000> permutation state is mapped to |input, values[input]>, with "values[input]" placed in the "outputStart" register. FOR BEST EFFICIENCY, the "values" array should be allocated aligned to a 64-byte boundary. (See the unit tests suite code for an example of how to align the allocation.)
While a QInterface represents an interacting set of qubit-based registers, or a virtual quantum chip, the registers need to interact in some way with (classical or quantum) RAM. IndexedLDA is a RAM access method similar to the X addressing mode of the MOS 6502 chip, if the X register can be in a state of coherent superposition when it loads from RAM.
The physical motivation for this addressing mode can be explained as follows: say that we have a superconducting quantum interface device (SQUID) based chip. SQUIDs have already been demonstrated passing coherently superposed electrical currents. In a sufficiently quantum-mechanically isolated qubit chip with a classical cache, with both classical RAM and registers likely cryogenically isolated from the environment, SQUIDs could (hopefully) pass coherently superposed electrical currents into the classical RAM cache to load values into a qubit register. The state loaded would be a superposition of the values of all RAM to which coherently superposed electrical currents were passed.
In qubit system similar to the MOS 6502, say we have qubit-based "accumulator" and "X index" registers, and say that we start with a superposed X index register. In (classical) X addressing mode, the X index register value acts an offset into RAM from a specified starting address. The X addressing mode of a LoaD Accumulator (LDA) instruction, by the physical mechanism described above, should load the accumulator in quantum parallel with the values of every different address of RAM pointed to in superposition by the X index register. The superposed values in the accumulator are entangled with those in the X index register, by way of whatever values the classical RAM pointed to by X held at the time of the load. (If the RAM at index "36" held an unsigned char value of "27," then the value "36" in the X index register becomes entangled with the value "27" in the accumulator, and so on in quantum parallel for all superposed values of the X index register, at once.) If the X index register or accumulator are then measured, the two registers will both always collapse into a random but valid key-value pair of X index offset and value at that classical RAM address.
Note that a "superposed store operation in classical RAM" is not possible by analagous reasoning. Classical RAM would become entangled with both the accumulator and the X register. When the state of the registers was collapsed, we would find that only one "store" operation to a single memory address had actually been carried out, consistent with the address offset in the collapsed X register and the byte value in the collapsed accumulator. It would not be possible by this model to write in quantum parallel to more than one address of classical memory at a time.
Implemented in Qrack::QUnit, Qrack::QStabilizerHybrid, Qrack::QPager, Qrack::QHybrid, Qrack::QEngineOCL, Qrack::QEngineCUDA, Qrack::QEngineCPU, Qrack::QBdtHybrid, and Qrack::QBdt.
|
virtual |
Subtract based on an indexed load from classical memory.
Implements Qrack::QAlu.
|
virtual |
Subtract from an entangled 8 bit register state with a superposed index-offset-based read from classical memory.
"inputStart" is the start index of 8 qubits that act as an index into the 256 byte "values" array. The "outputStart" bits would usually already be entangled with the "inputStart" bits via a IndexedLDA() operation. With the "inputStart" bits being a "key" and the "outputStart" bits being a value, the permutation state |key, value> is mapped to |key, value - values[key]>. This is similar to classical parallel addition of two arrays. However, when either of the registers are measured, both registers will collapse into one random VALID key-value pair, with any addition or subtraction done to the "value." See QInterface::IndexedLDA for context.
FOR BEST EFFICIENCY, the "values" array should be allocated aligned to a 64-byte boundary. (See the unit tests suite code for an example of how to align the allocation.)
While a QInterface represents an interacting set of qubit-based registers, or a virtual quantum chip, the registers need to interact in some way with (classical or quantum) RAM. IndexedLDA is a RAM access method similar to the X addressing mode of the MOS 6502 chip, if the X register can be in a state of coherent superposition when it loads from RAM. "IndexedADC" and "IndexedSBC" perform add and subtract (with carry) operations on a state usually initially prepared with IndexedLDA().
Implements Qrack::QAlu.
|
pure virtual |
Subtract from an entangled 8 bit register state with a superposed index-offset-based read from classical memory.
"inputStart" is the start index of 8 qubits that act as an index into the 256 byte "values" array. The "outputStart" bits would usually already be entangled with the "inputStart" bits via a IndexedLDA() operation. With the "inputStart" bits being a "key" and the "outputStart" bits being a value, the permutation state |key, value> is mapped to |key, value - values[key]>. This is similar to classical parallel addition of two arrays. However, when either of the registers are measured, both registers will collapse into one random VALID key-value pair, with any addition or subtraction done to the "value." See QInterface::IndexedLDA for context.
FOR BEST EFFICIENCY, the "values" array should be allocated aligned to a 64-byte boundary. (See the unit tests suite code for an example of how to align the allocation.)
While a QInterface represents an interacting set of qubit-based registers, or a virtual quantum chip, the registers need to interact in some way with (classical or quantum) RAM. IndexedLDA is a RAM access method similar to the X addressing mode of the MOS 6502 chip, if the X register can be in a state of coherent superposition when it loads from RAM. "IndexedADC" and "IndexedSBC" perform add and subtract (with carry) operations on a state usually initially prepared with IndexedLDA().
Implemented in Qrack::QUnit, Qrack::QStabilizerHybrid, Qrack::QPager, Qrack::QHybrid, Qrack::QEngineOCL, Qrack::QEngineCUDA, Qrack::QEngineCPU, Qrack::QBdtHybrid, and Qrack::QBdt.
Logical shift left, filling the extra bits with |0>
Logical shift right, filling the extra bits with |0>
|
virtual |
Multiply by integer.
Implements Qrack::QAlu.
|
virtual |
Multiply by integer.
Implements Qrack::QAlu.
|
pure virtual |
Multiply by integer.
Implemented in Qrack::QUnit, Qrack::QStabilizerHybrid, Qrack::QPager, Qrack::QHybrid, Qrack::QEngineOCL, Qrack::QEngineCUDA, Qrack::QEngineCPU, Qrack::QBdtHybrid, and Qrack::QBdt.
|
virtual |
Multiplication modulo N by integer, (out of place)
Reimplemented from Qrack::QEngine.
|
virtual |
Multiplication modulo N by integer, (out of place)
Reimplemented in Qrack::QUnit, Qrack::QStabilizerHybrid, Qrack::QPager, Qrack::QHybrid, Qrack::QEngineOCL, Qrack::QEngineCUDA, Qrack::QEngineCPU, Qrack::QEngine, Qrack::QBdtHybrid, and Qrack::QBdt.
|
inlinevirtual |
Multiplication modulo N by integer, (out of place)
Implements Qrack::QAlu.
|
pure virtual |
Multiplication modulo N by integer, (out of place)
Implemented in Qrack::QUnit, Qrack::QStabilizerHybrid, Qrack::QPager, Qrack::QHybrid, Qrack::QEngineOCL, Qrack::QEngineCUDA, Qrack::QEngineCPU, Qrack::QEngine, Qrack::QBdtHybrid, and Qrack::QBdt.
|
virtual |
This is an expedient for an adaptive Grover's search for a function's global minimum.
Implements Qrack::QAlu.
|
virtual |
This is an expedient for an adaptive Grover's search for a function's global minimum.
Implements Qrack::QAlu.
|
pure virtual |
This is an expedient for an adaptive Grover's search for a function's global minimum.
Implemented in Qrack::QUnit, Qrack::QStabilizerHybrid, Qrack::QPager, Qrack::QHybrid, Qrack::QEngineOCL, Qrack::QEngineCUDA, Qrack::QEngineCPU, Qrack::QBdtHybrid, and Qrack::QBdt.
|
virtual |
Raise a classical base to a quantum power, modulo N, (out of place)
Implements Qrack::QAlu.
|
virtual |
Raise a classical base to a quantum power, modulo N, (out of place)
Implements Qrack::QAlu.
|
pure virtual |
Raise a classical base to a quantum power, modulo N, (out of place)
Implemented in Qrack::QUnit, Qrack::QStabilizerHybrid, Qrack::QPager, Qrack::QHybrid, Qrack::QEngineOCL, Qrack::QEngineCUDA, Qrack::QEngineCPU, Qrack::QBdtHybrid, and Qrack::QBdt.
"Circular shift left" - shift bits left, and carry last bits.
Reimplemented from Qrack::QInterface.
Circular shift left - shift bits left, and carry last bits.
"Circular shift right" - (Uses swap-based algorithm for speed)
Reimplemented in Qrack::QEngineOCL, Qrack::QEngineCUDA, and Qrack::QEngineCPU.