Qrack  1.7
General classical-emulating-quantum development framework
Functions
Arithmetic and other opcode-like gate implemenations.

Functions

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::ROR (bitLenInt shift, bitLenInt start, bitLenInt length)
 "Circular shift right" - shift bits right, and carry first bits. More...
 
virtual void Qrack::QEngineCPU::INC (bitCapInt toAdd, bitLenInt start, bitLenInt length)
 Add integer (without sign) More...
 
virtual void Qrack::QEngineCPU::INCC (bitCapInt toAdd, bitLenInt start, bitLenInt length, bitLenInt carryIndex)
 Add integer (without sign, with carry) 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::INCSC (bitCapInt toAdd, bitLenInt start, bitLenInt length, bitLenInt overflowIndex, bitLenInt carryIndex)
 Add an integer to the register, with sign and with carry. More...
 
virtual void Qrack::QEngineCPU::INCSC (bitCapInt toAdd, bitLenInt start, bitLenInt length, bitLenInt carryIndex)
 Add an integer to the register, with sign and with carry. More...
 
virtual void Qrack::QEngineCPU::INCBCD (bitCapInt toAdd, bitLenInt start, bitLenInt length)
 Add BCD integer (without sign) More...
 
virtual void Qrack::QEngineCPU::INCBCDC (bitCapInt toAdd, bitLenInt start, bitLenInt length, bitLenInt carryIndex)
 Add BCD integer (without sign, with carry) More...
 
virtual void Qrack::QEngineCPU::DEC (bitCapInt toSub, bitLenInt start, bitLenInt length)
 Subtract integer (without sign) More...
 
virtual void Qrack::QEngineCPU::DECC (bitCapInt toSub, bitLenInt start, bitLenInt length, bitLenInt carryIndex)
 Subtract integer (without sign, with carry) More...
 
virtual void Qrack::QEngineCPU::DECS (bitCapInt toAdd, bitLenInt start, bitLenInt length, bitLenInt overflowIndex)
 Subtract an integer from the register, with sign and without carry. More...
 
virtual void Qrack::QEngineCPU::DECSC (bitCapInt toAdd, bitLenInt start, bitLenInt length, bitLenInt overflowIndex, bitLenInt carryIndex)
 Subtract an integer from the register, with sign and with carry. More...
 
virtual void Qrack::QEngineCPU::DECSC (bitCapInt toAdd, bitLenInt start, bitLenInt length, bitLenInt carryIndex)
 Subtract an integer from the register, with sign and with carry. More...
 
virtual void Qrack::QEngineCPU::DECBCD (bitCapInt toAdd, bitLenInt start, bitLenInt length)
 Subtract BCD integer (without sign) More...
 
virtual void Qrack::QEngineCPU::DECBCDC (bitCapInt toSub, bitLenInt start, bitLenInt length, bitLenInt carryIndex)
 Subtract BCD integer (without sign, with carry) More...
 
virtual void Qrack::QEngineCPU::MUL (bitCapInt toMul, bitLenInt inOutStart, bitLenInt carryStart, bitLenInt length, bool clearCarry=false)
 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::CMUL (bitCapInt toMul, bitLenInt inOutStart, bitLenInt carryStart, bitLenInt controlBit, bitLenInt length, bool clearCarry=false)
 Controlled multiplication by integer. More...
 
virtual void Qrack::QEngineCPU::CDIV (bitCapInt toDiv, bitLenInt inOutStart, bitLenInt carryStart, bitLenInt controlBit, bitLenInt length)
 Controlled division by power of integer. 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::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::INC (bitCapInt toAdd, bitLenInt start, bitLenInt length)=0
 Add integer (without sign) More...
 
virtual void Qrack::QInterface::INCC (bitCapInt toAdd, bitLenInt start, bitLenInt length, bitLenInt carryIndex)=0
 Add integer (without sign, with carry) More...
 
