Qrack  7.0
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 (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 (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 (bitCapInt toAdd, bitLenInt start, bitLenInt length)=0
 Add integer (without sign) More...
 
virtual void Qrack::QAlu::DEC (bitCapInt toSub, bitLenInt start, bitLenInt length)=0
 Add integer (without sign) More...
 
virtual void Qrack::QAlu::CINC (bitCapInt toAdd, bitLenInt start, bitLenInt length, const bitLenInt *controls, bitLenInt controlLen)=0
 Add integer (without sign, with controls) More...
 
virtual void Qrack::QAlu::CDEC (bitCapInt toSub, bitLenInt start, bitLenInt length, const bitLenInt *controls, bitLenInt controlLen)
 Subtract integer (without sign, with controls) More...
 
virtual void Qrack::QAlu::INCC (bitCapInt toAdd, bitLenInt start, bitLenInt length, bitLenInt carryIndex)
 Add integer (without sign, with carry) More...
 
virtual void Qrack::QAlu::DECC (bitCapInt toSub, bitLenInt start, bitLenInt length, bitLenInt carryIndex)
 Subtract classical integer (without sign, with carry) More...
 
virtual void Qrack::QAlu::INCDECC (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 (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 (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 (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 (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 (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 (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 (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 (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 (bitCapInt toMul, bitLenInt start, bitLenInt carryStart, bitLenInt length)=0
 Multiply by integer. More...
 
virtual void Qrack::QAlu::DIV (bitCapInt toDiv, bitLenInt start, bitLenInt carryStart, bitLenInt length)=0
 Divide by integer. More...
 
virtual void Qrack::QAlu::MULModNOut (bitCapInt toMul, bitCapInt modN, bitLenInt inStart, bitLenInt outStart, bitLenInt length)=0
 Multiplication modulo N by integer, (out of place) More...
 
virtual void Qrack::QAlu::IMULModNOut (bitCapInt toMul, 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 (bitCapInt base, 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 (bitCapInt toMul, bitLenInt start, bitLenInt carryStart, bitLenInt length, const bitLenInt *controls, bitLenInt controlLen)=0
 Controlled multiplication by integer. More...
 
virtual void Qrack::QAlu::CDIV (bitCapInt toDiv, bitLenInt start, bitLenInt carryStart, bitLenInt length, const bitLenInt *controls, bitLenInt controlLen)=0
 Controlled division by power of integer. More...
 
virtual void Qrack::QAlu::CMULModNOut (bitCapInt toMul, bitCapInt modN, bitLenInt inStart, bitLenInt outStart, bitLenInt length, const bitLenInt *controls, bitLenInt controlLen)=0
 Controlled multiplication modulo N by integer, (out of place) More...
 
virtual void Qrack::QAlu::CIMULModNOut (bitCapInt toMul, bitCapInt modN, bitLenInt inStart, bitLenInt outStart, bitLenInt length, const bitLenInt *controls, bitLenInt controlLen)=0
 Inverse of controlled multiplication modulo N by integer, (out of place) More...
 
virtual void Qrack::QAlu::CPOWModNOut (bitCapInt base, bitCapInt modN, bitLenInt inStart, bitLenInt outStart, bitLenInt length, const bitLenInt *controls, bitLenInt controlLen)=0
 Controlled, raise a classical base to a quantum power, modulo N, (out of place) More...
 
virtual void Qrack::QAlu::INCBCD (bitCapInt toAdd, bitLenInt start, bitLenInt length)=0
 Add classical BCD integer (without sign) More...
 
virtual void Qrack::QAlu::DECBCD (bitCapInt toSub, bitLenInt start, bitLenInt length)
 Subtract classical BCD integer (without sign) More...
 
virtual void Qrack::QAlu::INCDECBCDC (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 (bitCapInt toAdd, bitLenInt start, bitLenInt length, bitLenInt carryIndex)
 Add classical BCD integer (without sign, with carry) More...
 
virtual void Qrack::QAlu::DECBCDC (bitCapInt toSub, bitLenInt start, bitLenInt length, bitLenInt carryIndex)
 Subtract BCD integer (without sign, with carry) More...
 
virtual void Qrack::QEngineCPU::ROL (bitLenInt shift, bitLenInt start, bitLenInt length)
 "Circular shift left" - shift bits left, and carry last bits. More...
 
virtual void Qrack::QEngineCPU::INC (bitCapInt toAdd, bitLenInt start, bitLenInt length)
 Add integer (without sign) More...
 
virtual void Qrack::QEngineCPU::CINC (bitCapInt toAdd, bitLenInt inOutStart, bitLenInt length, const bitLenInt *controls, bitLenInt controlLen)
 Add integer (without sign, with controls) More...
 
virtual void Qrack::QEngineCPU::INCS (bitCapInt toAdd, bitLenInt start, bitLenInt length, bitLenInt overflowIndex)
 Add an integer to the register, with sign and without carry. More...
 
virtual void Qrack::QEngineCPU::INCBCD (bitCapInt toAdd, bitLenInt start, bitLenInt length)
 Add BCD integer (without sign) More...
 
virtual void Qrack::QEngineCPU::MUL (bitCapInt toMul, bitLenInt inOutStart, bitLenInt carryStart, bitLenInt length)
 Multiply by integer. More...
 
virtual void Qrack::QEngineCPU::DIV (bitCapInt toDiv, bitLenInt inOutStart, bitLenInt carryStart, bitLenInt length)
 Divide by integer. More...
 
virtual void Qrack::QEngineCPU::MULModNOut (bitCapInt toMul, bitCapInt modN, bitLenInt inStart, bitLenInt outStart, bitLenInt length)
 Multiplication modulo N by integer, (out of place) More...
 
virtual void Qrack::QEngineCPU::IMULModNOut (bitCapInt toMul, bitCapInt modN, bitLenInt inStart, bitLenInt outStart, bitLenInt length)
 Inverse of multiplication modulo N by integer, (out of place) More...
 
virtual void Qrack::QEngineCPU::POWModNOut (bitCapInt base, 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::QEngineCPU::CMUL (bitCapInt toMul, bitLenInt inOutStart, bitLenInt carryStart, bitLenInt length, const bitLenInt *controls, bitLenInt controlLen)
 Controlled multiplication by integer. More...
 
virtual void Qrack::QEngineCPU::CDIV (bitCapInt toDiv, bitLenInt inOutStart, bitLenInt carryStart, bitLenInt length, const bitLenInt *controls, bitLenInt controlLen)
 Controlled division by power of integer. More...
 
virtual void Qrack::QEngineCPU::CMULModNOut (bitCapInt toMul, bitCapInt modN, bitLenInt inStart, bitLenInt outStart, bitLenInt length, const bitLenInt *controls, bitLenInt controlLen)
 Controlled multiplication modulo N by integer, (out of place) More...
 
virtual void Qrack::QEngineCPU::CIMULModNOut (bitCapInt toMul, bitCapInt modN, bitLenInt inStart, bitLenInt outStart, bitLenInt length, const bitLenInt *controls, bitLenInt controlLen)
 Inverse of controlled multiplication modulo N by integer, (out of place) More...
 
virtual void Qrack::QEngineCPU::CPOWModNOut (bitCapInt base, bitCapInt modN, bitLenInt inStart, bitLenInt outStart, bitLenInt length, const bitLenInt *controls, bitLenInt controlLen)
 Controlled, raise a classical base to a quantum power, modulo N, (out of place) More...
 
virtual void Qrack::QEngineCPU::FullAdd (bitLenInt inputBit1, bitLenInt inputBit2, bitLenInt carryInSumOut, bitLenInt carryOut)
 Quantum analog of classical "Full Adder" gate. More...
 
virtual void Qrack::QEngineCPU::IFullAdd (bitLenInt inputBit1, bitLenInt inputBit2, bitLenInt carryInSumOut, bitLenInt carryOut)
 Inverse of FullAdd. More...
 
virtual 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...
 
virtual 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...
 
virtual 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...
 
virtual 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...
 
virtual void Qrack::QEngineCPU::CPhaseFlipIfLess (bitCapInt greaterPerm, bitLenInt start, bitLenInt length, bitLenInt flagIndex)
 The 6502 uses its carry flag also as a greater-than/less-than flag, for the CMP operation. More...
 
virtual void Qrack::QEngineCPU::PhaseFlipIfLess (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::INCDECC (bitCapInt toAdd, bitLenInt start, bitLenInt length, bitLenInt carryIndex)
 Common driver method behind INCC and DECC. More...
 
virtual void Qrack::QInterface::INCC (bitCapInt toAdd, bitLenInt start, bitLenInt length, bitLenInt carryIndex)
 Add integer (without sign, with carry) More...
 
virtual void Qrack::QInterface::DECC (bitCapInt toSub, bitLenInt start, bitLenInt length, bitLenInt carryIndex)
 Subtract classical integer (without sign, with carry) More...
 
virtual void Qrack::QInterface::INC (bitCapInt toAdd, bitLenInt start, bitLenInt length)
 Add integer (without sign) More...
 
virtual void Qrack::QInterface::CINC (bitCapInt toAdd, bitLenInt inOutStart, bitLenInt length, const bitLenInt *controls, bitLenInt controlLen)
 Add integer (without sign, with controls) More...
 
virtual void Qrack::QInterface::INCS (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::DEC (bitCapInt toSub, bitLenInt start, bitLenInt length)
 Subtract classical integer (without sign) More...
 
virtual void Qrack::QInterface::CDEC (bitCapInt toSub, bitLenInt inOutStart, bitLenInt length, const bitLenInt *controls, bitLenInt controlLen)
 Subtract classical integer (without sign, with controls) More...
 
virtual void Qrack::QInterface::DECS (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::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 bitLenInt *controls, bitLenInt controlLen, bitLenInt inputBit1, bitLenInt inputBit2, bitLenInt carryInSumOut, bitLenInt carryOut)
 Controlled quantum analog of classical "Full Adder" gate. More...
 
virtual void Qrack::QInterface::CIFullAdd (const bitLenInt *controls, bitLenInt controlLen, 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 bitLenInt *controls, bitLenInt controlLen, 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 bitLenInt *controls, bitLenInt controlLen, bitLenInt input1, bitLenInt input2, bitLenInt output, bitLenInt length, bitLenInt carry)
 Inverse of CADC. More...
 
virtual void Qrack::QUnit::DEC (bitCapInt toSub, bitLenInt start, bitLenInt length)
 Add integer (without sign) More...
 
virtual void Qrack::QUnit::DECS (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 (bitCapInt toSub, bitLenInt inOutStart, bitLenInt length, const bitLenInt *controls, bitLenInt controlLen)
 Subtract integer (without sign, with controls) More...
 
virtual void Qrack::QUnit::INCDECC (bitCapInt toAdd, bitLenInt start, bitLenInt length, bitLenInt carryIndex)
 Common driver method behind INCC and DECC (without sign, with carry) More...
 
virtual void Qrack::QUnit::INC (bitCapInt toAdd, bitLenInt start, bitLenInt length)
 Add integer (without sign) More...
 
virtual void Qrack::QUnit::CINC (bitCapInt toAdd, bitLenInt inOutStart, bitLenInt length, const bitLenInt *controls, bitLenInt controlLen)
 Add integer (without sign, with controls) More...
 
virtual void Qrack::QUnit::INCC (bitCapInt toAdd, bitLenInt start, bitLenInt length, bitLenInt carryIndex)
 Add integer (without sign, with carry) More...
 
virtual void Qrack::QUnit::INCS (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 (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 (bitCapInt toAdd, bitLenInt start, bitLenInt length, bitLenInt carryIndex)
 Common driver method behind INCSC and DECSC (without overflow flag) More...
 
virtual void Qrack::QUnit::DECC (bitCapInt toSub, bitLenInt start, bitLenInt length, bitLenInt carryIndex)
 Subtract integer (without sign, with carry) More...
 
virtual void Qrack::QUnit::INCBCD (bitCapInt toAdd, bitLenInt start, bitLenInt length)
 Add classical BCD integer (without sign) More...
 
virtual void Qrack::QUnit::DECBCD (bitCapInt toAdd, bitLenInt start, bitLenInt length)
 Subtract classical BCD integer (without sign) More...
 
virtual void Qrack::QUnit::INCDECBCDC (bitCapInt toSub, bitLenInt start, bitLenInt length, bitLenInt carryIndex)
 Common driver method behind INCSC and DECSC (without overflow flag) More...
 
virtual void Qrack::QUnit::MUL (bitCapInt toMul, bitLenInt inOutStart, bitLenInt carryStart, bitLenInt length)
 Multiply by integer. More...
 
virtual void Qrack::QUnit::DIV (bitCapInt toDiv, bitLenInt inOutStart, bitLenInt carryStart, bitLenInt length)
 Divide by integer. More...
 
virtual void Qrack::QUnit::MULModNOut (bitCapInt toMul, bitCapInt modN, bitLenInt inStart, bitLenInt outStart, bitLenInt length)
 Multiplication modulo N by integer, (out of place) More...
 
virtual void Qrack::QUnit::IMULModNOut (bitCapInt toMul, bitCapInt modN, bitLenInt inStart, bitLenInt outStart, bitLenInt length)
 Inverse of multiplication modulo N by integer, (out of place) More...
 
virtual void Qrack::QUnit::POWModNOut (bitCapInt base, 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 (bitCapInt toMul, bitLenInt inOutStart, bitLenInt carryStart, bitLenInt length, const bitLenInt *controls, bitLenInt controlLen)
 Controlled multiplication by integer. More...
 
virtual void Qrack::QUnit::CDIV (bitCapInt toDiv, bitLenInt inOutStart, bitLenInt carryStart, bitLenInt length, const bitLenInt *controls, bitLenInt controlLen)
 Controlled division by power of integer. More...
 
virtual void Qrack::QUnit::CMULModNOut (bitCapInt toMul, bitCapInt modN, bitLenInt inStart, bitLenInt outStart, bitLenInt length, const bitLenInt *controls, bitLenInt controlLen)
 Controlled multiplication modulo N by integer, (out of place) More...
 
virtual void Qrack::QUnit::CIMULModNOut (bitCapInt toMul, bitCapInt modN, bitLenInt inStart, bitLenInt outStart, bitLenInt length, const bitLenInt *controls, bitLenInt controlLen)
 Inverse of controlled multiplication modulo N by integer, (out of place) More...
 
virtual void Qrack::QUnit::CPOWModNOut (bitCapInt base, bitCapInt modN, bitLenInt inStart, bitLenInt outStart, bitLenInt length, const bitLenInt *controls, bitLenInt controlLen)
 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 (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 (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 bitLenInt controls,
bitLenInt  controlLen,
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]

void Qrack::QAlu::CDEC ( bitCapInt  toSub,
bitLenInt  start,
bitLenInt  length,
const bitLenInt controls,
bitLenInt  controlLen 
)
virtual

Subtract integer (without sign, with controls)

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

◆ CDEC() [2/3]

virtual void Qrack::QUnit::CDEC ( bitCapInt  toSub,
bitLenInt  start,
bitLenInt  length,
const bitLenInt controls,
bitLenInt  controlLen 
)
inlinevirtual

Subtract integer (without sign, with controls)

Reimplemented from Qrack::QAlu.

◆ CDEC() [3/3]

void Qrack::QInterface::CDEC ( bitCapInt  toSub,
bitLenInt  inOutStart,
bitLenInt  length,
const bitLenInt controls,
bitLenInt  controlLen 
)
virtual

Subtract classical integer (without sign, with controls)

Subtract integer (without sign, with controls)

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

◆ CDIV() [1/3]

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

◆ CDIV() [2/3]

void Qrack::QUnit::CDIV ( bitCapInt  toDiv,
bitLenInt  start,
bitLenInt  carryStart,
bitLenInt  length,
const bitLenInt controls,
bitLenInt  controlLen 
)
virtual

Controlled division by power of integer.

Implements Qrack::QAlu.

◆ CDIV() [3/3]

void Qrack::QEngineCPU::CDIV ( bitCapInt  toDiv,
bitLenInt  start,
bitLenInt  carryStart,
bitLenInt  length,
const bitLenInt controls,
bitLenInt  controlLen 
)
virtual

Controlled division by power of integer.

Implements Qrack::QAlu.

◆ CFullAdd()

void Qrack::QInterface::CFullAdd ( const bitLenInt controls,
bitLenInt  controlLen,
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 bitLenInt controls,
bitLenInt  controlLen,
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 bitLenInt controls,
bitLenInt  controlLen,
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/3]

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

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

Implemented in Qrack::QStabilizerHybrid, Qrack::QMaskFusion, Qrack::QEngineOCL, Qrack::QBdt, Qrack::QHybrid, Qrack::QEngineCPU, Qrack::QPager, and Qrack::QUnit.

◆ CIMULModNOut() [2/3]

void Qrack::QUnit::CIMULModNOut ( bitCapInt  toMul,
bitCapInt  modN,
bitLenInt  inStart,
bitLenInt  outStart,
bitLenInt  length,
const bitLenInt controls,
bitLenInt  controlLen 
)
virtual

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

Implements Qrack::QAlu.

◆ CIMULModNOut() [3/3]

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

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

Implements Qrack::QAlu.

◆ CINC() [1/4]

virtual void Qrack::QAlu::CINC ( bitCapInt  toAdd,
bitLenInt  start,
bitLenInt  length,
const bitLenInt controls,
bitLenInt  controlLen 
)
pure virtual

◆ CINC() [2/4]

void Qrack::QUnit::CINC ( bitCapInt  toAdd,
bitLenInt  start,
bitLenInt  length,
const bitLenInt controls,
bitLenInt  controlLen 
)
virtual

Add integer (without sign, with controls)

Implements Qrack::QAlu.

◆ CINC() [3/4]

void Qrack::QEngineCPU::CINC ( bitCapInt  toAdd,
bitLenInt  inOutStart,
bitLenInt  length,
const bitLenInt controls,
bitLenInt  controlLen 
)
virtual

Add integer (without sign, with controls)

Reimplemented from Qrack::QEngine.

◆ CINC() [4/4]

void Qrack::QInterface::CINC ( bitCapInt  toAdd,
bitLenInt  inOutStart,
bitLenInt  length,
const bitLenInt controls,
bitLenInt  controlLen 
)
virtual

◆ CMUL() [1/3]

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

◆ CMUL() [2/3]

void Qrack::QUnit::CMUL ( bitCapInt  toMul,
bitLenInt  start,
bitLenInt  carryStart,
bitLenInt  length,
const bitLenInt controls,
bitLenInt  controlLen 
)
virtual

Controlled multiplication by integer.

Implements Qrack::QAlu.

◆ CMUL() [3/3]

void Qrack::QEngineCPU::CMUL ( bitCapInt  toMul,
bitLenInt  start,
bitLenInt  carryStart,
bitLenInt  length,
const bitLenInt controls,
bitLenInt  controlLen 
)
virtual

Controlled multiplication by integer.

Implements Qrack::QAlu.

◆ CMULModNOut() [1/3]

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

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

Implemented in Qrack::QStabilizerHybrid, Qrack::QMaskFusion, Qrack::QEngineOCL, Qrack::QBdt, Qrack::QHybrid, Qrack::QEngineCPU, Qrack::QPager, and Qrack::QUnit.

◆ CMULModNOut() [2/3]

void Qrack::QUnit::CMULModNOut ( bitCapInt  toMul,
bitCapInt  modN,
bitLenInt  inStart,
bitLenInt  outStart,
bitLenInt  length,
const bitLenInt controls,
bitLenInt  controlLen 
)
virtual

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

Implements Qrack::QAlu.

◆ CMULModNOut() [3/3]

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

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

Implements Qrack::QAlu.

◆ CPhaseFlipIfLess() [1/3]

virtual void Qrack::QAlu::CPhaseFlipIfLess ( 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::QStabilizerHybrid, Qrack::QMaskFusion, Qrack::QEngineOCL, Qrack::QHybrid, Qrack::QBdt, Qrack::QEngineCPU, Qrack::QPager, and Qrack::QUnit.

◆ CPhaseFlipIfLess() [2/3]

void Qrack::QUnit::CPhaseFlipIfLess ( 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]

void Qrack::QEngineCPU::CPhaseFlipIfLess ( 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.

◆ CPOWModNOut() [1/3]

virtual void Qrack::QAlu::CPOWModNOut ( bitCapInt  base,
bitCapInt  modN,
bitLenInt  inStart,
bitLenInt  outStart,
bitLenInt  length,
const bitLenInt controls,
bitLenInt  controlLen 
)
pure virtual

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

Implemented in Qrack::QStabilizerHybrid, Qrack::QMaskFusion, Qrack::QBdt, Qrack::QEngineOCL, Qrack::QHybrid, Qrack::QEngineCPU, Qrack::QPager, and Qrack::QUnit.

◆ CPOWModNOut() [2/3]

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

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

Implements Qrack::QAlu.

◆ CPOWModNOut() [3/3]

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

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

Implements Qrack::QAlu.

◆ DEC() [1/3]

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

Add integer (without sign)

Subtract integer (without sign)

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

◆ DEC() [2/3]

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

Add integer (without sign)

Subtract integer (without sign)

Implements Qrack::QAlu.

◆ DEC() [3/3]

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

Subtract classical integer (without sign)

Subtract integer (without sign)

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

◆ DECBCD() [1/2]

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

Subtract classical BCD integer (without sign)

Subtract BCD integer (without sign)

Reimplemented in Qrack::QUnit.

◆ DECBCD() [2/2]

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

Subtract classical BCD integer (without sign)

Subtract BCD integer (without sign)

Reimplemented from Qrack::QAlu.

◆ DECBCDC()

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

Subtract BCD integer (without sign, with carry)

Reimplemented in Qrack::QHybrid.

◆ DECC() [1/3]

void Qrack::QAlu::DECC ( 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::QStabilizerHybrid, Qrack::QHybrid, Qrack::QBdt, Qrack::QPager, Qrack::QUnit, and Qrack::QEngine.

◆ DECC() [2/3]

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

Subtract integer (without sign, with carry)

Reimplemented from Qrack::QAlu.

◆ DECC() [3/3]

void Qrack::QInterface::DECC ( 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::QStabilizerHybrid, Qrack::QHybrid, Qrack::QBdt, Qrack::QPager, Qrack::QUnit, and Qrack::QEngine.

◆ DECS() [1/3]

void Qrack::QAlu::DECS ( 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::QStabilizerHybrid, Qrack::QBdt, Qrack::QPager, Qrack::QUnit, and Qrack::QEngine.

◆ DECS() [2/3]

virtual void Qrack::QUnit::DECS ( 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.

◆ DECS() [3/3]

void Qrack::QInterface::DECS ( bitCapInt  toSub,
bitLenInt  start,
bitLenInt  length,
bitLenInt  overflowIndex 
)
virtual

Subtract a classical integer from 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.

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

◆ DECSC() [1/2]

void Qrack::QAlu::DECSC ( 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.

◆ DECSC() [2/2]

void Qrack::QAlu::DECSC ( 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.

◆ DIV() [1/3]

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

◆ DIV() [2/3]

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

Divide by integer.

Implements Qrack::QAlu.

◆ DIV() [3/3]

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

Divide by integer.

Implements Qrack::QAlu.

◆ 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]

void Qrack::QInterface::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 in Qrack::QEngineOCL, and Qrack::QEngineCPU.

◆ Hash() [1/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() [2/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::QStabilizerHybrid, Qrack::QMaskFusion, Qrack::QBdt, Qrack::QEngineOCL, Qrack::QHybrid, Qrack::QEngineCPU, Qrack::QPager, and Qrack::QUnit.

◆ Hash() [3/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.

◆ 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]

void Qrack::QInterface::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 in Qrack::QEngineOCL, and Qrack::QEngineCPU.

◆ IMULModNOut() [1/3]

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

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

Implemented in Qrack::QStabilizerHybrid, Qrack::QMaskFusion, Qrack::QEngineOCL, Qrack::QBdt, Qrack::QHybrid, Qrack::QEngineCPU, Qrack::QPager, and Qrack::QUnit.

◆ IMULModNOut() [2/3]

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

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

Implements Qrack::QAlu.

◆ IMULModNOut() [3/3]

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

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

Implements Qrack::QAlu.

◆ INC() [1/4]

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

◆ INC() [2/4]

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

Add integer (without sign)

Implements Qrack::QAlu.

◆ INC() [3/4]

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

Add integer (without sign)

Reimplemented from Qrack::QEngine.

◆ INC() [4/4]

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

◆ INCBCD() [1/3]

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

◆ INCBCD() [2/3]

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

Add classical BCD integer (without sign)

Implements Qrack::QAlu.

◆ INCBCD() [3/3]

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

Add BCD integer (without sign)

Implements Qrack::QAlu.

◆ INCBCDC()

void Qrack::QAlu::INCBCDC ( 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.

◆ INCC() [1/3]

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

Add integer (without sign, with carry)

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

◆ INCC() [2/3]

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

Add integer (without sign, with carry)

Reimplemented from Qrack::QAlu.

◆ INCC() [3/3]

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

Add integer (without sign, with carry)

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

◆ INCDECBCDC() [1/2]

virtual void Qrack::QAlu::INCDECBCDC ( bitCapInt  toMod,
bitLenInt  start,
bitLenInt  length,
bitLenInt  carryIndex 
)
pure virtual

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

Implemented in Qrack::QMaskFusion, Qrack::QStabilizerHybrid, Qrack::QEngineOCL, Qrack::QHybrid, Qrack::QEngineCPU, Qrack::QBdt, Qrack::QPager, and Qrack::QUnit.

◆ INCDECBCDC() [2/2]

void Qrack::QUnit::INCDECBCDC ( 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]

virtual void Qrack::QAlu::INCDECC ( bitCapInt  toMod,
bitLenInt  start,
bitLenInt  length,
bitLenInt  carryIndex 
)
pure virtual

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

Implemented in Qrack::QMaskFusion, Qrack::QStabilizerHybrid, Qrack::QEngineOCL, Qrack::QHybrid, Qrack::QEngineCPU, Qrack::QBdt, Qrack::QPager, Qrack::QUnit, and Qrack::QEngine.

◆ INCDECC() [2/3]

virtual void Qrack::QUnit::INCDECC ( 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]

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

◆ INCDECSC() [1/4]

virtual void Qrack::QAlu::INCDECSC ( bitCapInt  toMod,
bitLenInt  start,
bitLenInt  length,
bitLenInt  carryIndex 
)
pure virtual

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

Implemented in Qrack::QMaskFusion, Qrack::QStabilizerHybrid, Qrack::QEngineOCL, Qrack::QHybrid, Qrack::QEngineCPU, Qrack::QBdt, Qrack::QPager, and Qrack::QUnit.

◆ INCDECSC() [2/4]

virtual void Qrack::QAlu::INCDECSC ( 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::QMaskFusion, Qrack::QStabilizerHybrid, Qrack::QEngineOCL, Qrack::QHybrid, Qrack::QEngineCPU, Qrack::QBdt, Qrack::QPager, and Qrack::QUnit.

◆ INCDECSC() [3/4]

void Qrack::QUnit::INCDECSC ( 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() [4/4]

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

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

Implements Qrack::QAlu.

◆ INCS() [1/4]

virtual void Qrack::QAlu::INCS ( 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::QStabilizerHybrid, Qrack::QMaskFusion, Qrack::QEngineOCL, Qrack::QBdt, Qrack::QHybrid, Qrack::QEngineCPU, Qrack::QPager, Qrack::QUnit, and Qrack::QEngine.

◆ INCS() [2/4]

void Qrack::QUnit::INCS ( 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() [3/4]

void Qrack::QEngineCPU::INCS ( 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() [4/4]

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

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

Reimplemented in Qrack::QStabilizerHybrid, Qrack::QMaskFusion, Qrack::QEngineOCL, Qrack::QBdt, Qrack::QHybrid, Qrack::QEngineCPU, Qrack::QPager, Qrack::QUnit, and Qrack::QEngine.

◆ INCSC() [1/2]

void Qrack::QAlu::INCSC ( 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.

◆ INCSC() [2/2]

void Qrack::QAlu::INCSC ( 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.

◆ IndexedADC() [1/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::QStabilizerHybrid, Qrack::QMaskFusion, Qrack::QBdt, Qrack::QEngineOCL, Qrack::QHybrid, Qrack::QEngineCPU, Qrack::QPager, and Qrack::QUnit.

◆ 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]

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.

◆ IndexedLDA() [1/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::QStabilizerHybrid, Qrack::QMaskFusion, Qrack::QBdt, Qrack::QEngineOCL, Qrack::QHybrid, Qrack::QEngineCPU, Qrack::QPager, and Qrack::QUnit.

◆ 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]

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.

◆ IndexedSBC() [1/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() [2/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::QStabilizerHybrid, Qrack::QMaskFusion, Qrack::QBdt, Qrack::QEngineOCL, Qrack::QHybrid, Qrack::QEngineCPU, Qrack::QPager, and Qrack::QUnit.

◆ IndexedSBC() [3/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.

◆ 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]

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

◆ MUL() [2/3]

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

Multiply by integer.

Implements Qrack::QAlu.

◆ MUL() [3/3]

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

Multiply by integer.

Implements Qrack::QAlu.

◆ MULModNOut() [1/3]

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

Multiplication modulo N by integer, (out of place)

Implemented in Qrack::QStabilizerHybrid, Qrack::QMaskFusion, Qrack::QEngineOCL, Qrack::QBdt, Qrack::QHybrid, Qrack::QEngineCPU, Qrack::QPager, and Qrack::QUnit.

◆ MULModNOut() [2/3]

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

Multiplication modulo N by integer, (out of place)

Implements Qrack::QAlu.

◆ MULModNOut() [3/3]

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

Multiplication modulo N by integer, (out of place)

Implements Qrack::QAlu.

◆ PhaseFlipIfLess() [1/3]

virtual void Qrack::QAlu::PhaseFlipIfLess ( 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::QStabilizerHybrid, Qrack::QMaskFusion, Qrack::QEngineOCL, Qrack::QHybrid, Qrack::QBdt, Qrack::QEngineCPU, Qrack::QPager, and Qrack::QUnit.

◆ PhaseFlipIfLess() [2/3]

void Qrack::QUnit::PhaseFlipIfLess ( 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]

void Qrack::QEngineCPU::PhaseFlipIfLess ( 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.

◆ POWModNOut() [1/3]

virtual void Qrack::QAlu::POWModNOut ( bitCapInt  base,
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::QStabilizerHybrid, Qrack::QMaskFusion, Qrack::QEngineOCL, Qrack::QBdt, Qrack::QHybrid, Qrack::QEngineCPU, Qrack::QPager, and Qrack::QUnit.

◆ POWModNOut() [2/3]

void Qrack::QUnit::POWModNOut ( bitCapInt  base,
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]

void Qrack::QEngineCPU::POWModNOut ( bitCapInt  base,
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.

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