Qrack  9.9
General classical-emulating-quantum development framework
Functions
Arithmetic and other opcode-like gate implemenations.
Collaboration diagram for Arithmetic and other opcode-like gate implemenations.:

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...
 

Detailed Description

Function Documentation

◆ ADC()

void Qrack::QInterface::ADC ( bitLenInt  input1,
bitLenInt  input2,
bitLenInt  output,
bitLenInt  length,
bitLenInt  carry 
)
virtual

Add a quantum integer to a quantum integer, with carry.

(Assumes the output register is in the 0 state)

◆ ASL()

void Qrack::QInterface::ASL ( bitLenInt  shift,
bitLenInt  start,
bitLenInt  length 
)
virtual

Arithmetic shift left, with last 2 bits as sign and carry.

◆ ASR()

void Qrack::QInterface::ASR ( bitLenInt  shift,
bitLenInt  start,
bitLenInt  length 
)
virtual

Arithmetic shift right, with last 2 bits as sign and carry.

◆ CADC()

void Qrack::QInterface::CADC ( const std::vector< bitLenInt > &  controls,
bitLenInt  input1,
bitLenInt  input2,
bitLenInt  output,
bitLenInt  length,
bitLenInt  carry 
)
virtual

Add a quantum integer to a quantum integer, with carry and with controls.

(Assumes the output register is in the 0 state)

◆ CDEC() [1/3]

virtual void Qrack::QInterface::CDEC ( const bitCapInt toSub,
bitLenInt  inOutStart,
bitLenInt  length,
const std::vector< bitLenInt > &  controls 
)
inlinevirtual

Subtract classical integer (without sign, with controls)

Reimplemented in Qrack::QUnit, Qrack::QEngine, Qrack::QBdtHybrid, and Qrack::QBdt.

◆ CDEC() [2/3]

virtual void Qrack::QUnit::CDEC ( const bitCapInt toSub,
bitLenInt  start,
bitLenInt  length,
const std::vector< bitLenInt > &  controls 
)
inlinevirtual

Subtract integer (without sign, with controls)

Reimplemented from Qrack::QAlu.

◆ CDEC() [3/3]

void Qrack::QAlu::CDEC ( const bitCapInt toSub,
bitLenInt  start,
bitLenInt  length,
const std::vector< bitLenInt > &  controls 
)
virtual

Subtract integer (without sign, with controls)

Reimplemented in Qrack::QUnit, Qrack::QEngine, Qrack::QBdtHybrid, and Qrack::QBdt.

◆ CDIV() [1/3]

void Qrack::QEngineCPU::CDIV ( const bitCapInt toDiv,
bitLenInt  start,
bitLenInt  carryStart,
bitLenInt  length,
const std::vector< bitLenInt > &  controls 
)
virtual

Controlled division by power of integer.

Implements Qrack::QAlu.

◆ CDIV() [2/3]

void Qrack::QUnit::CDIV ( const bitCapInt toDiv,
bitLenInt  start,
bitLenInt  carryStart,
bitLenInt  length,
const std::vector< bitLenInt > &  controls 
)
virtual

Controlled division by power of integer.

Implements Qrack::QAlu.

◆ CDIV() [3/3]

virtual void Qrack::QAlu::CDIV ( const bitCapInt toDiv,
bitLenInt  start,
bitLenInt  carryStart,
bitLenInt  length,
const std::vector< bitLenInt > &  controls 
)
pure virtual

◆ CFullAdd()

void Qrack::QInterface::CFullAdd ( const std::vector< bitLenInt > &  controls,
bitLenInt  inputBit1,
bitLenInt  inputBit2,
bitLenInt  carryInSumOut,
bitLenInt  carryOut 
)
virtual

Controlled quantum analog of classical "Full Adder" gate.

Quantum analog of classical "Full Adder" gate.

(Assumes the outputBit is in the 0 state)

◆ CIADC()

void Qrack::QInterface::CIADC ( const std::vector< bitLenInt > &  controls,
bitLenInt  input1,
bitLenInt  input2,
bitLenInt  output,
bitLenInt  length,
bitLenInt  carry 
)
virtual

Inverse of CADC.

(Can be thought of as "subtraction," but with a register convention that the same inputs invert CADC.)

◆ CIFullAdd()