virtual void Qrack::QInterface::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::QInterface::INCSC (bitCapInt toAdd, bitLenInt start, bitLenInt length, bitLenInt overflowIndex, bitLenInt carryIndex)=0
 Add a classical integer to the register, with sign and with carry. More...
 
virtual void Qrack::QInterface::INCSC (bitCapInt toAdd, bitLenInt start, bitLenInt length, bitLenInt carryIndex)=0
 Add a classical integer to the register, with sign and with (phase-based) carry. More...
 
virtual void Qrack::QInterface::INCBCD (bitCapInt toAdd, bitLenInt start, bitLenInt length)=0
 Add classical BCD integer (without sign) More...
 
virtual void Qrack::QInterface::INCBCDC (bitCapInt toAdd, bitLenInt start, bitLenInt length, bitLenInt carryIndex)=0
 Add classical BCD integer (without sign, with carry) More...
 
virtual void Qrack::QInterface::DEC (bitCapInt toSub, bitLenInt start, bitLenInt length)=0
 Subtract classical integer (without sign) More...
 
virtual void Qrack::QInterface::DECC (bitCapInt toSub, bitLenInt start, bitLenInt length, bitLenInt carryIndex)=0
 Subtract classical integer (without sign, with carry) More...
 
virtual void Qrack::QInterface::DECS (bitCapInt toAdd, bitLenInt start, bitLenInt length, bitLenInt overflowIndex)=0
 Subtract a classical integer from the register, with sign and without carry. More...
 
virtual void Qrack::QInterface::DECSC (bitCapInt toAdd, bitLenInt start, bitLenInt length, bitLenInt overflowIndex, bitLenInt carryIndex)=0
 Subtract a classical integer from the register, with sign and with carry. More...
 
virtual void Qrack::QInterface::DECSC (bitCapInt toAdd, bitLenInt start, bitLenInt length, bitLenInt carryIndex)=0
 Subtract a classical integer from the register, with sign and with carry. More...
 
virtual void Qrack::QInterface::DECBCD (bitCapInt toAdd, bitLenInt start, bitLenInt length)=0
 Subtract BCD integer (without sign) More...
 
virtual void Qrack::QInterface::DECBCDC (bitCapInt toSub, bitLenInt start, bitLenInt length, bitLenInt carryIndex)=0
 Subtract BCD integer (without sign, with carry) More...
 
virtual void Qrack::QInterface::MUL (bitCapInt toMul, bitLenInt inOutStart, bitLenInt carryStart, bitLenInt length, bool clearCary=false)=0
 Multiply by integer. More...
 
virtual void Qrack::QInterface::DIV (bitCapInt toDiv, bitLenInt inOutStart, bitLenInt carryStart, bitLenInt length)=0
 Divide by integer. More...
 
virtual void Qrack::QInterface::CMUL (bitCapInt toMul, bitLenInt inOutStart, bitLenInt carryStart, bitLenInt controlBit, bitLenInt length, bool clearCarry=false)=0
 Controlled multiplication by integer. More...
 
virtual void Qrack::QInterface::CDIV (bitCapInt toDiv, bitLenInt inOutStart, bitLenInt carryStart, bitLenInt controlBit, bitLenInt length)=0
 Controlled division by power of integer. More...
 
virtual void Qrack::QUnit::INC (bitCapInt toAdd, bitLenInt start, bitLenInt length)
 Add integer (without sign) 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::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::QUnit::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::QUnit::INCBCD (bitCapInt toAdd, bitLenInt start, bitLenInt length)
 Add classical BCD integer (without sign) More...
 
virtual void Qrack::QUnit::INCBCDC (bitCapInt toAdd, bitLenInt start, bitLenInt length, bitLenInt carryIndex)
 Add classical BCD integer (without sign, with carry) More...
 
virtual void Qrack::QUnit::DEC (bitCapInt toSub, bitLenInt start, bitLenInt length)
 Subtract classical integer (without sign) More...
 
