Qrack
9.9
General classical-emulating-quantum development framework
|
Functions | |
virtual void | Qrack::QInterface::Mtrx (const complex *mtrx, bitLenInt qubit)=0 |
Apply an arbitrary single bit unitary transformation. More... | |
virtual void | Qrack::QInterface::MCMtrx (const std::vector< bitLenInt > &controls, const complex *mtrx, bitLenInt target)=0 |
Apply an arbitrary single bit unitary transformation, with arbitrary control bits. More... | |
virtual void | Qrack::QInterface::MACMtrx (const std::vector< bitLenInt > &controls, const complex *mtrx, bitLenInt target) |
Apply an arbitrary single bit unitary transformation, with arbitrary (anti-)control bits. More... | |
virtual void | Qrack::QInterface::UCMtrx (const std::vector< bitLenInt > &controls, const complex *mtrx, bitLenInt target, const bitCapInt &controlPerm) |
Apply an arbitrary single bit unitary transformation, with arbitrary control bits, with arbitary control permutation. More... | |
virtual void | Qrack::QInterface::Phase (const complex &topLeft, const complex &bottomRight, bitLenInt qubit) |
Apply a single bit transformation that only effects phase. More... | |
virtual void | Qrack::QInterface::Invert (const complex &topRight, const complex &bottomLeft, bitLenInt qubit) |
Apply a single bit transformation that reverses bit probability and might effect phase. More... | |
virtual void | Qrack::QInterface::MCPhase (const std::vector< bitLenInt > &controls, const complex &topLeft, const complex &bottomRight, bitLenInt target) |
Apply a single bit transformation that only effects phase, with arbitrary control bits. More... | |
virtual void | Qrack::QInterface::MCInvert (const std::vector< bitLenInt > &controls, const complex &topRight, const complex &bottomLeft, bitLenInt target) |
Apply a single bit transformation that reverses bit probability and might effect phase, with arbitrary control bits. More... | |
virtual void | Qrack::QInterface::MACPhase (const std::vector< bitLenInt > &controls, const complex &topLeft, const complex &bottomRight, bitLenInt target) |
Apply a single bit transformation that only effects phase, with arbitrary (anti-)control bits. More... | |
virtual void | Qrack::QInterface::MACInvert (const std::vector< bitLenInt > &controls, const complex &topRight, const complex &bottomLeft, bitLenInt target) |
Apply a single bit transformation that reverses bit probability and might effect phase, with arbitrary (anti-)control bits. More... | |
virtual void | Qrack::QInterface::UCPhase (const std::vector< bitLenInt > &controls, const complex &topLeft, const complex &bottomRight, bitLenInt target, const bitCapInt &perm) |
Apply a single bit transformation that only effects phase, with arbitrary control bits, with arbitrary control permutation. More... | |
virtual void | Qrack::QInterface::UCInvert (const std::vector< bitLenInt > &controls, const complex &topRight, const complex &bottomLeft, bitLenInt target, const bitCapInt &perm) |
Apply a single bit transformation that reverses bit probability and might effect phase, with arbitrary control bits, with arbitrary control permutation. More... | |
virtual void | Qrack::QInterface::UniformlyControlledSingleBit (const std::vector< bitLenInt > &controls, bitLenInt qubit, const complex *mtrxs) |
Apply a "uniformly controlled" arbitrary single bit unitary transformation. More... | |
virtual void | Qrack::QInterface::UniformlyControlledSingleBit (const std::vector< bitLenInt > &controls, bitLenInt qubit, const complex *mtrxs, const std::vector< bitCapInt > &mtrxSkipPowers, const bitCapInt &mtrxSkipValueMask) |
virtual void | Qrack::QInterface::TimeEvolve (Hamiltonian h, real1_f timeDiff) |
To define a Hamiltonian, give a vector of controlled single bit gates ("HamiltonianOp" instances) that are applied by left-multiplication in low-to-high vector index order on the state vector. More... | |
virtual void | Qrack::QInterface::CSwap (const std::vector< bitLenInt > &controls, bitLenInt qubit1, bitLenInt qubit2) |
Apply a swap with arbitrary control bits. More... | |
virtual void | Qrack::QInterface::AntiCSwap (const std::vector< bitLenInt > &controls, bitLenInt qubit1, bitLenInt qubit2) |
Apply a swap with arbitrary (anti) control bits. More... | |
virtual void | Qrack::QInterface::CSqrtSwap (const std::vector< bitLenInt > &controls, bitLenInt qubit1, bitLenInt qubit2) |
Apply a square root of swap with arbitrary control bits. More... | |
virtual void | Qrack::QInterface::AntiCSqrtSwap (const std::vector< bitLenInt > &controls, bitLenInt qubit1, bitLenInt qubit2) |
Apply a square root of swap with arbitrary (anti) control bits. More... | |
virtual void | Qrack::QInterface::CISqrtSwap (const std::vector< bitLenInt > &controls, bitLenInt qubit1, bitLenInt qubit2) |
Apply an inverse square root of swap with arbitrary control bits. More... | |
virtual void | Qrack::QInterface::AntiCISqrtSwap (const std::vector< bitLenInt > &controls, bitLenInt qubit1, bitLenInt qubit2) |
Apply an inverse square root of swap with arbitrary (anti) control bits. More... | |
virtual void | Qrack::QInterface::CCNOT (bitLenInt control1, bitLenInt control2, bitLenInt target) |
Doubly-controlled NOT gate. More... | |
virtual void | Qrack::QInterface::AntiCCNOT (bitLenInt control1, bitLenInt control2, bitLenInt target) |
Anti doubly-controlled NOT gate. More... | |
virtual void | Qrack::QInterface::CNOT (bitLenInt control, bitLenInt target) |
Controlled NOT gate. More... | |
virtual void | Qrack::QInterface::AntiCNOT (bitLenInt control, bitLenInt target) |
Anti controlled NOT gate. More... | |
virtual void | Qrack::QInterface::CY (bitLenInt control, bitLenInt target) |
Controlled Y gate. More... | |
virtual void | Qrack::QInterface::AntiCY (bitLenInt control, bitLenInt target) |
Anti controlled Y gate. More... | |
virtual void | Qrack::QInterface::CCY (bitLenInt control1, bitLenInt control2, bitLenInt target) |
Doubly-Controlled Y gate. More... | |
virtual void | Qrack::QInterface::AntiCCY (bitLenInt control1, bitLenInt control2, bitLenInt target) |
Anti doubly-controlled Y gate. More... | |
virtual void | Qrack::QInterface::CZ (bitLenInt control, bitLenInt target) |
Controlled Z gate. More... | |
virtual void | Qrack::QInterface::AntiCZ (bitLenInt control, bitLenInt target) |
Anti controlled Z gate. More... | |
virtual void | Qrack::QInterface::CCZ (bitLenInt control1, bitLenInt control2, bitLenInt target) |
Doubly-Controlled Z gate. More... | |
virtual void | Qrack::QInterface::AntiCCZ (bitLenInt control1, bitLenInt control2, bitLenInt target) |
Anti doubly-controlled Z gate. More... | |
virtual void | Qrack::QInterface::U (bitLenInt target, real1_f theta, real1_f phi, real1_f lambda) |
General unitary gate. More... | |
virtual void | Qrack::QInterface::U2 (bitLenInt target, real1_f phi, real1_f lambda) |
2-parameter unitary gate More... | |
virtual void | Qrack::QInterface::IU2 (bitLenInt target, real1_f phi, real1_f lambda) |
Inverse 2-parameter unitary gate. More... | |
virtual void | Qrack::QInterface::AI (bitLenInt target, real1_f azimuth, real1_f inclination) |
"Azimuth, Inclination" (RY-RZ) More... | |
virtual void | Qrack::QInterface::IAI (bitLenInt target, real1_f azimuth, real1_f inclination) |
Invert "Azimuth, Inclination" (RY-RZ) More... | |
virtual void | Qrack::QInterface::CAI (bitLenInt control, bitLenInt target, real1_f azimuth, real1_f inclination) |
Controlled "Azimuth, Inclination" (RY-RZ) More... | |
virtual void | Qrack::QInterface::AntiCAI (bitLenInt control, bitLenInt target, real1_f azimuth, real1_f inclination) |
(Anti-)Controlled "Azimuth, Inclination" (RY-RZ) More... | |
virtual void | Qrack::QInterface::CIAI (bitLenInt control, bitLenInt target, real1_f azimuth, real1_f inclination) |
Controlled inverse "Azimuth, Inclination" (RY-RZ) More... | |
virtual void | Qrack::QInterface::AntiCIAI (bitLenInt control, bitLenInt target, real1_f azimuth, real1_f inclination) |
(Anti-)Controlled inverse "Azimuth, Inclination" (RY-RZ) More... | |
virtual void | Qrack::QInterface::CU (const std::vector< bitLenInt > &controls, bitLenInt target, real1_f theta, real1_f phi, real1_f lambda) |
Controlled general unitary gate. More... | |
virtual void | Qrack::QInterface::AntiCU (const std::vector< bitLenInt > &controls, bitLenInt target, real1_f theta, real1_f phi, real1_f lambda) |
(Anti-)Controlled general unitary gate More... | |
virtual void | Qrack::QInterface::H (bitLenInt qubit) |
Hadamard gate. More... | |
virtual void | Qrack::QInterface::SqrtH (bitLenInt qubit) |
Square root of Hadamard gate. More... | |
virtual void | Qrack::QInterface::SH (bitLenInt qubit) |
Y-basis transformation gate. More... | |
virtual void | Qrack::QInterface::HIS (bitLenInt qubit) |
Y-basis (inverse) transformation gate. More... | |
virtual bool | Qrack::QInterface::M (bitLenInt qubit) |
Measurement gate. More... | |
virtual bool | Qrack::QInterface::ForceM (bitLenInt qubit, bool result, bool doForce=true, bool doApply=true)=0 |
Act as if is a measurement was applied, except force the (usually random) result. More... | |
virtual void | Qrack::QInterface::S (bitLenInt qubit) |
S gate. More... | |
virtual void | Qrack::QInterface::IS (bitLenInt qubit) |
Inverse S gate. More... | |
virtual void | Qrack::QInterface::T (bitLenInt qubit) |
T gate. More... | |
virtual void | Qrack::QInterface::IT (bitLenInt qubit) |
Inverse T gate. More... | |
virtual void | Qrack::QInterface::PhaseRootN (bitLenInt n, bitLenInt qubit) |
"PhaseRootN" gate More... | |
virtual void | Qrack::QInterface::PhaseRootNMask (bitLenInt n, const bitCapInt &mask) |
Masked PhaseRootN gate. More... | |
virtual void | Qrack::QInterface::PhaseParity (real1_f radians, const bitCapInt &mask) |
Parity phase gate. More... | |
virtual void | Qrack::QInterface::X (bitLenInt qubit) |
X gate. More... | |
virtual void | Qrack::QInterface::XMask (const bitCapInt &mask) |
Masked X gate. More... | |
virtual void | Qrack::QInterface::Y (bitLenInt qubit) |
Y gate. More... | |
virtual void | Qrack::QInterface::YMask (const bitCapInt &mask) |
Masked Y gate. More... | |
virtual void | Qrack::QInterface::Z (bitLenInt qubit) |
Z gate. More... | |
virtual void | Qrack::QInterface::ZMask (const bitCapInt &mask) |
Masked Z gate. More... | |
virtual void | Qrack::QInterface::SqrtX (bitLenInt qubit) |
Square root of X gate. More... | |
virtual void | Qrack::QInterface::ISqrtX (bitLenInt qubit) |
Inverse square root of X gate. More... | |
virtual void | Qrack::QInterface::SqrtY (bitLenInt qubit) |
Square root of Y gate. More... | |
virtual void | Qrack::QInterface::ISqrtY (bitLenInt qubit) |
Inverse square root of Y gate. More... | |
virtual void | Qrack::QInterface::SqrtW (bitLenInt qubit) |
Square root of W gate. More... | |
virtual void | Qrack::QInterface::ISqrtW (bitLenInt qubit) |
Inverse square root of W gate. More... | |
virtual void | Qrack::QInterface::CH (bitLenInt control, bitLenInt target) |
Controlled H gate. More... | |
virtual void | Qrack::QInterface::AntiCH (bitLenInt control, bitLenInt target) |
(Anti-)controlled H gate More... | |
virtual void | Qrack::QInterface::CS (bitLenInt control, bitLenInt target) |
Controlled S gate. More... | |
virtual void | Qrack::QInterface::AntiCS (bitLenInt control, bitLenInt target) |
(Anti-)controlled S gate More... | |
virtual void | Qrack::QInterface::CIS (bitLenInt control, bitLenInt target) |
Controlled inverse S gate. More... | |
virtual void | Qrack::QInterface::AntiCIS (bitLenInt control, bitLenInt target) |
(Anti-)controlled inverse S gate More... | |
virtual void | Qrack::QInterface::CT (bitLenInt control, bitLenInt target) |
Controlled T gate. More... | |
virtual void | Qrack::QInterface::CIT (bitLenInt control, bitLenInt target) |
Controlled inverse T gate. More... | |
virtual void | Qrack::QInterface::CPhaseRootN (bitLenInt n, bitLenInt control, bitLenInt target) |
Controlled "PhaseRootN" gate. More... | |
virtual void | Qrack::QInterface::AntiCPhaseRootN (bitLenInt n, bitLenInt control, bitLenInt target) |
(Anti-)controlled "PhaseRootN" gate More... | |
virtual void | Qrack::QInterface::CIPhaseRootN (bitLenInt n, bitLenInt control, bitLenInt target) |
Controlled inverse "PhaseRootN" gate. More... | |
virtual void | Qrack::QInterface::AntiCIPhaseRootN (bitLenInt n, bitLenInt control, bitLenInt target) |
(Anti-)controlled inverse "PhaseRootN" gate More... | |
virtual void | Qrack::QUnit::H (bitLenInt target) |
Hadamard gate. More... | |
virtual void | Qrack::QUnit::S (bitLenInt target) |
S gate. More... | |
virtual void | Qrack::QUnit::IS (bitLenInt target) |
Inverse S gate. More... | |
virtual void | Qrack::QUnit::ZMask (const bitCapInt &mask) |
Masked Z gate. More... | |
virtual void | Qrack::QUnit::PhaseParity (real1 radians, const bitCapInt &mask) |
virtual void | Qrack::QUnit::Phase (const complex &topLeft, const complex &bottomRight, bitLenInt qubitIndex) |
Apply a single bit transformation that only effects phase. More... | |
virtual void | Qrack::QUnit::Invert (const complex &topRight, const complex &bottomLeft, bitLenInt qubitIndex) |
Apply a single bit transformation that reverses bit probability and might effect phase. More... | |
virtual void | Qrack::QUnit::MCPhase (const std::vector< bitLenInt > &controls, const complex &topLeft, const complex &bottomRight, bitLenInt target) |
Apply a single bit transformation that only effects phase, with arbitrary control bits. More... | |
virtual void | Qrack::QUnit::MCInvert (const std::vector< bitLenInt > &controls, const complex &topRight, const complex &bottomLeft, bitLenInt target) |
Apply a single bit transformation that reverses bit probability and might effect phase, with arbitrary control bits. More... | |
virtual void | Qrack::QUnit::MACPhase (const std::vector< bitLenInt > &controls, const complex &topLeft, const complex &bottomRight, bitLenInt target) |
Apply a single bit transformation that only effects phase, with arbitrary (anti-)control bits. More... | |
virtual void | Qrack::QUnit::MACInvert (const std::vector< bitLenInt > &controls, const complex &topRight, const complex &bottomLeft, bitLenInt target) |
Apply a single bit transformation that reverses bit probability and might effect phase, with arbitrary (anti-)control bits. More... | |
virtual void | Qrack::QUnit::UCPhase (const std::vector< bitLenInt > &controls, const complex &topLeft, const complex &bottomRight, bitLenInt target, const bitCapInt &controlPerm) |
Apply a single bit transformation that only effects phase, with arbitrary control bits, with arbitrary control permutation. More... | |
virtual void | Qrack::QUnit::UCInvert (const std::vector< bitLenInt > &controls, const complex &topRight, const complex &bottomLeft, bitLenInt target, const bitCapInt &controlPerm) |
Apply a single bit transformation that reverses bit probability and might effect phase, with arbitrary control bits, with arbitrary control permutation. More... | |
virtual void | Qrack::QUnit::Mtrx (const complex *mtrx, bitLenInt qubit) |
Apply an arbitrary single bit unitary transformation. More... | |
virtual void | Qrack::QUnit::MCMtrx (const std::vector< bitLenInt > &controls, const complex *mtrx, bitLenInt target) |
Apply an arbitrary single bit unitary transformation, with arbitrary control bits. More... | |
virtual void | Qrack::QUnit::MACMtrx (const std::vector< bitLenInt > &controls, const complex *mtrx, bitLenInt target) |
Apply an arbitrary single bit unitary transformation, with arbitrary (anti-)control bits. More... | |
virtual void | Qrack::QUnit::UCMtrx (const std::vector< bitLenInt > &controls, const complex *mtrx, bitLenInt target, const bitCapInt &controlPerm) |
Apply an arbitrary single bit unitary transformation, with arbitrary control bits, with arbitary control permutation. More... | |
virtual void | Qrack::QUnit::UniformlyControlledSingleBit (const std::vector< bitLenInt > &controls, bitLenInt qubitIndex, const complex *mtrxs, const std::vector< bitCapInt > &mtrxSkipPowers, const bitCapInt &mtrxSkipValueMask) |
virtual void | Qrack::QUnit::CUniformParityRZ (const std::vector< bitLenInt > &controls, const bitCapInt &mask, real1_f angle) |
If the controls are set and the target qubit set parity is odd, this applies a phase factor of \(e^{i angle}\). More... | |
virtual void | Qrack::QUnit::CSwap (const std::vector< bitLenInt > &controls, bitLenInt qubit1, bitLenInt qubit2) |
Apply a swap with arbitrary control bits. More... | |
virtual void | Qrack::QUnit::AntiCSwap (const std::vector< bitLenInt > &controls, bitLenInt qubit1, bitLenInt qubit2) |
Apply a swap with arbitrary (anti) control bits. More... | |
virtual void | Qrack::QUnit::CSqrtSwap (const std::vector< bitLenInt > &controls, bitLenInt qubit1, bitLenInt qubit2) |
Apply a square root of swap with arbitrary control bits. More... | |
virtual void | Qrack::QUnit::AntiCSqrtSwap (const std::vector< bitLenInt > &controls, bitLenInt qubit1, bitLenInt qubit2) |
Apply a square root of swap with arbitrary (anti) control bits. More... | |
virtual void | Qrack::QUnit::CISqrtSwap (const std::vector< bitLenInt > &controls, bitLenInt qubit1, bitLenInt qubit2) |
Apply an inverse square root of swap with arbitrary control bits. More... | |
virtual void | Qrack::QUnit::AntiCISqrtSwap (const std::vector< bitLenInt > &controls, bitLenInt qubit1, bitLenInt qubit2) |
Apply an inverse square root of swap with arbitrary (anti) control bits. More... | |
virtual bool | Qrack::QUnit::ForceM (bitLenInt qubitIndex, bool result, bool doForce=true, bool doApply=true) |
Act as if is a measurement was applied, except force the (usually random) result. More... | |
virtual bitCapInt | Qrack::QUnit::ForceMReg (bitLenInt start, bitLenInt length, const bitCapInt &result, bool doForce=true, bool doApply=true) |
Act as if is a measurement was applied, except force the (usually random) result. More... | |
virtual bitCapInt | Qrack::QUnit::MAll () |
Measure permutation state of all coherent bits. More... | |
virtual std::map< bitCapInt, int > | Qrack::QUnit::MultiShotMeasureMask (const std::vector< bitCapInt > &qPowers, unsigned shots) |
Statistical measure of masked permutation probability. More... | |
virtual void | Qrack::QUnit::MultiShotMeasureMask (const std::vector< bitCapInt > &qPowers, unsigned shots, unsigned long long *shotsArray) |
Statistical measure of masked permutation probability (returned as array) More... | |
"Azimuth, Inclination" (RY-RZ)
"Azimuth, Inclination"
Sets the azimuth and inclination from Z-X-Y basis probability measurements.
|
virtual |
(Anti-)Controlled "Azimuth, Inclination" (RY-RZ)
Controlled "Azimuth, Inclination".
If the control bit is reset, this gate sets the azimuth and inclination from Z-X-Y basis probability measurements.
|
inlinevirtual |
Anti doubly-controlled NOT gate.
If both controls are set to 0, the target bit is NOT-ed or X-ed.
|
inlinevirtual |
Anti doubly-controlled Y gate.
If both controls are set to 0, apply Pauli Y operation to target bit.
|
inlinevirtual |
Anti doubly-controlled Z gate.
If both controls are set to 0, apply Pauli Z operation to target bit.
(Anti-)controlled H gate
If the "control" bit is set to 1, then the "H" Walsh-Hadamard transform operator is applied to "target."
|
virtual |
(Anti-)Controlled inverse "Azimuth, Inclination" (RY-RZ)
Controlled inverse "Azimuth, Inclination".
(Inverse of...) If the control bit is reset, this gate sets the azimuth and inclination from Z-X-Y basis probability measurements.
|
inlinevirtual |
(Anti-)controlled inverse "PhaseRootN" gate
If the "control" bit is set to 0, then the inverse "PhaseRootN" gate is applied to "target."
(Anti-)controlled inverse S gate
If the "control" bit is set to 1, then the inverse S gate is applied to "target."
|
virtual |
Apply an inverse square root of swap with arbitrary (anti) control bits.
Reimplemented in Qrack::QStabilizerHybrid, Qrack::QUnit, Qrack::QInterfaceNoisy, Qrack::QHybrid, Qrack::QEngine, and Qrack::QBdtHybrid.
|
virtual |
Apply an inverse square root of swap with arbitrary (anti) control bits.
Reimplemented from Qrack::QInterface.
Anti controlled NOT gate.
If the control is set to 0, the target bit is NOT-ed or X-ed.
Reimplemented in Qrack::QStabilizer, and Qrack::QUnitClifford.
|
inlinevirtual |
(Anti-)controlled "PhaseRootN" gate
If the "control" bit is set to 0, then the "PhaseRootN" gate is applied to "target."
(Anti-)controlled S gate
If the "control" bit is set to 1, then the S gate is applied to "target."
|
virtual |
Apply a square root of swap with arbitrary (anti) control bits.
Reimplemented in Qrack::QStabilizerHybrid, Qrack::QUnit, Qrack::QInterfaceNoisy, Qrack::QHybrid, Qrack::QEngine, and Qrack::QBdtHybrid.
|
virtual |
Apply a square root of swap with arbitrary (anti) control bits.
Reimplemented from Qrack::QInterface.
|
virtual |
Apply a swap with arbitrary (anti) control bits.
Reimplemented in Qrack::QUnit, Qrack::QInterfaceNoisy, Qrack::QHybrid, Qrack::QEngine, and Qrack::QBdtHybrid.
|
virtual |
Apply a swap with arbitrary (anti) control bits.
Reimplemented from Qrack::QInterface.
|
virtual |
(Anti-)Controlled general unitary gate
Applies an (anti-)controlled gate guaranteed to be unitary, from three angles, as commonly defined, spanning all possible single bit unitary gates, (up to a global phase factor which has no effect on Hermitian operator expectation values).
Anti controlled Y gate.
If the control is set to 0, then the Pauli "Y" operator is applied to the target.
Reimplemented in Qrack::QStabilizer, and Qrack::QUnitClifford.
Anti controlled Z gate.
If the control is set to 0, then the Pauli "Z" operator is applied to the target.
Reimplemented in Qrack::QStabilizer, and Qrack::QUnitClifford.
|
virtual |
Controlled "Azimuth, Inclination" (RY-RZ)
Controlled "Azimuth, Inclination".
If the control bit is set, this gate sets the azimuth and inclination from Z-X-Y basis probability measurements.
|
inlinevirtual |
Doubly-controlled NOT gate.
If both controls are set to 1, the target bit is NOT-ed or X-ed.
|
inlinevirtual |
Doubly-Controlled Y gate.
If both "control" bits are set to 1, then the Pauli "Y" operator is applied to "target."
|
inlinevirtual |
Doubly-Controlled Z gate.
If both "control" bits are set to 1, then the Pauli "Z" operator is applied to "target."
Controlled H gate.
If the "control" bit is set to 1, then the "H" Walsh-Hadamard transform operator is applied to "target."
|
virtual |
Controlled inverse "Azimuth, Inclination" (RY-RZ)
Controlled inverse "Azimuth, Inclination".
(Inverse of...) If the control bit is set, this gate sets the azimuth and inclination from Z-X-Y basis probability measurements.
|
inlinevirtual |
Controlled inverse "PhaseRootN" gate.
If the "control" bit is set to 1, then the inverse "PhaseRootN" gate is applied to "target."
Controlled inverse S gate.
If the "control" bit is set to 1, then the inverse S gate is applied to "target."
|
virtual |
Apply an inverse square root of swap with arbitrary control bits.
Reimplemented in Qrack::QStabilizerHybrid, Qrack::QUnit, Qrack::QInterfaceNoisy, Qrack::QHybrid, Qrack::QEngine, Qrack::QBdtHybrid, and Qrack::QBdt.
|
virtual |
Apply an inverse square root of swap with arbitrary control bits.
Reimplemented from Qrack::QInterface.
Controlled inverse T gate.
If the "control" bit is set to 1, then the inverse T gate is applied to "target."
Controlled NOT gate.
If the control is set to 1, the target bit is NOT-ed or X-ed.
Reimplemented in Qrack::QStabilizer, and Qrack::QUnitClifford.
|
inlinevirtual |
Controlled "PhaseRootN" gate.
If the "control" bit is set to 1, then the "PhaseRootN" gate is applied to "target."
Controlled S gate.
If the "control" bit is set to 1, then the S gate is applied to "target."
|
virtual |
Apply a square root of swap with arbitrary control bits.
Reimplemented in Qrack::QStabilizerHybrid, Qrack::QUnit, Qrack::QInterfaceNoisy, Qrack::QHybrid, Qrack::QEngine, Qrack::QBdtHybrid, and Qrack::QBdt.
|
virtual |
Apply a square root of swap with arbitrary control bits.
Reimplemented from Qrack::QInterface.
|
virtual |
Apply a swap with arbitrary control bits.
Reimplemented in Qrack::QStabilizerHybrid, Qrack::QUnit, Qrack::QInterfaceNoisy, Qrack::QHybrid, Qrack::QEngine, Qrack::QBdtHybrid, and Qrack::QBdt.
|
virtual |
Apply a swap with arbitrary control bits.
Reimplemented from Qrack::QInterface.
Controlled T gate.
If the "control" bit is set to 1, then the T gate is applied to "target."
|
virtual |
Controlled general unitary gate.
Applies a controlled gate guaranteed to be unitary, from three angles, as commonly defined, spanning all possible single bit unitary gates, (up to a global phase factor which has no effect on Hermitian operator expectation values).
|
virtual |
If the controls are set and the target qubit set parity is odd, this applies a phase factor of \(e^{i angle}\).
If the controls are set and the target qubit set parity is even, this applies the conjugate, \(e^{-i angle}\). Otherwise, do nothing if any control is not set.
Implements Qrack::QParity.
Controlled Y gate.
If the "control" bit is set to 1, then the Pauli "Y" operator is applied to "target."
Reimplemented in Qrack::QStabilizer, and Qrack::QUnitClifford.
Controlled Z gate.
If the "control" bit is set to 1, then the Pauli "Z" operator is applied to "target."
Reimplemented in Qrack::QStabilizer, and Qrack::QUnitClifford.
|
pure virtual |
Act as if is a measurement was applied, except force the (usually random) result.
Implemented in Qrack::QUnitClifford, Qrack::QStabilizer, Qrack::QUnit, Qrack::QEngine, Qrack::QTensorNetwork, Qrack::QStabilizerHybrid, Qrack::QPager, Qrack::QInterfaceNoisy, Qrack::QHybrid, Qrack::QBdtHybrid, and Qrack::QBdt.
|
virtual |
Act as if is a measurement was applied, except force the (usually random) result.
Implements Qrack::QInterface.
|
virtual |
Act as if is a measurement was applied, except force the (usually random) result.
Bit-wise apply measurement gate to a register.
Reimplemented from Qrack::QInterface.
|
inlinevirtual |
Hadamard gate.
Applies a Hadamard gate on qubit at "qubit."
Reimplemented in Qrack::QUnit, Qrack::QUnitClifford, and Qrack::QStabilizer.
|
virtual |
|
inlinevirtual |
Y-basis (inverse) transformation gate.
Converts from Pauli Y basis to Z, (via IS then H gates).
Invert "Azimuth, Inclination" (RY-RZ)
Inverse "Azimuth, Inclination".
(Inverse of) sets the azimuth and inclination from Z-X-Y basis probability measurements.
|
inlinevirtual |
Apply a single bit transformation that reverses bit probability and might effect phase.
Reimplemented in Qrack::QStabilizer, Qrack::QUnitClifford, Qrack::QUnit, Qrack::QPager, Qrack::QInterfaceNoisy, Qrack::QHybrid, Qrack::QEngineOCL, Qrack::QEngineCUDA, and Qrack::QBdtHybrid.
|
virtual |
Apply a single bit transformation that reverses bit probability and might effect phase.
Reimplemented from Qrack::QInterface.
|
inlinevirtual |
Inverse S gate.
Applies an inverse 1/4 phase rotation to the qubit at "qubit."
Reimplemented in Qrack::QUnit, Qrack::QUnitClifford, and Qrack::QStabilizer.
|
virtual |
Inverse S gate.
Applies an inverse 1/4 phase rotation to the qubit at "qubit."
Reimplemented from Qrack::QInterface.
|
inlinevirtual |
Inverse square root of W gate.
Per 2019 Arute, Google's "quantum supremacy" experiment
|
inlinevirtual |
Inverse square root of X gate.
Applies the (by convention) inverse square root of the Pauli "X" operator to the qubit at "qubit." The Pauli "X" operator is equivalent to a logical "NOT."
|
inlinevirtual |
Inverse square root of Y gate.
Applies the (by convention) inverse square root of the Pauli "Y" operator to the qubit at "qubit." The Pauli "Y" operator is similar to a logical "NOT" with permutation phase effects.
|
inlinevirtual |
Inverse T gate.
Applies an inverse 1/8 phase rotation to the qubit at "qubit."
Inverse 2-parameter unitary gate.
Applies the inverse of U2
|
inlinevirtual |
Measurement gate.
Measures the qubit at "qubit" and returns either "true" or "false." (This "gate" breaks unitarity.)
All physical evolution of a quantum state should be "unitary," except measurement. Measurement of a qubit "collapses" the quantum state into either only permutation states consistent with a |0> state for the bit, or else only permutation states consistent with a |1> state for the bit. Measurement also effectively multiplies the overall quantum state vector of the system by a random phase factor, equiprobable over all possible phase angles.
Effectively, when a bit measurement is emulated, Qrack calculates the norm of all permutation state components, to find their respective probabilities. The probabilities of all states in which the measured bit is "0" can be summed to give the probability of the bit being "0," and separately the probabilities of all states in which the measured bit is "1" can be summed to give the probability of the bit being "1." To simulate measurement, a random float between 0 and 1 is compared to the sum of the probability of all permutation states in which the bit is equal to "1". Depending on whether the random float is higher or lower than the probability, the qubit is determined to be either |0> or |1>, (up to phase). If the bit is determined to be |1>, then all permutation eigenstates in which the bit would be equal to |0> have their probability set to zero, and vice versa if the bit is determined to be |0>. Then, all remaining permutation states with nonzero probability are linearly rescaled so that the total probability of all permutation states is again "normalized" to exactly 100% or 1, (within double precision rounding error). Physically, the act of measurement should introduce an overall random phase factor on the state vector, which is emulated by generating another constantly distributed random float to select a phase angle between 0 and 2 * Pi.
Measurement breaks unitary evolution of state. All quantum gates except measurement should generally act as a unitary matrix on a permutation state vector. (Note that Boolean comparison convenience methods in Qrack such as "AND," "OR," and "XOR" employ the measurement operation in the act of first clearing output bits before filling them with the result of comparison, and these convenience methods therefore break unitary evolution of state, but in a physically realistic way. Comparable unitary operations would be performed with a combination of X and CCNOT gates, also called "Toffoli" gates, but the output bits would have to be assumed to be in a known fixed state, like all |0>, ahead of time to produce unitary logical comparison operations.)
Reimplemented in Qrack::QUnit, Qrack::QStabilizerHybrid, Qrack::QEngine, Qrack::QBdtHybrid, and Qrack::QBdt.
|
inlinevirtual |
Apply a single bit transformation that reverses bit probability and might effect phase, with arbitrary (anti-)control bits.
Reimplemented in Qrack::QUnit, Qrack::QTensorNetwork, Qrack::QStabilizerHybrid, Qrack::QStabilizer, and Qrack::QUnitClifford.
|
inlinevirtual |
Apply a single bit transformation that reverses bit probability and might effect phase, with arbitrary (anti-)control bits.
Reimplemented from Qrack::QInterface.
|
inlinevirtual |
Apply an arbitrary single bit unitary transformation, with arbitrary (anti-)control bits.
Reimplemented in Qrack::QUnit, Qrack::QTensorNetwork, Qrack::QStabilizerHybrid, Qrack::QStabilizer, Qrack::QPager, Qrack::QInterfaceNoisy, Qrack::QHybrid, Qrack::QEngine, Qrack::QBdtHybrid, Qrack::QBdt, and Qrack::QUnitClifford.
|
inlinevirtual |
Apply an arbitrary single bit unitary transformation, with arbitrary (anti-)control bits.
Reimplemented from Qrack::QInterface.
|
inlinevirtual |
Apply a single bit transformation that only effects phase, with arbitrary (anti-)control bits.
Reimplemented in Qrack::QUnit, Qrack::QTensorNetwork, Qrack::QStabilizerHybrid, Qrack::QStabilizer, and Qrack::QUnitClifford.
|
inlinevirtual |
Apply a single bit transformation that only effects phase, with arbitrary (anti-)control bits.
Reimplemented from Qrack::QInterface.
|
virtual |
Measure permutation state of all coherent bits.
Reimplemented from Qrack::QInterface.
|
inlinevirtual |
Apply a single bit transformation that reverses bit probability and might effect phase, with arbitrary control bits.
Reimplemented in Qrack::QUnit, Qrack::QTensorNetwork, Qrack::QStabilizerHybrid, Qrack::QStabilizer, Qrack::QBdt, and Qrack::QUnitClifford.
|
inlinevirtual |
Apply a single bit transformation that reverses bit probability and might effect phase, with arbitrary control bits.
Reimplemented from Qrack::QInterface.
|
inlinevirtual |
Apply an arbitrary single bit unitary transformation, with arbitrary control bits.
Implements Qrack::QInterface.
|
pure virtual |
Apply an arbitrary single bit unitary transformation, with arbitrary control bits.
Implemented in Qrack::QUnit, Qrack::QTensorNetwork, Qrack::QStabilizerHybrid, Qrack::QStabilizer, Qrack::QPager, Qrack::QInterfaceNoisy, Qrack::QHybrid, Qrack::QEngine, Qrack::QBdtHybrid, Qrack::QBdt, and Qrack::QUnitClifford.
|
inlinevirtual |
Apply a single bit transformation that only effects phase, with arbitrary control bits.
Reimplemented in Qrack::QUnit, Qrack::QTensorNetwork, Qrack::QStabilizerHybrid, Qrack::QStabilizer, Qrack::QBdt, and Qrack::QUnitClifford.
|
inlinevirtual |
Apply a single bit transformation that only effects phase, with arbitrary control bits.
Reimplemented from Qrack::QInterface.
Apply an arbitrary single bit unitary transformation.
Implements Qrack::QInterface.
Apply an arbitrary single bit unitary transformation.
Implemented in Qrack::QTensorNetwork, Qrack::QStabilizerHybrid, Qrack::QStabilizer, Qrack::QPager, Qrack::QBdt, Qrack::QUnitClifford, Qrack::QInterfaceNoisy, Qrack::QHybrid, Qrack::QBdtHybrid, Qrack::QUnit, and Qrack::QEngine.
|
virtual |
Statistical measure of masked permutation probability.
"qPowers" contains powers of 2^n, each representing QInterface bit "n." The order of these values defines a mask for the result bitCapInt, of 2^0 ~ qPowers[0U] to 2^(qPowerCount - 1) ~ qPowers[qPowerCount - 1], in contiguous ascending order. "shots" specifies the number of samples to take as if totally re-preparing the pre-measurement state. This method returns a dictionary with keys, which are the (masked-order) measurement results, and values, which are the number of "shots" that produced that particular measurement result. This method does not "collapse" the state of this QInterface. (The idea is to efficiently simulate a potentially statistically random sample of multiple re-preparations of the state right before measurement, and to collect random measurement resutls, without forcing the user to re-prepare or "clone" the state.)
Reimplemented from Qrack::QInterface.
|
virtual |
Statistical measure of masked permutation probability (returned as array)
Same Qrack::MultiShotMeasureMask()
, except the shots are returned as an array.
Reimplemented from Qrack::QInterface.
|
inlinevirtual |
Apply a single bit transformation that only effects phase.
Reimplemented in Qrack::QStabilizer, Qrack::QUnitClifford, Qrack::QUnit, Qrack::QPager, Qrack::QInterfaceNoisy, Qrack::QHybrid, Qrack::QEngineOCL, Qrack::QEngineCUDA, and Qrack::QBdtHybrid.
|
virtual |
Apply a single bit transformation that only effects phase.
Reimplemented from Qrack::QInterface.
Parity phase gate.
Applies e^(i*angle) phase factor to all combinations of bits with odd parity, based upon permutations of qubits.
Reimplemented in Qrack::QPager, Qrack::QHybrid, Qrack::QEngineOCL, Qrack::QEngineCUDA, Qrack::QEngineCPU, Qrack::QBdtHybrid, and Qrack::QInterfaceNoisy.
"PhaseRootN" gate
Applies a -2 * PI_R1 / (2^N) phase rotation to the qubit at "qubit."
Masked PhaseRootN gate.
Applies a -2 * PI_R1 / (2^N) phase rotation to each qubit in the mask.
Reimplemented in Qrack::QEngineOCL, Qrack::QEngineCUDA, and Qrack::QEngineCPU.
|
inlinevirtual |
S gate.
Applies a 1/4 phase rotation to the qubit at "qubit."
Reimplemented in Qrack::QUnit, Qrack::QUnitClifford, and Qrack::QStabilizer.
|
virtual |
|
inlinevirtual |
Y-basis transformation gate.
Converts from Pauli Z basis to Y, (via H then S gates).
|
inlinevirtual |
Square root of Hadamard gate.
Applies the square root of the Hadamard gate on qubit at "qubit."
|
inlinevirtual |
Square root of W gate.
Per 2019 Arute, Google's "quantum supremacy" experiment
|
inlinevirtual |
Square root of X gate.
Applies the square root of the Pauli "X" operator to the qubit at "qubit." The Pauli "X" operator is equivalent to a logical "NOT."
|
inlinevirtual |
Square root of Y gate.
Applies the square root of the Pauli "Y" operator to the qubit at "qubit." The Pauli "Y" operator is similar to a logical "NOT" with permutation phase effects.
|
inlinevirtual |
T gate.
Applies a 1/8 phase rotation to the qubit at "qubit."
|
virtual |
To define a Hamiltonian, give a vector of controlled single bit gates ("HamiltonianOp" instances) that are applied by left-multiplication in low-to-high vector index order on the state vector.
As a general point of linear algebra, where A and B are linear operators,
\begin{equation}e^{i (A + B) t} = e^{i A t} e^{i B t} \end{equation}
might NOT hold, if the operators A and B do not commute. As a rule of thumb, A will commute with B at least in the case that A and B act on entirely different sets of qubits. However, for defining the intended Hamiltonian, the programmer can be guaranteed that the exponential factors will be applied right-to-left, by left multiplication, in the order
\begin{equation} e^{-i H_{N - 1} t} e^{-i H_{N - 2} t} \ldots e^{-i H_0 t} \left|\psi \rangle\right. .\end{equation}
(For example, if A and B are single bit gates acting on the same bit, form their composition into one gate by the intended right-to-left fusion and apply them as a single HamiltonianOp.)
General unitary gate.
Applies a gate guaranteed to be unitary, from three angles, as commonly defined, spanning all possible single bit unitary gates, (up to a global phase factor which has no effect on Hermitian operator expectation values).
2-parameter unitary gate
Applies a gate guaranteed to be unitary, from two angles, as commonly defined.
|
virtual |
Apply a single bit transformation that reverses bit probability and might effect phase, with arbitrary control bits, with arbitrary control permutation.
Reimplemented from Qrack::QInterface.
|
inlinevirtual |
Apply a single bit transformation that reverses bit probability and might effect phase, with arbitrary control bits, with arbitrary control permutation.
Reimplemented in Qrack::QUnit.
|
virtual |
Apply an arbitrary single bit unitary transformation, with arbitrary control bits, with arbitary control permutation.
Reimplemented in Qrack::QUnit, and Qrack::QEngine.
|
virtual |
Apply an arbitrary single bit unitary transformation, with arbitrary control bits, with arbitary control permutation.
Reimplemented from Qrack::QInterface.
|
virtual |
Apply a single bit transformation that only effects phase, with arbitrary control bits, with arbitrary control permutation.
Reimplemented from Qrack::QInterface.
|
inlinevirtual |
Apply a single bit transformation that only effects phase, with arbitrary control bits, with arbitrary control permutation.
Reimplemented in Qrack::QUnit.
|
inlinevirtual |
Apply a "uniformly controlled" arbitrary single bit unitary transformation.
(See https://arxiv.org/abs/quant-ph/0312218)
A different unitary 2x2 complex matrix is associated with each permutation of the control bits. The first control bit index in the "controls" array is the least significant bit of the permutation, proceeding to the most significant bit. "mtrxs" is a flat (1-dimensional) array where each subsequent set of 4 components is an arbitrary 2x2 single bit gate associated with the next permutation of the control bits, starting from 0. All combinations of control bits apply one of the 4 component (flat 2x2) matrices. For k control bits, there are therefore 4 * 2^k complex components in "mtrxs," representing 2^k complex matrices of 2x2 components. (The component ordering in each matrix is the same as all other gates with an arbitrary 2x2 applied to a single bit, such as Qrack::ApplySingleBit.)
Reimplemented in Qrack::QStabilizerHybrid.
|
virtual |
Reimplemented in Qrack::QUnit, Qrack::QEngineOCL, Qrack::QEngineCUDA, and Qrack::QEngineCPU.
|
virtual |
Reimplemented from Qrack::QInterface.
|
inlinevirtual |
X gate.
Applies the Pauli "X" operator to the qubit at "qubit." The Pauli "X" operator is equivalent to a logical "NOT."
Reimplemented in Qrack::QEngineOCL, Qrack::QEngineCUDA, Qrack::QUnitClifford, Qrack::QStabilizer, Qrack::QUnit, Qrack::QStabilizerHybrid, Qrack::QEngine, Qrack::QBdtHybrid, and Qrack::QBdt.
|
virtual |
Masked X gate.
Applies the Pauli "X" operator to all qubits in the mask. A qubit index "n" is in the mask if (((1 << n) & mask)
0). The Pauli "X" operator is equivalent to a logical "NOT."
Reimplemented in Qrack::QStabilizerHybrid, Qrack::QPager, Qrack::QHybrid, Qrack::QEngineOCL, Qrack::QEngineCUDA, Qrack::QEngineCPU, Qrack::QBdtHybrid, and Qrack::QInterfaceNoisy.
|
inlinevirtual |
Y gate.
Applies the Pauli "Y" operator to the qubit at "qubit." The Pauli "Y" operator is similar to a logical "NOT" with permutation phase. effects.
Reimplemented in Qrack::QUnitClifford, and Qrack::QStabilizer.
|
virtual |
Masked Y gate.
Applies the Pauli "Y" operator to all qubits in the mask. A qubit index "n" is in the mask if (((1 << n) & mask)
0). The Pauli "Y" operator is similar to a logical "NOT" with permutation phase.
Reimplemented in Qrack::QStabilizerHybrid.
|
inlinevirtual |
Z gate.
Applies the Pauli "Z" operator to the qubit at "qubit." The Pauli "Z" operator reverses the phase of |1> and leaves |0> unchanged.
Reimplemented in Qrack::QEngineOCL, Qrack::QEngineCUDA, Qrack::QUnitClifford, and Qrack::QStabilizer.
|
virtual |
Masked Z gate.
Applies the Pauli "Z" operator to all qubits in the mask. A qubit index "n" is in the mask if (((1 << n) & mask)
0). The Pauli "Z" operator reverses the phase of |1> and leaves |0> unchanged.
Reimplemented in Qrack::QUnit, Qrack::QStabilizerHybrid, Qrack::QPager, and Qrack::QEngine.
|
inlinevirtual |
Masked Z gate.
Applies the Pauli "Z" operator to all qubits in the mask. A qubit index "n" is in the mask if (((1 << n) & mask)
0). The Pauli "Z" operator reverses the phase of |1> and leaves |0> unchanged.
Reimplemented from Qrack::QInterface.