void Qrack::QInterface::CIFullAdd ( const std::vector< bitLenInt > &  controls,
bitLenInt  inputBit1,
bitLenInt  inputBit2,
bitLenInt  carryInSumOut,
bitLenInt  carryOut 
)
virtual

Inverse of CFullAdd.

Inverse of FullAdd.

(Can be thought of as "subtraction," but with a register convention that the same inputs invert CFullAdd.)

◆ CIMULModNOut() [1/4]

void Qrack::QEngineCPU::CIMULModNOut ( const bitCapInt toMul,
const bitCapInt modN,
bitLenInt  inStart,
bitLenInt  outStart,
bitLenInt  length,
const std::vector< bitLenInt > &  controls 
)
virtual

Inverse of controlled multiplication modulo N by integer, (out of place)

Reimplemented from Qrack::QEngine.

◆ CIMULModNOut() [2/4]

void Qrack::QInterface::CIMULModNOut ( const bitCapInt toMul,
const bitCapInt modN,
bitLenInt  inStart,
bitLenInt  outStart,
bitLenInt  length,
const std::vector< bitLenInt > &  controls 
)
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.

◆ CIMULModNOut() [3/4]

virtual void Qrack::QUnit::CIMULModNOut ( const bitCapInt toMul,
const bitCapInt modN,
bitLenInt  inStart,
bitLenInt  outStart,
bitLenInt  length,
const std::vector< bitLenInt > &  controls 
)
inlinevirtual

Inverse of controlled multiplication modulo N by integer, (out of place)

Implements Qrack::QAlu.

◆ CIMULModNOut() [4/4]

virtual void Qrack::QAlu::CIMULModNOut ( const bitCapInt toMul,
const bitCapInt modN,
bitLenInt  inStart,
bitLenInt  outStart,
bitLenInt  length,
const std::vector< bitLenInt > &  controls 
)
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.

◆ CINC() [1/4]

void Qrack::QEngineCPU::CINC ( const bitCapInt toAdd,
bitLenInt  inOutStart,
bitLenInt  length,
const std::vector< bitLenInt > &  controls 
)
virtual

Add integer (without sign, with controls)

Reimplemented from Qrack::QEngine.

◆ CINC() [2/4]

void Qrack::QInterface::CINC ( const bitCapInt toAdd,
bitLenInt  inOutStart,
bitLenInt  length,
const std::vector< bitLenInt > &  controls 
)
virtual

◆ CINC() [3/4]

void Qrack::QUnit::CINC ( const bitCapInt toAdd,
bitLenInt  start,
bitLenInt  length,
const std::vector< bitLenInt > &  controls 
)
virtual

Add integer (without sign, with controls)

Implements Qrack::QAlu.

◆ CINC() [4/4]

virtual void Qrack::QAlu::CINC ( const bitCapInt toAdd,
bitLenInt  start,
bitLenInt  length,
const std::vector< bitLenInt > &  controls 
)
pure virtual

◆ CMUL() [1/3]

void Qrack::QEngineCPU::CMUL ( const bitCapInt toMul,
bitLenInt  start,
bitLenInt  carryStart,
bitLenInt  length,
const std::vector< bitLenInt > &  controls 
)
virtual

Controlled multiplication by integer.

Implements Qrack::QAlu.

◆ CMUL() [2/3]

void Qrack::QUnit::CMUL ( const bitCapInt toMul,
bitLenInt  start,
bitLenInt  carryStart,
bitLenInt  length,
const std::vector< bitLenInt > &  controls 
)
virtual

Controlled multiplication by integer.

Implements Qrack::QAlu.

◆ CMUL() [3/3]

virtual void Qrack::QAlu::CMUL ( const bitCapInt toMul,
bitLenInt  start,
bitLenInt  carryStart,
bitLenInt  length,
const std::vector< bitLenInt > &  controls 
)
pure virtual

◆ CMULModNOut() [1/4]

void Qrack::QEngineCPU::CMULModNOut ( const bitCapInt toMul,
const bitCapInt modN,
bitLenInt  inStart,
bitLenInt  outStart,
bitLenInt  length,
const std::vector< bitLenInt > &  controls 
)
virtual

Controlled multiplication modulo N by integer, (out of place)

Reimplemented from Qrack::QEngine.

◆ CMULModNOut() [2/4]