virtual void Qrack::QUnit::DECC (bitCapInt toSub, bitLenInt start, bitLenInt length, bitLenInt carryIndex)
 Subtract classical integer (without sign, with carry) More...
 
virtual void Qrack::QUnit::DECS (bitCapInt toAdd, bitLenInt start, bitLenInt length, bitLenInt overflowIndex)
 Subtract a classical integer from the register, with sign and without carry. More...
 
virtual void Qrack::QUnit::DECSC (bitCapInt toAdd, bitLenInt start, bitLenInt length, bitLenInt overflowIndex, bitLenInt carryIndex)
 Subtract a classical integer from the register, with sign and with carry. More...
 
virtual void Qrack::QUnit::DECSC (bitCapInt toAdd, bitLenInt start, bitLenInt length, bitLenInt carryIndex)
 Subtract a classical integer from the register, with sign and with carry. More...
 
virtual void Qrack::QUnit::DECBCD (bitCapInt toAdd, bitLenInt start, bitLenInt length)
 Subtract BCD integer (without sign) More...
 
virtual void Qrack::QUnit::DECBCDC (bitCapInt toSub, bitLenInt start, bitLenInt length, bitLenInt carryIndex)
 Subtract BCD integer (without sign, with carry) More...
 
virtual void Qrack::QUnit::MUL (bitCapInt toMul, bitLenInt inOutStart, bitLenInt carryStart, bitLenInt length, bool clearCarry=false)
 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::CMUL (bitCapInt toMul, bitLenInt inOutStart, bitLenInt carryStart, bitLenInt controlBit, bitLenInt length, bool clearCarry=false)
 Controlled multiplication by integer. More...
 
virtual void Qrack::QUnit::CDIV (bitCapInt toDiv, bitLenInt inOutStart, bitLenInt carryStart, bitLenInt controlBit, bitLenInt length)
 Controlled division by power of integer. More...
 

Detailed Description

Todo:
Many of these have performance that can be improved in QUnit via implementations with more intelligently chosen Cohere/Decompose patterns.

Function Documentation

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

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

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

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

void Qrack::QEngineCPU::CDIV ( bitCapInt  toDiv,
bitLenInt  inOutStart,
bitLenInt  carryStart,
bitLenInt  controlBit,
bitLenInt  length 
)
virtual

Controlled division by power of integer.

Implements Qrack::QInterface.

void Qrack::QUnit::CDIV ( bitCapInt  toDiv,
bitLenInt  inOutStart,
bitLenInt  carryStart,
bitLenInt  controlBit,
bitLenInt  length 
)
virtual

Controlled division by power of integer.

Implements Qrack::QInterface.

virtual void Qrack::QInterface::CDIV ( bitCapInt  toDiv,
bitLenInt  inOutStart,
bitLenInt  carryStart,
bitLenInt  controlBit,
bitLenInt  length 
)
pure virtual

Controlled division by power of integer.

Implemented in Qrack::QUnit, Qrack::QEngineOCLMulti, Qrack::QEngineOCL, and Qrack::QEngineCPU.

void Qrack::QEngineCPU::CMUL ( bitCapInt  toMul,
bitLenInt  inOutStart,
bitLenInt  carryStart,
bitLenInt  controlBit,
bitLenInt  length,
bool  clearCarry = false 
)
virtual

Controlled multiplication by integer.

Implements Qrack::QInterface.

void Qrack::QUnit::CMUL ( bitCapInt  toMul,
bitLenInt  inOutStart,
bitLenInt  carryStart,
bitLenInt  controlBit,
bitLenInt  length,
bool  clearCarry = false 
)
virtual

Controlled multiplication by integer.

Implements Qrack::QInterface.

virtual void Qrack::QInterface::CMUL ( bitCapInt  toMul,
bitLenInt  inOutStart,
bitLenInt  carryStart,
bitLenInt  controlBit,
bitLenInt  length,
bool  clearCarry = false 
)
pure virtual

