A "Qrack::QInterface" is an abstract interface exposing qubit permutation state vector with methods to operate on it as by gates and register-like instructions.
More...
|
| QInterface (bitLenInt n, std::shared_ptr< std::default_random_engine > rgp=nullptr, bool doNorm=true) |
|
virtual | ~QInterface () |
| Destructor of QInterface. More...
|
|
int | GetQubitCount () |
| Get the count of bits in this register. More...
|
|
int | GetMaxQPower () |
| Get the maximum number of basis states, namely for qubits. More...
|
|
virtual void | SetQuantumState (complex *inputState)=0 |
| Set an arbitrary pure quantum state. More...
|
|
virtual void | SetPermutation (bitCapInt perm)=0 |
| Set to a specific permutation. More...
|
|
virtual bitLenInt | Cohere (QInterfacePtr toCopy)=0 |
| Combine another QInterface with this one, after the last bit index of this one. More...
|
|
virtual std::map< QInterfacePtr, bitLenInt > | Cohere (std::vector< QInterfacePtr > toCopy) |
|
virtual void | Decohere (bitLenInt start, bitLenInt length, QInterfacePtr dest)=0 |
| Minimally decohere a set of contiguous bits from the full coherent unit, into "destination.". More...
|
|
virtual void | Dispose (bitLenInt start, bitLenInt length)=0 |
| Minimally decohere a set of contigious bits from the full coherent unit, throwing these qubits away. More...
|
|
virtual void | ApplySingleBit (const complex *mtrx, bool doCalcNorm, bitLenInt qubitIndex) |
| Apply an arbitrary single bit unitary transformation. More...
|
|
virtual void | CCNOT (bitLenInt control1, bitLenInt control2, bitLenInt target) |
| Doubly-controlled NOT gate. More...
|
|
virtual void | AntiCCNOT (bitLenInt control1, bitLenInt control2, bitLenInt target) |
| Anti doubly-controlled NOT gate. More...
|
|
virtual void | CNOT (bitLenInt control, bitLenInt target) |
| Controlled NOT gate. More...
|
|
virtual void | AntiCNOT (bitLenInt control, bitLenInt target) |
| Anti controlled NOT gate. More...
|
|
virtual void | H (bitLenInt qubitIndex) |
| Hadamard gate. More...
|
|
virtual bool | M (bitLenInt qubitIndex) |
| Measurement gate. More...
|
|
virtual void | X (bitLenInt qubitIndex) |
| X gate. More...
|
|
virtual void | Y (bitLenInt qubitIndex) |
| Y gate. More...
|
|
virtual void | Z (bitLenInt qubitIndex) |
| Z gate. More...
|
|
virtual void | CY (bitLenInt control, bitLenInt target) |
| Controlled Y gate. More...
|
|
virtual void | CZ (bitLenInt control, bitLenInt target) |
| Controlled Z gate. More...
|
|
virtual void | AND (bitLenInt inputBit1, bitLenInt inputBit2, bitLenInt outputBit) |
| Quantum analog of classical "AND" gate. More...
|
|
virtual void | OR (bitLenInt inputBit1, bitLenInt inputBit2, bitLenInt outputBit) |
| Quantum analog of classical "OR" gate. More...
|
|
virtual void | XOR (bitLenInt inputBit1, bitLenInt inputBit2, bitLenInt outputBit) |
| Quantum analog of classical "XOR" gate. More...
|
|
virtual void | CLAND (bitLenInt inputQBit, bool inputClassicalBit, bitLenInt outputBit) |
| Quantum analog of classical "AND" gate. More...
|
|
virtual void | CLOR (bitLenInt inputQBit, bool inputClassicalBit, bitLenInt outputBit) |
| Quantum analog of classical "OR" gate. More...
|
|
virtual void | CLXOR (bitLenInt inputQBit, bool inputClassicalBit, bitLenInt outputBit) |
| Quantum analog of classical "XOR" gate. More...
|
|
virtual void | RT (real1 radians, bitLenInt qubitIndex) |
| Phase shift gate. More...
|
|
virtual void | RTDyad (int numerator, int denomPower, bitLenInt qubitIndex) |
| Dyadic fraction phase shift gate. More...
|
|
virtual void | RX (real1 radians, bitLenInt qubitIndex) |
| X axis rotation gate. More...
|
|
virtual void | RXDyad (int numerator, int denomPower, bitLenInt qubitIndex) |
| Dyadic fraction X axis rotation gate. More...
|
|
virtual void | Exp (real1 radians, bitLenInt qubitIndex) |
| (Identity) Exponentiation gate More...
|
|
virtual void | ExpDyad (int numerator, int denomPower, bitLenInt qubitIndex) |
| Dyadic fraction (identity) exponentiation gate. More...
|
|
virtual void | ExpX (real1 radians, bitLenInt qubitIndex) |
| Pauli X exponentiation gate. More...
|
|
virtual void | ExpXDyad (int numerator, int denomPower, bitLenInt qubitIndex) |
| Dyadic fraction Pauli X exponentiation gate. More...
|
|
virtual void | ExpY (real1 radians, bitLenInt qubitIndex) |
| Pauli Y exponentiation gate. More...
|
|
virtual void | ExpYDyad (int numerator, int denomPower, bitLenInt qubitIndex) |
| Dyadic fraction Pauli Y exponentiation gate. More...
|
|
virtual void | ExpZ (real1 radians, bitLenInt qubitIndex) |
| Pauli Z exponentiation gate. More...
|
|
virtual void | ExpZDyad (int numerator, int denomPower, bitLenInt qubitIndex) |
| Dyadic fraction Pauli Z exponentiation gate. More...
|
|
virtual void | CRX (real1 radians, bitLenInt control, bitLenInt target) |
| Controlled X axis rotation gate. More...
|
|
virtual void | CRXDyad (int numerator, int denomPower, bitLenInt control, bitLenInt target) |
| Controlled dyadic fraction X axis rotation gate. More...
|
|
virtual void | RY (real1 radians, bitLenInt qubitIndex) |
| Y axis rotation gate. More...
|
|
virtual void | RYDyad (int numerator, int denomPower, bitLenInt qubitIndex) |
| Dyadic fraction Y axis rotation gate. More...
|
|
virtual void | CRY (real1 radians, bitLenInt control, bitLenInt target) |
| Controlled Y axis rotation gate. More...
|
|
virtual void | CRYDyad (int numerator, int denomPower, bitLenInt control, bitLenInt target) |
| Controlled dyadic fraction y axis rotation gate. More...
|
|
virtual void | RZ (real1 radians, bitLenInt qubitIndex) |
| Z axis rotation gate. More...
|
|
virtual void | RZDyad (int numerator, int denomPower, bitLenInt qubitIndex) |
| Dyadic fraction Z axis rotation gate. More...
|
|
virtual void | CRZ (real1 radians, bitLenInt control, bitLenInt target) |
| Controlled Z axis rotation gate. More...
|
|
virtual void | CRZDyad (int numerator, int denomPower, bitLenInt control, bitLenInt target) |
| Controlled dyadic fraction Z axis rotation gate. More...
|
|
virtual void | CRT (real1 radians, bitLenInt control, bitLenInt target) |
| Controlled "phase shift gate". More...
|
|
virtual void | CRTDyad (int numerator, int denomPower, bitLenInt control, bitLenInt target) |
| Controlled dyadic fraction "phase shift gate". More...
|
|
virtual void | H (bitLenInt start, bitLenInt length) |
| Bitwise Hadamard. More...
|
|
virtual void | X (bitLenInt start, bitLenInt length) |
| Bitwise Pauli X (or logical "NOT") operator. More...
|
|
virtual void | Y (bitLenInt start, bitLenInt length) |
| Bitwise Pauli Y operator. More...
|
|
virtual void | Z (bitLenInt start, bitLenInt length) |
| Bitwise Pauli Z operator. More...
|
|
virtual void | CNOT (bitLenInt inputBits, bitLenInt targetBits, bitLenInt length) |
| Bitwise controlled-not. More...
|
|
virtual void | AntiCNOT (bitLenInt inputBits, bitLenInt targetBits, bitLenInt length) |
| Bitwise "anti-"controlled-not. More...
|
|
virtual void | CCNOT (bitLenInt control1, bitLenInt control2, bitLenInt target, bitLenInt length) |
| Bitwise doubly controlled-not. More...
|
|
virtual void | AntiCCNOT (bitLenInt control1, bitLenInt control2, bitLenInt target, bitLenInt length) |
| Bitwise doubly "anti-"controlled-not. More...
|
|
virtual void | AND (bitLenInt inputStart1, bitLenInt inputStart2, bitLenInt outputStart, bitLenInt length) |
| Bitwise "AND". More...
|
|
virtual void | CLAND (bitLenInt qInputStart, bitCapInt classicalInput, bitLenInt outputStart, bitLenInt length) |
| Classical bitwise "AND". More...
|
|
virtual void | OR (bitLenInt inputStart1, bitLenInt inputStart2, bitLenInt outputStart, bitLenInt length) |
| Bitwise "OR". More...
|
|
virtual void | CLOR (bitLenInt qInputStart, bitCapInt classicalInput, bitLenInt outputStart, bitLenInt length) |
| Classical bitwise "OR". More...
|
|
virtual void | XOR (bitLenInt inputStart1, bitLenInt inputStart2, bitLenInt outputStart, bitLenInt length) |
| Bitwise "XOR". More...
|
|
virtual void | CLXOR (bitLenInt qInputStart, bitCapInt classicalInput, bitLenInt outputStart, bitLenInt length) |
| Classical bitwise "XOR". More...
|
|
virtual void | RT (real1 radians, bitLenInt start, bitLenInt length) |
| Bitwise phase shift gate. More...
|
|
virtual void | RTDyad (int numerator, int denomPower, bitLenInt start, bitLenInt length) |
| Bitwise dyadic fraction phase shift gate. More...
|
|
virtual void | RX (real1 radians, bitLenInt start, bitLenInt length) |
| Bitwise X axis rotation gate. More...
|
|
virtual void | RXDyad (int numerator, int denomPower, bitLenInt start, bitLenInt length) |
| Bitwise dyadic fraction X axis rotation gate. More...
|
|
virtual void | CRX (real1 radians, bitLenInt control, bitLenInt target, bitLenInt length) |
| Bitwise controlled X axis rotation gate. More...
|
|
virtual void | CRXDyad (int numerator, int denomPower, bitLenInt control, bitLenInt target, bitLenInt length) |
| Bitwise controlled dyadic fraction X axis rotation gate. More...
|
|
virtual void | RY (real1 radians, bitLenInt start, bitLenInt length) |
| Bitwise Y axis rotation gate. More...
|
|
virtual void | RYDyad (int numerator, int denomPower, bitLenInt start, bitLenInt length) |
| Bitwise dyadic fraction Y axis rotation gate. More...
|
|
virtual void | CRY (real1 radians, bitLenInt control, bitLenInt target, bitLenInt length) |
| Bitwise controlled Y axis rotation gate. More...
|
|
virtual void | CRYDyad (int numerator, int denomPower, bitLenInt control, bitLenInt target, bitLenInt length) |
| Bitwise controlled dyadic fraction y axis rotation gate. More...
|
|
virtual void | RZ (real1 radians, bitLenInt start, bitLenInt length) |
| Bitwise Z axis rotation gate. More...
|
|
virtual void | RZDyad (int numerator, int denomPower, bitLenInt start, bitLenInt length) |
| Bitwise dyadic fraction Z axis rotation gate. More...
|
|
virtual void | CRZ (real1 radians, bitLenInt control, bitLenInt target, bitLenInt length) |
| Bitwise controlled Z axis rotation gate. More...
|
|
virtual void | CRZDyad (int numerator, int denomPower, bitLenInt control, bitLenInt target, bitLenInt length) |
| Bitwise controlled dyadic fraction Z axis rotation gate. More...
|
|
virtual void | CRT (real1 radians, bitLenInt control, bitLenInt target, bitLenInt length) |
| Bitwise controlled "phase shift gate". More...
|
|
virtual void | CRTDyad (int numerator, int denomPower, bitLenInt control, bitLenInt target, bitLenInt length) |
| Bitwise controlled dyadic fraction "phase shift gate". More...
|
|
virtual void | Exp (real1 radians, bitLenInt start, bitLenInt length) |
| Bitwise (identity) exponentiation gate. More...
|
|
virtual void | ExpDyad (int numerator, int denomPower, bitLenInt start, bitLenInt length) |
| Bitwise Dyadic fraction (identity) exponentiation gate. More...
|
|
virtual void | ExpX (real1 radians, bitLenInt start, bitLenInt length) |
| Bitwise Pauli X exponentiation gate. More...
|
|
virtual void | ExpXDyad (int numerator, int denomPower, bitLenInt start, bitLenInt length) |
| Bitwise Dyadic fraction Pauli X exponentiation gate. More...
|
|
virtual void | ExpY (real1 radians, bitLenInt start, bitLenInt length) |
| Bitwise Pauli Y exponentiation gate. More...
|
|
virtual void | ExpYDyad (int numerator, int denomPower, bitLenInt start, bitLenInt length) |
| Bitwise Dyadic fraction Pauli Y exponentiation gate. More...
|
|
virtual void | ExpZ (real1 radians, bitLenInt start, bitLenInt length) |
| Bitwise Pauli Z exponentiation gate. More...
|
|
virtual void | ExpZDyad (int numerator, int denomPower, bitLenInt start, bitLenInt length) |
| Bitwise Dyadic fraction Pauli Z exponentiation gate. More...
|
|
virtual void | CY (bitLenInt control, bitLenInt target, bitLenInt length) |
| Bitwise controlled Y gate. More...
|
|
virtual void | CZ (bitLenInt control, bitLenInt target, bitLenInt length) |
| Bitwise controlled Z gate. More...
|
|
virtual void | ASL (bitLenInt shift, bitLenInt start, bitLenInt length) |
| Arithmetic shift left, with last 2 bits as sign and carry. More...
|
|
virtual void | ASR (bitLenInt shift, bitLenInt start, bitLenInt length) |
| Arithmetic shift right, with last 2 bits as sign and carry. More...
|
|
virtual void | LSL (bitLenInt shift, bitLenInt start, bitLenInt length) |
| Logical shift left, filling the extra bits with |0> More...
|
|
virtual void | LSR (bitLenInt shift, bitLenInt start, bitLenInt length) |
| Logical shift right, filling the extra bits with |0> More...
|
|
virtual void | ROL (bitLenInt shift, bitLenInt start, bitLenInt length) |
| Circular shift left - shift bits left, and carry last bits. More...
|
|
virtual void | ROR (bitLenInt shift, bitLenInt start, bitLenInt length) |
| Circular shift right - shift bits right, and carry first bits. More...
|
|
virtual void | INC (bitCapInt toAdd, bitLenInt start, bitLenInt length)=0 |
| Add integer (without sign) More...
|
|
virtual void | INCC (bitCapInt toAdd, bitLenInt start, bitLenInt length, bitLenInt carryIndex)=0 |
| Add integer (without sign, with carry) More...
|
|
virtual void | 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 | 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 | 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 | INCBCD (bitCapInt toAdd, bitLenInt start, bitLenInt length)=0 |
| Add classical BCD integer (without sign) More...
|
|
virtual void | INCBCDC (bitCapInt toAdd, bitLenInt start, bitLenInt length, bitLenInt carryIndex)=0 |
| Add classical BCD integer (without sign, with carry) More...
|
|
virtual void | DEC (bitCapInt toSub, bitLenInt start, bitLenInt length)=0 |
| Subtract classical integer (without sign) More...
|
|
virtual void | DECC (bitCapInt toSub, bitLenInt start, bitLenInt length, bitLenInt carryIndex)=0 |
| Subtract classical integer (without sign, with carry) More...
|
|
virtual void | 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 | 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 | 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 | DECBCD (bitCapInt toAdd, bitLenInt start, bitLenInt length)=0 |
| Subtract BCD integer (without sign) More...
|
|
virtual void | DECBCDC (bitCapInt toSub, bitLenInt start, bitLenInt length, bitLenInt carryIndex)=0 |
| Subtract BCD integer (without sign, with carry) More...
|
|
virtual void | MUL (bitCapInt toMul, bitLenInt inOutStart, bitLenInt carryStart, bitLenInt length, bool clearCary=false)=0 |
| Multiply by integer. More...
|
|
virtual void | DIV (bitCapInt toDiv, bitLenInt inOutStart, bitLenInt carryStart, bitLenInt length)=0 |
| Divide by integer. More...
|
|
virtual void | CMUL (bitCapInt toMul, bitLenInt inOutStart, bitLenInt carryStart, bitLenInt controlBit, bitLenInt length, bool clearCarry=false)=0 |
| Controlled multiplication by integer. More...
|
|
virtual void | CDIV (bitCapInt toDiv, bitLenInt inOutStart, bitLenInt carryStart, bitLenInt controlBit, bitLenInt length)=0 |
| Controlled division by power of integer. More...
|
|
virtual void | QFT (bitLenInt start, bitLenInt length) |
| Quantum Fourier Transform - Apply the quantum Fourier transform to the register. More...
|
|
virtual void | ZeroPhaseFlip (bitLenInt start, bitLenInt length)=0 |
| Reverse the phase of the state where the register equals zero. More...
|
|
virtual void | 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 | PhaseFlip ()=0 |
| Phase flip always - equivalent to Z X Z X on any bit in the QInterface. More...
|
|
virtual void | SetReg (bitLenInt start, bitLenInt length, bitCapInt value) |
| Set register bits to given permutation. More...
|
|
virtual bitCapInt | MReg (bitLenInt start, bitLenInt length) |
| Measure permutation state of a register. More...
|
|
virtual bitCapInt | IndexedLDA (bitLenInt indexStart, bitLenInt indexLength, bitLenInt valueStart, bitLenInt valueLength, unsigned char *values)=0 |
| Set 8 bit register bits by a superposed index-offset-based read from classical memory. More...
|
|
virtual bitCapInt | IndexedADC (bitLenInt indexStart, bitLenInt indexLength, bitLenInt valueStart, bitLenInt valueLength, bitLenInt carryIndex, unsigned char *values)=0 |
| Add to entangled 8 bit register state with a superposed index-offset-based read from classical memory. More...
|
|
virtual bitCapInt | IndexedSBC (bitLenInt indexStart, bitLenInt indexLength, bitLenInt valueStart, bitLenInt valueLength, bitLenInt carryIndex, 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 | Swap (bitLenInt qubitIndex1, bitLenInt qubitIndex2) |
| Swap values of two bits in register. More...
|
|
virtual void | Swap (bitLenInt start1, bitLenInt start2, bitLenInt length) |
| Bitwise swap. More...
|
|
virtual void | Reverse (bitLenInt first, bitLenInt last) |
| Reverse all of the bits in a sequence. More...
|
|
virtual void | CopyState (QInterfacePtr orig)=0 |
| Direct copy of raw state vector to produce a clone. More...
|
|
virtual real1 | Prob (bitLenInt qubitIndex)=0 |
| Direct measure of bit probability to be in |1> state. More...
|
|
virtual real1 | ProbAll (bitCapInt fullRegister)=0 |
| Direct measure of full register probability to be in permutation state. More...
|
|
virtual void | SetBit (bitLenInt qubitIndex1, bool value) |
| Set individual bit to pure |0> (false) or |1> (true) state. More...
|
|
virtual bool | ForceM (bitLenInt qubitIndex, bool result, bool doForce=true, real1 nrmlzr=1.0) |
| Act as though a measurement was applied, except force the result of the measurement. More...
|
|