void Qrack::QInterface::CMULModNOut ( const bitCapInt toMul,
const bitCapInt modN,
bitLenInt  inStart,
bitLenInt  outStart,
bitLenInt  length,
const std::vector< bitLenInt > &  controls 
)
virtual

◆ CMULModNOut() [3/4]

virtual void Qrack::QUnit::CMULModNOut ( const bitCapInt toMul,
const bitCapInt modN,
bitLenInt  inStart,
bitLenInt  outStart,
bitLenInt  length,
const std::vector< bitLenInt > &  controls 
)
inlinevirtual

Controlled multiplication modulo N by integer, (out of place)

Implements Qrack::QAlu.

◆ CMULModNOut() [4/4]

virtual void Qrack::QAlu::CMULModNOut ( const bitCapInt toMul,
const bitCapInt modN,
bitLenInt  inStart,
bitLenInt  outStart,
bitLenInt  length,
const std::vector< bitLenInt > &  controls 
)
pure virtual

◆ CPhaseFlipIfLess() [1/3]

void Qrack::QEngineCPU::CPhaseFlipIfLess ( const bitCapInt greaterPerm,
bitLenInt  start,
bitLenInt  length,
bitLenInt  flagIndex 
)
virtual

The 6502 uses its carry flag also as a greater-than/less-than flag, for the CMP operation.

Implements Qrack::QAlu.

◆ CPhaseFlipIfLess() [2/3]

void Qrack::QUnit::CPhaseFlipIfLess ( const bitCapInt greaterPerm,
bitLenInt  start,
bitLenInt  length,
bitLenInt  flagIndex 
)
virtual

The 6502 uses its carry flag also as a greater-than/less-than flag, for the CMP operation.

Implements Qrack::QAlu.

◆ CPhaseFlipIfLess() [3/3]

virtual void Qrack::QAlu::CPhaseFlipIfLess ( const bitCapInt greaterPerm,
bitLenInt  start,
bitLenInt  length,
bitLenInt  flagIndex 
)
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.

◆ CPOWModNOut() [1/3]

void Qrack::QEngineCPU::CPOWModNOut ( const bitCapInt base,
const bitCapInt modN,
bitLenInt  inStart,
bitLenInt  outStart,
bitLenInt  length,
const std::vector< bitLenInt > &  controls 
)
virtual

Controlled, raise a classical base to a quantum power, modulo N, (out of place)

Implements Qrack::QAlu.

◆ CPOWModNOut() [2/3]

void Qrack::QUnit::CPOWModNOut ( const bitCapInt base,
const bitCapInt modN,
bitLenInt  inStart,
bitLenInt  outStart,
bitLenInt  length,
const std::vector< bitLenInt > &  controls 
)
virtual

Controlled, raise a classical base to a quantum power, modulo N, (out of place)

Implements Qrack::QAlu.

◆ CPOWModNOut() [3/3]

virtual void Qrack::QAlu::CPOWModNOut ( const bitCapInt base,
const bitCapInt modN,
bitLenInt  inStart,
bitLenInt  outStart,
bitLenInt  length,
const std::vector< bitLenInt > &  controls 
)
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.

◆ DEC() [1/3]

virtual void Qrack::QInterface::DEC ( const bitCapInt toSub,
bitLenInt  start,
bitLenInt  length 
)
inlinevirtual

Subtract classical integer (without sign)

Reimplemented in Qrack::QUnit, Qrack::QStabilizerHybrid, Qrack::QEngine, Qrack::QBdtHybrid, and Qrack::QBdt.

◆ DEC() [2/3]

virtual void Qrack::QUnit::DEC ( const bitCapInt toSub,
bitLenInt  start,
bitLenInt  length 
)
inlinevirtual

Add integer (without sign)

Subtract integer (without sign)

Implements Qrack::QAlu.

◆ DEC() [3/3]

void Qrack::QAlu::DEC ( const bitCapInt toSub,
bitLenInt  start,
bitLenInt  length 
)
pure virtual

Add integer (without sign)

Subtract integer (without sign)

Implemented in Qrack::QUnit, Qrack::QStabilizerHybrid, Qrack::QEngine, Qrack::QBdtHybrid, and Qrack::QBdt.

◆ DECBCD() [1/2]

void Qrack::QUnit::DECBCD ( const bitCapInt toSub,
bitLenInt  start,
bitLenInt  length 
)
virtual

Subtract classical BCD integer (without sign)