Controlled multiplication by integer.

Implemented in Qrack::QUnit, Qrack::QEngineOCLMulti, Qrack::QEngineOCL, and Qrack::QEngineCPU.

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

Subtract integer (without sign)

Implements Qrack::QInterface.

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

Subtract classical integer (without sign)

Implements Qrack::QInterface.

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

Subtract classical integer (without sign)

Implemented in Qrack::QUnit, Qrack::QEngineOCLMulti, Qrack::QEngineOCL, and Qrack::QEngineCPU.

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

Subtract BCD integer (without sign)

Implements Qrack::QInterface.

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

Subtract BCD integer (without sign)

Implements Qrack::QInterface.

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

Subtract BCD integer (without sign)

Implemented in Qrack::QUnit, Qrack::QEngineOCLMulti, Qrack::QEngineOCL, and Qrack::QEngineCPU.

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

Subtract BCD integer (without sign, with carry)

Implements Qrack::QInterface.

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

Subtract BCD integer (without sign, with carry)

Implements Qrack::QInterface.

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

Subtract BCD integer (without sign, with carry)

Implemented in Qrack::QUnit, Qrack::QEngineOCLMulti, Qrack::QEngineOCL, and Qrack::QEngineCPU.

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

Subtract integer (without sign, with carry)

Implements Qrack::QInterface.

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

Subtract classical integer (without sign, with carry)

Implements Qrack::QInterface.

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

Subtract classical integer (without sign, with carry)

Implemented in Qrack::QUnit, Qrack::QEngineOCLMulti, Qrack::QEngineOCL, and Qrack::QEngineCPU.

void Qrack::QEngineCPU::DECS ( bitCapInt  toSub,
bitLenInt  inOutStart,
bitLenInt  length,
bitLenInt  overflowIndex 
)
virtual

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

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

Subtract a classical integer from the register, with sign and without carry.

Implements Qrack::QInterface.

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

Subtract a classical integer from the register, with sign and without carry.

Implemented in Qrack::QUnit, Qrack::QEngineOCLMulti, Qrack::QEngineOCL, and Qrack::QEngineCPU.

void Qrack::QEngineCPU::DECSC ( bitCapInt  toSub,
bitLenInt  inOutStart,
bitLenInt  length,
bitLenInt  overflowIndex,
bitLenInt  carryIndex 
)
virtual

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.

Implements Qrack::QInterface.

void Qrack::QEngineCPU::DECSC ( bitCapInt  toSub,
bitLenInt  inOutStart,
bitLenInt  length,
bitLenInt  carryIndex 
)
virtual

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

Implements Qrack::QInterface.

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

Subtract a classical integer from the register, with sign and with carry.

Implements Qrack::QInterface.

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

Subtract a classical integer from the register, with sign and with carry.

Implements Qrack::QInterface.

virtual void Qrack::QInterface::DECSC ( bitCapInt  toAdd,
bitLenInt  start,
bitLenInt  length,
bitLenInt  overflowIndex,
bitLenInt  carryIndex 
)
pure virtual

Subtract a classical integer from the register, with sign and with carry.

Implemented in Qrack::QUnit, Qrack::QEngineOCLMulti, Qrack::QEngineOCL, and Qrack::QEngineCPU.

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

Subtract a classical integer from the register, with sign and with carry.

Implemented in Qrack::QUnit, Qrack::QEngineOCLMulti, Qrack::QEngineOCL, and Qrack::QEngineCPU.

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

Divide by integer.

Implements Qrack::QInterface.

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

Divide by integer.

Implements Qrack::QInterface.

virtual void Qrack::QInterface::DIV ( bitCapInt  toDiv,
bitLenInt  inOutStart,
bitLenInt  carryStart,
bitLenInt  length 
)
pure virtual

Divide by integer.

Implemented in Qrack::QUnit, Qrack::QEngineOCLMulti, Qrack::QEngineOCL, and Qrack::QEngineCPU.

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