Subtract BCD integer (without sign)

Reimplemented from Qrack::QAlu.

◆ DECBCD() [2/2]

void Qrack::QAlu::DECBCD ( const bitCapInt toSub,
bitLenInt  start,
bitLenInt  length 
)
virtual

Subtract classical BCD integer (without sign)

Subtract BCD integer (without sign)

Reimplemented in Qrack::QUnit.

◆ DECBCDC()

void Qrack::QAlu::DECBCDC ( const bitCapInt toSub,
bitLenInt  start,
bitLenInt  length,
bitLenInt  carryIndex 
)
virtual

Subtract BCD integer (without sign, with carry)

Reimplemented in Qrack::QHybrid, and Qrack::QBdtHybrid.

◆ DECC() [1/3]

void Qrack::QAlu::DECC ( const bitCapInt toSub,
bitLenInt  start,
bitLenInt  length,
bitLenInt  carryIndex 
)
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.

◆ DECC() [2/3]

virtual void Qrack::QInterface::DECC ( const bitCapInt toSub,
bitLenInt  start,
bitLenInt  length,
bitLenInt  carryIndex 
)
inlinevirtual

Subtract classical integer (without sign, with carry)

Reimplemented in Qrack::QUnit, Qrack::QHybrid, Qrack::QEngine, Qrack::QBdtHybrid, and Qrack::QBdt.

◆ DECC() [3/3]

void Qrack::QUnit::DECC ( const bitCapInt toSub,
bitLenInt  start,
bitLenInt  length,
bitLenInt  carryIndex 
)
virtual

Subtract integer (without sign, with carry)

Reimplemented from Qrack::QAlu.

◆ DECS() [1/3]

void Qrack::QAlu::DECS ( const bitCapInt toSub,
bitLenInt  start,
bitLenInt  length,
bitLenInt  overflowIndex 
)
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.

◆ DECS() [2/3]

virtual void Qrack::QInterface::DECS ( const bitCapInt toSub,
bitLenInt  start,
bitLenInt  length,
bitLenInt  overflowIndex 
)
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.

◆ DECS() [3/3]

virtual void Qrack::QUnit::DECS ( const bitCapInt toSub,
bitLenInt  start,
bitLenInt  length,
bitLenInt  overflowIndex 
)
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.

◆ DECSC() [1/2]

void Qrack::QAlu::DECSC ( const bitCapInt toSub,
bitLenInt  start,
bitLenInt  length,
bitLenInt  carryIndex 
)
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.

◆ DECSC() [2/2]

void Qrack::QAlu::DECSC ( const bitCapInt toSub,
bitLenInt  start,
bitLenInt  length,
bitLenInt  overflowIndex,
bitLenInt  carryIndex 
)
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.

◆ DIV() [1/3]

void Qrack::QEngineCPU::DIV ( const bitCapInt toDiv,
bitLenInt  start,
bitLenInt  carryStart,
bitLenInt  length 
)
virtual

Divide by integer.

Implements Qrack::QAlu.

◆ DIV() [2/3]

void Qrack::QUnit::DIV ( const bitCapInt toDiv,
bitLenInt  start,
bitLenInt  carryStart,
bitLenInt  length 
)
virtual

Divide by integer.

Implements Qrack::QAlu.

◆ DIV() [3/3]

virtual void Qrack::QAlu::DIV ( const bitCapInt toDiv,
bitLenInt  start,
bitLenInt  carryStart,
bitLenInt  length 
)
pure virtual

◆ FullAdd() [1/2]

void Qrack::QEngineCPU::FullAdd ( bitLenInt  inputBit1,
bitLenInt  inputBit2,
bitLenInt  carryInSumOut,
bitLenInt  carryOut 
)
virtual

Quantum analog of classical "Full Adder" gate.

(Assumes the outputBit is in the 0 state)

Reimplemented from Qrack::QInterface.

◆ FullAdd() [2/2]

virtual void Qrack::QInterface::FullAdd ( bitLenInt  inputBit1,
bitLenInt  inputBit2,
bitLenInt  carryInSumOut,
bitLenInt  carryOut 
)
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.

◆ Hash() [1/3]

void Qrack::QEngineCPU::Hash ( bitLenInt  start,
bitLenInt  length,
const unsigned char *  values 
)
virtual

Transform a length of qubit register via lookup through a hash table.

Implements Qrack::QAlu.

◆ Hash() [2/3]

void Qrack::QUnit::Hash ( bitLenInt  start,
bitLenInt  length,
const unsigned char *  values 
)
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.

Implements Qrack::QAlu.

◆ Hash() [3/3]

virtual void Qrack::QAlu::Hash ( bitLenInt  start,
bitLenInt  length,
const unsigned char *  values 
)
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.

◆ IADC()

void Qrack::QInterface::IADC ( bitLenInt  input1,
bitLenInt  input2,
bitLenInt  output,
bitLenInt  length,
bitLenInt  carry 
)
virtual

Inverse of ADC.

(Can be thought of as "subtraction," but with a register convention that the same inputs invert ADC.)

◆ IFullAdd() [1/2]

void Qrack::QEngineCPU::IFullAdd ( bitLenInt  inputBit1,
bitLenInt  inputBit2,
bitLenInt  carryInSumOut,
bitLenInt  carryOut 
)
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.

◆ IFullAdd() [2/2]

virtual void Qrack::QInterface::IFullAdd ( bitLenInt  inputBit1,
bitLenInt  inputBit2,
bitLenInt  carryInSumOut,
bitLenInt  carryOut 
)
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.

◆ IMULModNOut() [1/4]

void Qrack::QEngineCPU::IMULModNOut ( const bitCapInt toMul,
const bitCapInt modN,
bitLenInt  inStart,
bitLenInt  outStart,
bitLenInt  length 
)
virtual

Inverse of multiplication modulo N by integer, (out of place)

Reimplemented from Qrack::QEngine.

◆ IMULModNOut() [2/4]

void Qrack::QInterface::IMULModNOut ( const bitCapInt toMul,
const bitCapInt modN,
bitLenInt  inStart,
bitLenInt  outStart,
bitLenInt  length 
)
virtual

◆ IMULModNOut() [3/4]

virtual void Qrack::QUnit::IMULModNOut ( const bitCapInt toMul,
const bitCapInt modN,
bitLenInt  inStart,
bitLenInt  outStart,
bitLenInt  length 
)
inlinevirtual

Inverse of multiplication modulo N by integer, (out of place)

Implements Qrack::QAlu.

◆ IMULModNOut() [4/4]

virtual void Qrack::QAlu::IMULModNOut ( const bitCapInt toMul,
const bitCapInt modN,
bitLenInt  inStart,
bitLenInt  outStart,
bitLenInt  length 
)
pure virtual

◆ INC() [1/4]

void Qrack::QEngineCPU::INC ( const bitCapInt toAdd,
bitLenInt  start,
bitLenInt  length 
)
virtual

Add integer (without sign)

Reimplemented from Qrack::QEngine.

◆ INC() [2/4]

void Qrack::QInterface::INC ( const bitCapInt toAdd,
bitLenInt  start,
bitLenInt  length 
)
virtual

◆ INC() [3/4]

void Qrack::QUnit::INC ( const bitCapInt toAdd,
bitLenInt  start,
bitLenInt  length 
)
virtual

Add integer (without sign)

Implements Qrack::QAlu.

◆ INC() [4/4]

virtual void Qrack::QAlu::INC ( const bitCapInt toAdd,
bitLenInt  start,
bitLenInt  length 
)
pure virtual

◆ INCBCD() [1/3]

void Qrack::QEngineCPU::INCBCD ( const bitCapInt toAdd,
bitLenInt  start,
bitLenInt  length 
)
virtual

Add BCD integer (without sign)

Implements Qrack::QAlu.

◆ INCBCD() [2/3]

void Qrack::QUnit::INCBCD ( const bitCapInt toAdd,
bitLenInt  start,
bitLenInt  length 
)
virtual

Add classical BCD integer (without sign)

Implements Qrack::QAlu.

◆ INCBCD() [3/3]

virtual void Qrack::QAlu::INCBCD ( const bitCapInt toAdd,
bitLenInt  start,
bitLenInt  length 
)
pure virtual

◆ INCBCDC()

void Qrack::QAlu::INCBCDC ( const bitCapInt toAdd,
bitLenInt  start,
bitLenInt  length,
bitLenInt  carryIndex 
)
virtual

Add classical BCD integer (without sign, with carry)

Add BCD integer (without sign, with carry)