Add integer (without sign)

Implements Qrack::QInterface.

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

Add integer (without sign)

Implements Qrack::QInterface.

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

Add integer (without sign)

Implemented in Qrack::QUnit, Qrack::QEngineOCLMulti, Qrack::QEngineOCL, and Qrack::QEngineCPU.

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

Add BCD integer (without sign)

Implements Qrack::QInterface.

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

Add classical BCD integer (without sign)

Implements Qrack::QInterface.

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

Add classical BCD integer (without sign)

Implemented in Qrack::QUnit, Qrack::QEngineOCL, Qrack::QEngineOCLMulti, and Qrack::QEngineCPU.

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

Add BCD integer (without sign, with carry)

Implements Qrack::QInterface.

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

Add classical BCD integer (without sign, with carry)

Implements Qrack::QInterface.

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

Add classical BCD integer (without sign, with carry)

Implemented in Qrack::QUnit, Qrack::QEngineOCL, Qrack::QEngineOCLMulti, and Qrack::QEngineCPU.

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

Add integer (without sign, with carry)

Implements Qrack::QInterface.

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

Add integer (without sign, with carry)

Implements Qrack::QInterface.

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

Add integer (without sign, with carry)

Implemented in Qrack::QUnit, Qrack::QEngineOCLMulti, Qrack::QEngineOCL, and Qrack::QEngineCPU.

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.

Implements Qrack::QInterface.

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

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

void Qrack::QEngineCPU::INCSC ( bitCapInt  toAdd,
bitLenInt  inOutStart,
bitLenInt  length,
bitLenInt  overflowIndex,
bitLenInt  carryIndex 
)
virtual

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.

Implements Qrack::QInterface.

void Qrack::QEngineCPU::INCSC ( bitCapInt  toAdd,
bitLenInt  inOutStart,
bitLenInt  length,
bitLenInt  carryIndex 
)
virtual

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.

Implements Qrack::QInterface.

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

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

Implements Qrack::QInterface.

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

Add a classical integer to the register, with sign and with (phase-based) carry.

Implements Qrack::QInterface.

virtual void Qrack::QInterface::INCSC ( bitCapInt  toAdd,
bitLenInt  start,
bitLenInt  length,
bitLenInt  overflowIndex,
bitLenInt  carryIndex 
)
pure virtual

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

Implemented in Qrack::QUnit, Qrack::QEngineOCLMulti, Qrack::QEngineOCL, and Qrack::QEngineCPU.

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

Add a classical integer to the register, with sign and with (phase-based) carry.

Implemented in Qrack::QUnit, Qrack::QEngineOCL, Qrack::QEngineOCLMulti, and Qrack::QEngineCPU.

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

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

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

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

void Qrack::QEngineCPU::MUL ( bitCapInt  toMul,
bitLenInt  inOutStart,
bitLenInt  carryStart,
bitLenInt  length,
bool  clearCary = false 
)
virtual

Multiply by integer.

Implements Qrack::QInterface.

void Qrack::QUnit::MUL ( bitCapInt  toMul,
bitLenInt  inOutStart,
bitLenInt  carryStart,
bitLenInt  length,
bool  clearCary = false 
)
virtual

Multiply by integer.

Implements Qrack::QInterface.

virtual void Qrack::QInterface::MUL ( bitCapInt  toMul,
bitLenInt  inOutStart,
bitLenInt  carryStart,
bitLenInt  length,
bool  clearCary = false 
)
pure virtual

Multiply by integer.

Implemented in Qrack::QUnit, Qrack::QEngineOCLMulti, Qrack::QEngineOCL, and Qrack::QEngineCPU.

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.

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.

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

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

Reimplemented from Qrack::QInterface.

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

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

"Circular shift right" - (Uses swap-based algorithm for speed)

Reimplemented in Qrack::QEngineOCL, and Qrack::QEngineCPU.