Reimplemented in Qrack::QHybrid, and Qrack::QBdtHybrid.

◆ INCC() [1/3]

void Qrack::QAlu::INCC ( const bitCapInt toAdd,
bitLenInt  start,
bitLenInt  length,
bitLenInt  carryIndex 
)
virtual

Add integer (without sign, with carry)

Reimplemented in Qrack::QUnit, Qrack::QHybrid, Qrack::QEngine, Qrack::QBdtHybrid, and Qrack::QBdt.

◆ INCC() [2/3]

virtual void Qrack::QInterface::INCC ( const bitCapInt toAdd,
bitLenInt  start,
bitLenInt  length,
bitLenInt  carryIndex 
)
inlinevirtual

Add integer (without sign, with carry)

Reimplemented in Qrack::QUnit, Qrack::QHybrid, Qrack::QEngine, Qrack::QBdtHybrid, and Qrack::QBdt.

◆ INCC() [3/3]

void Qrack::QUnit::INCC ( const bitCapInt toAdd,
bitLenInt  start,
bitLenInt  length,
bitLenInt  carryIndex 
)
virtual

Add integer (without sign, with carry)

Reimplemented from Qrack::QAlu.

◆ INCDECBCDC() [1/2]

virtual void Qrack::QAlu::INCDECBCDC ( const bitCapInt toMod,
bitLenInt  start,
bitLenInt  length,
bitLenInt  carryIndex 
)
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.

◆ INCDECBCDC() [2/2]

void Qrack::QUnit::INCDECBCDC ( const bitCapInt toMod,
bitLenInt  start,
bitLenInt  length,
bitLenInt  carryIndex 
)
virtual

Common driver method behind INCSC and DECSC (without overflow flag)

Implements Qrack::QAlu.

◆ INCDECC() [1/3]

void Qrack::QInterface::INCDECC ( const bitCapInt toAdd,
bitLenInt  start,
bitLenInt  length,
bitLenInt  carryIndex 
)
virtual

◆ INCDECC() [2/3]

virtual void Qrack::QUnit::INCDECC ( const bitCapInt toMod,
bitLenInt  start,
bitLenInt  length,
bitLenInt  carryIndex 
)
inlinevirtual

Common driver method behind INCC and DECC (without sign, with carry)

Implements Qrack::QAlu.

◆ INCDECC() [3/3]

virtual void Qrack::QAlu::INCDECC ( const bitCapInt toMod,
bitLenInt  start,
bitLenInt  length,
bitLenInt  carryIndex 
)
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.

◆ INCDECSC() [1/4]

void Qrack::QUnit::INCDECSC ( const bitCapInt toMod,
bitLenInt  start,
bitLenInt  length,
bitLenInt  carryIndex 
)
virtual

Common driver method behind INCSC and DECSC (without overflow flag)

Implements Qrack::QAlu.

◆ INCDECSC() [2/4]

void Qrack::QUnit::INCDECSC ( const bitCapInt toMod,
bitLenInt  start,
bitLenInt  length,
bitLenInt  overflowIndex,
bitLenInt  carryIndex 
)
virtual

Common driver method behind INCSC and DECSC (with overflow flag)

Implements Qrack::QAlu.

◆ INCDECSC() [3/4]

virtual void Qrack::QAlu::INCDECSC ( const bitCapInt toMod,
bitLenInt  start,
bitLenInt  length,
bitLenInt  carryIndex 
)
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.

◆ INCDECSC() [4/4]

virtual void Qrack::QAlu::INCDECSC ( const bitCapInt toMod,
bitLenInt  start,
bitLenInt  length,
bitLenInt  overflowIndex,
bitLenInt  carryIndex 
)
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.

◆ INCS() [1/4]

void Qrack::QEngineCPU::INCS ( const bitCapInt toAdd,
bitLenInt  inOutStart,
bitLenInt  length,
bitLenInt  overflowIndex 
)
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.

◆ INCS() [2/4]

virtual void Qrack::QInterface::INCS ( const bitCapInt toAdd,
bitLenInt  start,
bitLenInt  length,
bitLenInt  overflowIndex 
)
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.

◆ INCS() [3/4]

void Qrack::QUnit::INCS ( const bitCapInt toAdd,
bitLenInt  start,
bitLenInt  length,
bitLenInt  overflowIndex 
)
virtual

Add a classical integer to the register, with sign and without carry.

Implements Qrack::QAlu.

◆ INCS() [4/4]

virtual void Qrack::QAlu::INCS ( const bitCapInt toAdd,
bitLenInt  start,
bitLenInt  length,
bitLenInt  overflowIndex 
)
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.

◆ INCSC() [1/2]

void Qrack::QAlu::INCSC ( const bitCapInt toAdd,
bitLenInt  start,
bitLenInt  length,
bitLenInt  carryIndex 
)
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.

◆ INCSC() [2/2]

void Qrack::QAlu::INCSC ( const bitCapInt toAdd,
bitLenInt  start,
bitLenInt  length,
bitLenInt  overflowIndex,
bitLenInt  carryIndex 
)
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.

◆ IndexedADC() [1/3]

bitCapInt Qrack::QEngineCPU::IndexedADC ( bitLenInt  indexStart,
bitLenInt  indexLength,
bitLenInt  valueStart,
bitLenInt  valueLength,
bitLenInt  carryIndex,
const unsigned char *  values 
)
virtual

Add based on an indexed load from classical memory.

Implements Qrack::QAlu.

◆ IndexedADC() [2/3]

bitCapInt Qrack::QUnit::IndexedADC ( bitLenInt  indexStart,
bitLenInt  indexLength,
bitLenInt  valueStart,
bitLenInt  valueLength,
bitLenInt  carryIndex,
const unsigned char *  values 
)
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.

◆ IndexedADC() [3/3]

virtual bitCapInt Qrack::QAlu::IndexedADC ( bitLenInt  indexStart,
bitLenInt  indexLength,
bitLenInt  valueStart,
bitLenInt  valueLength,
bitLenInt  carryIndex,
const unsigned char *  values 
)
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.

◆ IndexedLDA() [1/3]

bitCapInt Qrack::QEngineCPU::IndexedLDA ( bitLenInt  indexStart,
bitLenInt  indexLength,
bitLenInt  valueStart,
bitLenInt  valueLength,
const unsigned char *  values,
bool  resetValue = true 
)
virtual

Set 8 bit register bits based on read from classical memory.

Implements Qrack::QAlu.

◆ IndexedLDA() [2/3]

bitCapInt Qrack::QUnit::IndexedLDA ( bitLenInt  indexStart,
bitLenInt  indexLength,
bitLenInt  valueStart,
bitLenInt  valueLength,
const unsigned char *  values,
bool  resetValue = true 
)
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.

◆ IndexedLDA() [3/3]

virtual bitCapInt Qrack::QAlu::IndexedLDA ( bitLenInt  indexStart,
bitLenInt  indexLength,
bitLenInt  valueStart,
bitLenInt  valueLength,
const unsigned char *  values,
bool  resetValue = true 
)
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.

◆ IndexedSBC() [1/3]

bitCapInt Qrack::QEngineCPU::IndexedSBC ( bitLenInt  indexStart,
bitLenInt  indexLength,
bitLenInt  valueStart,
bitLenInt  valueLength,
bitLenInt  carryIndex,
const unsigned char *  values 
)
virtual

Subtract based on an indexed load from classical memory.

Implements Qrack::QAlu.

◆ IndexedSBC() [2/3]

bitCapInt Qrack::QUnit::IndexedSBC ( bitLenInt  indexStart,
bitLenInt  indexLength,
bitLenInt  valueStart,
bitLenInt  valueLength,
bitLenInt  carryIndex,
const unsigned char *  values 
)
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.

◆ IndexedSBC() [3/3]

virtual bitCapInt Qrack::QAlu::IndexedSBC ( bitLenInt  indexStart,
bitLenInt  indexLength,
bitLenInt  valueStart,
bitLenInt  valueLength,
bitLenInt  carryIndex,
const unsigned char *  values 
)
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.

◆ LSL()

void Qrack::QInterface::LSL ( bitLenInt  shift,
bitLenInt  start,
bitLenInt  length 
)
virtual

Logical shift left, filling the extra bits with |0>

◆ LSR()

void Qrack::QInterface::LSR ( bitLenInt  shift,
bitLenInt  start,
bitLenInt  length 
)
virtual

Logical shift right, filling the extra bits with |0>

◆ MUL() [1/3]

void Qrack::QEngineCPU::MUL ( const bitCapInt toMul,
bitLenInt  start,
bitLenInt  carryStart,
bitLenInt  length 
)
virtual

Multiply by integer.

Implements Qrack::QAlu.

◆ MUL() [2/3]

void Qrack::QUnit::MUL ( const bitCapInt toMul,
bitLenInt  start,
bitLenInt  carryStart,
bitLenInt  length 
)
virtual

Multiply by integer.

Implements Qrack::QAlu.

◆ MUL() [3/3]

virtual void Qrack::QAlu::MUL ( const bitCapInt toMul,
bitLenInt  start,
bitLenInt  carryStart,
bitLenInt  length 
)
pure virtual

◆ MULModNOut() [1/4]

void Qrack::QEngineCPU::MULModNOut ( const bitCapInt toMul,
const bitCapInt modN,
bitLenInt  inStart,
bitLenInt  outStart,
bitLenInt  length 
)
virtual

Multiplication modulo N by integer, (out of place)

Reimplemented from Qrack::QEngine.

◆ MULModNOut() [2/4]

void Qrack::QInterface::MULModNOut ( const bitCapInt toMul,
const bitCapInt modN,
bitLenInt  inStart,
bitLenInt  outStart,
bitLenInt  length 
)
virtual

◆ MULModNOut() [3/4]

virtual void Qrack::QUnit::MULModNOut ( const bitCapInt toMul,
const bitCapInt modN,
bitLenInt  inStart,
bitLenInt  outStart,
bitLenInt  length 
)
inlinevirtual

Multiplication modulo N by integer, (out of place)

Implements Qrack::QAlu.

◆ MULModNOut() [4/4]

virtual void Qrack::QAlu::MULModNOut ( const bitCapInt toMul,
const bitCapInt modN,
bitLenInt  inStart,
bitLenInt  outStart,
bitLenInt  length 
)
pure virtual

◆ PhaseFlipIfLess() [1/3]

void Qrack::QEngineCPU::PhaseFlipIfLess ( const bitCapInt greaterPerm,
bitLenInt  start,
bitLenInt  length 
)
virtual

This is an expedient for an adaptive Grover's search for a function's global minimum.

Implements Qrack::QAlu.

◆ PhaseFlipIfLess() [2/3]

void Qrack::QUnit::PhaseFlipIfLess ( const bitCapInt greaterPerm,
bitLenInt  start,
bitLenInt  length 
)
virtual

This is an expedient for an adaptive Grover's search for a function's global minimum.

Implements Qrack::QAlu.

◆ PhaseFlipIfLess() [3/3]

virtual void Qrack::QAlu::PhaseFlipIfLess ( const bitCapInt greaterPerm,
bitLenInt  start,
bitLenInt  length 
)
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.

◆ POWModNOut() [1/3]

void Qrack::QEngineCPU::POWModNOut ( const bitCapInt base,
const bitCapInt modN,
bitLenInt  inStart,
bitLenInt  outStart,
bitLenInt  length 
)
virtual

Raise a classical base to a quantum power, modulo N, (out of place)

Implements Qrack::QAlu.

◆ POWModNOut() [2/3]

void Qrack::QUnit::POWModNOut ( const bitCapInt base,
const bitCapInt modN,
bitLenInt  inStart,
bitLenInt  outStart,
bitLenInt  length 
)
virtual

Raise a classical base to a quantum power, modulo N, (out of place)

Implements Qrack::QAlu.

◆ POWModNOut() [3/3]

virtual void Qrack::QAlu::POWModNOut ( const bitCapInt base,
const bitCapInt modN,
bitLenInt  inStart,
bitLenInt  outStart,
bitLenInt  length 
)
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.

◆ ROL() [1/2]

void Qrack::QEngineCPU::ROL ( bitLenInt  shift,
bitLenInt  start,
bitLenInt  length 
)
virtual

"Circular shift left" - shift bits left, and carry last bits.

Reimplemented from Qrack::QInterface.

◆ ROL() [2/2]

void Qrack::QInterface::ROL ( bitLenInt  shift,
bitLenInt  start,
bitLenInt  length 
)
virtual

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.

◆ ROR()

void Qrack::QInterface::ROR ( bitLenInt  shift,
bitLenInt  start,
bitLenInt  length 
)
virtual

Circular shift right - shift bits right, and carry first bits.

"Circular shift right" - shift bits right, and carry first bits.