Qrack
9.0
General classical-emulating-quantum development framework
|
Functions | |
real1_f | Qrack::QEngineCPU::Prob (bitLenInt qubitIndex) |
PSEUDO-QUANTUM Direct measure of bit probability to be in |1> state. More... | |
real1_f | Qrack::QEngineCPU::CtrlOrAntiProb (bool controlState, bitLenInt control, bitLenInt target) |
PSEUDO-QUANTUM Direct measure of bit probability to be in |1> state, if control is in |0>/|1>, false/true, "controlState". More... | |
real1_f | Qrack::QEngineCPU::ProbReg (bitLenInt start, bitLenInt length, bitCapInt permutation) |
Direct measure of register permutation probability. More... | |
real1_f | Qrack::QEngineCPU::ProbMask (bitCapInt mask, bitCapInt permutation) |
Direct measure of masked permutation probability. More... | |
real1_f | Qrack::QEngineCPU::ProbParity (bitCapInt mask) |
Overall probability of any odd permutation of the masked set of bits. More... | |
bitCapInt | Qrack::QEngineCPU::MAll () |
Measure permutation state of all coherent bits. More... | |
bool | Qrack::QEngineCPU::ForceMParity (bitCapInt mask, bool result, bool doForce=true) |
Act as if is a measurement of parity of the masked set of qubits was applied, except force the (usually random) result. More... | |
void | Qrack::QEngineCPU::NormalizeState (real1_f nrm=REAL1_DEFAULT_ARG, real1_f norm_thresh=REAL1_DEFAULT_ARG, real1_f phaseArg=ZERO_R1_F) |
Apply the normalization factor found by UpdateRunningNorm() or on the fly by a single bit gate. More... | |
real1_f | Qrack::QEngineCPU::SumSqrDiff (QInterfacePtr toCompare) |
real1_f | Qrack::QEngineCPU::SumSqrDiff (QEngineCPUPtr toCompare) |
QInterfacePtr | Qrack::QEngineCPU::Clone () |
Clone this QInterface. More... | |
virtual real1_f | Qrack::QInterface::Prob (bitLenInt qubitIndex)=0 |
Direct measure of bit probability to be in |1> state. More... | |
virtual real1_f | Qrack::QInterface::CProb (bitLenInt control, bitLenInt target) |
Direct measure of bit probability to be in |1> state, if control bit is |1>. More... | |
virtual real1_f | Qrack::QInterface::ACProb (bitLenInt control, bitLenInt target) |
Direct measure of bit probability to be in |1> state, if control bit is |0>. More... | |
virtual real1_f | Qrack::QInterface::ProbAll (bitCapInt fullRegister) |
Direct measure of full permutation probability. More... | |
virtual real1_f | Qrack::QInterface::ProbReg (bitLenInt start, bitLenInt length, bitCapInt permutation) |
Direct measure of register permutation probability. More... | |
virtual real1_f | Qrack::QInterface::ProbMask (bitCapInt mask, bitCapInt permutation) |
Direct measure of masked permutation probability. More... | |
virtual void | Qrack::QInterface::ProbMaskAll (bitCapInt mask, real1 *probsArray) |
Direct measure of masked permutation probability. More... | |
virtual void | Qrack::QInterface::ProbBitsAll (const std::vector< bitLenInt > &bits, real1 *probsArray) |
Direct measure of listed permutation probability. More... | |
virtual real1_f | Qrack::QInterface::ExpectationBitsAll (const std::vector< bitLenInt > &bits, bitCapInt offset=0U) |
Get permutation expectation value of bits. More... | |
virtual real1_f | Qrack::QInterface::ExpectationBitsFactorized (const std::vector< bitLenInt > &bits, const std::vector< bitCapInt > &perms, bitCapInt offset=0U) |
Get expectation value of bits, given an array of qubit weights. More... | |
virtual real1_f | Qrack::QInterface::ExpectationBitsFactorizedRdm (bool roundRz, const std::vector< bitLenInt > &bits, const std::vector< bitCapInt > &perms, bitCapInt offset=0) |
Get (reduced density matrix) expectation value of bits, given an array of qubit weights. More... | |
virtual real1_f | Qrack::QInterface::ExpectationFloatsFactorized (const std::vector< bitLenInt > &bits, const std::vector< real1_f > &weights) |
Get expectation value of bits, given a (floating-point) array of qubit weights. More... | |
virtual real1_f | Qrack::QInterface::ExpectationFloatsFactorizedRdm (bool roundRz, const std::vector< bitLenInt > &bits, const std::vector< real1_f > &weights) |
Get (reduced density matrix) expectation value of bits, given a (floating-point) array of qubit weights. More... | |
virtual real1_f | Qrack::QInterface::ProbRdm (bitLenInt qubitIndex) |
Direct measure of bit probability to be in |1> state, treating all ancillary qubits as post-selected T gate gadgets. More... | |
virtual real1_f | Qrack::QInterface::ProbAllRdm (bool roundRz, bitCapInt fullRegister) |
Direct measure of full permutation probability, treating all ancillary qubits as post-selected T gate gadgets. More... | |
virtual real1_f | Qrack::QInterface::ProbMaskRdm (bool roundRz, bitCapInt mask, bitCapInt permutation) |
Direct measure of masked permutation probability, treating all ancillary qubits as post-selected T gate gadgets. More... | |
virtual real1_f | Qrack::QInterface::ExpectationBitsAllRdm (bool roundRz, const std::vector< bitLenInt > &bits, bitCapInt offset=0U) |
Get permutation expectation value of bits, treating all ancillary qubits as post-selected T gate gadgets. More... | |
virtual std::map< bitCapInt, int > | Qrack::QInterface::MultiShotMeasureMask (const std::vector< bitCapInt > &qPowers, unsigned shots) |
Statistical measure of masked permutation probability. More... | |
virtual void | Qrack::QInterface::MultiShotMeasureMask (const std::vector< bitCapInt > &qPowers, unsigned shots, unsigned long long *shotsArray) |
Statistical measure of masked permutation probability (returned as array) More... | |
virtual void | Qrack::QInterface::SetBit (bitLenInt qubit, bool value) |
Set individual bit to pure |0> (false) or |1> (true) state. More... | |
virtual bool | Qrack::QInterface::ApproxCompare (QInterfacePtr toCompare, real1_f error_tol=TRYDECOMPOSE_EPSILON) |
Compare state vectors approximately, component by component, to determine whether this state vector is the same as the target. More... | |
virtual real1_f | Qrack::QInterface::SumSqrDiff (QInterfacePtr toCompare)=0 |
virtual bool | Qrack::QInterface::TryDecompose (bitLenInt start, QInterfacePtr dest, real1_f error_tol=TRYDECOMPOSE_EPSILON) |
virtual void | Qrack::QInterface::UpdateRunningNorm (real1_f norm_thresh=REAL1_DEFAULT_ARG)=0 |
Force a calculation of the norm of the state vector, in order to make it unit length before the next probability or measurement operation. More... | |
virtual void | Qrack::QInterface::NormalizeState (real1_f nrm=REAL1_DEFAULT_ARG, real1_f norm_thresh=REAL1_DEFAULT_ARG, real1_f phaseArg=ZERO_R1_F)=0 |
Apply the normalization factor found by UpdateRunningNorm() or on the fly by a single bit gate. More... | |
virtual void | Qrack::QInterface::Finish () |
If asynchronous work is still running, block until it finishes. More... | |
virtual bool | Qrack::QInterface::isFinished () |
Returns "false" if asynchronous work is still running, and "true" if all previously dispatched asynchronous work is done. More... | |
virtual void | Qrack::QInterface::Dump () |
If asynchronous work is still running, let the simulator know that it can be aborted. More... | |
virtual bool | Qrack::QInterface::isBinaryDecisionTree () |
Returns "true" if current state representation is definitely a binary decision tree, "false" if it is definitely not, or "true" if it cannot be determined. More... | |
virtual bool | Qrack::QInterface::isClifford () |
Returns "true" if current state is identifiably within the Clifford set, or "false" if it is not or cannot be determined. More... | |
virtual bool | Qrack::QInterface::isClifford (bitLenInt qubit) |
Returns "true" if current qubit state is identifiably within the Clifford set, or "false" if it is not or cannot be determined. More... | |
virtual bool | Qrack::QInterface::isOpenCL () |
Returns "true" if current simulation is OpenCL-based. More... | |
virtual bool | Qrack::QInterface::TrySeparate (const std::vector< bitLenInt > &qubits, real1_f error_tol) |
Qrack::QUnit types maintain explicit separation of representations of qubits, which reduces memory usage and increases gate speed. More... | |
virtual bool | Qrack::QInterface::TrySeparate (bitLenInt qubit) |
Single-qubit TrySeparate() More... | |
virtual bool | Qrack::QInterface::TrySeparate (bitLenInt qubit1, bitLenInt qubit2) |
Two-qubit TrySeparate() More... | |
virtual double | Qrack::QInterface::GetUnitaryFidelity () |
When "Schmidt-decomposition rounding parameter" ("SDRP") is being used, starting from initial 1.0 fidelity, we compound the "unitary fidelity" by successive multiplication by one minus two times the true unitary probability discarded in each single rounding event. More... | |
virtual void | Qrack::QInterface::ResetUnitaryFidelity () |
Reset the internal fidelity calculation tracker to 1.0. More... | |
virtual void | Qrack::QInterface::SetSdrp (real1_f sdrp) |
Set the "Schmidt decomposition rounding parameter" value, (between 0 and 1) More... | |
virtual void | Qrack::QInterface::SetReactiveSeparate (bool isAggSep) |
Set reactive separation option (on by default if available) More... | |
virtual bool | Qrack::QInterface::GetReactiveSeparate () |
Get reactive separation option. More... | |
virtual void | Qrack::QInterface::SetTInjection (bool useGadget) |
Set the option to use T-injection gadgets (off by default) More... | |
virtual bool | Qrack::QInterface::GetTInjection () |
Get the option to use T-injection gadgets. More... | |
virtual QInterfacePtr | Qrack::QInterface::Clone ()=0 |
Clone this QInterface. More... | |
virtual void | Qrack::QInterface::SetDevice (int64_t dID)=0 |
Set the device index, if more than one device is available. More... | |
virtual int64_t | Qrack::QInterface::GetDevice () |
Get the device index. More... | |
bitCapIntOcl | Qrack::QInterface::GetMaxSize () |
Get maximum number of amplitudes that can be allocated on current device. More... | |
virtual real1_f | Qrack::QInterface::FirstNonzeroPhase () |
Get phase of lowest permutation nonzero amplitude. More... | |
virtual void | Qrack::QInterface::DepolarizingChannelWeak1Qb (bitLenInt qubit, real1_f lambda) |
Simulate a local qubit depolarizing noise channel, under a stochastic "weak simulation condition." Under "weak" condition, sampling and exact state queries are not accurate, but sampling can be achieved via repeated full execution of a noisy circuit, for each hardware-realistic measurement sample. More... | |
virtual bitLenInt | Qrack::QInterface::DepolarizingChannelStrong1Qb (bitLenInt qubit, real1_f lambda) |
Simulate a local qubit depolarizing noise channel, under a "strong simulation condition." "Strong" condition supports measurement sampling and direct queries of state, but the expression of state is in terms of one retained ancillary qubit per applied noise channel. More... | |
virtual real1_f | Qrack::QUnit::Prob (bitLenInt qubit) |
Direct measure of bit probability to be in |1> state. More... | |
virtual real1_f | Qrack::QUnit::ProbAll (bitCapInt perm) |
Direct measure of full permutation probability. More... | |
virtual real1_f | Qrack::QUnit::ProbAllRdm (bool roundRz, bitCapInt perm) |
Direct measure of full permutation probability, treating all ancillary qubits as post-selected T gate gadgets. More... | |
virtual real1_f | Qrack::QUnit::ProbParity (bitCapInt mask) |
Overall probability of any odd permutation of the masked set of bits. More... | |
virtual bool | Qrack::QUnit::ForceMParity (bitCapInt mask, bool result, bool doForce=true) |
Act as if is a measurement of parity of the masked set of qubits was applied, except force the (usually random) result. More... | |
virtual real1_f | Qrack::QUnit::SumSqrDiff (QInterfacePtr toCompare) |
virtual real1_f | Qrack::QUnit::SumSqrDiff (QUnitPtr toCompare) |
virtual real1_f | Qrack::QUnit::ExpectationBitsFactorized (const std::vector< bitLenInt > &bits, const std::vector< bitCapInt > &perms, bitCapInt offset=0U) |
Get expectation value of bits, given an array of qubit weights. More... | |
virtual real1_f | Qrack::QUnit::ExpectationBitsFactorizedRdm (bool roundRz, const std::vector< bitLenInt > &bits, const std::vector< bitCapInt > &perms, bitCapInt offset=0U) |
Get (reduced density matrix) expectation value of bits, given an array of qubit weights. More... | |
virtual void | Qrack::QUnit::UpdateRunningNorm (real1_f norm_thresh=REAL1_DEFAULT_ARG) |
Force a calculation of the norm of the state vector, in order to make it unit length before the next probability or measurement operation. More... | |
virtual void | Qrack::QUnit::NormalizeState (real1_f nrm=REAL1_DEFAULT_ARG, real1_f norm_thresh=REAL1_DEFAULT_ARG, real1_f phaseArg=ZERO_R1_F) |
Apply the normalization factor found by UpdateRunningNorm() or on the fly by a single bit gate. More... | |
virtual void | Qrack::QUnit::Finish () |
If asynchronous work is still running, block until it finishes. More... | |
virtual bool | Qrack::QUnit::isFinished () |
Returns "false" if asynchronous work is still running, and "true" if all previously dispatched asynchronous work is done. More... | |
virtual void | Qrack::QUnit::Dump () |
If asynchronous work is still running, let the simulator know that it can be aborted. More... | |
virtual bool | Qrack::QUnit::isClifford (bitLenInt qubit) |
Returns "true" if current qubit state is identifiably within the Clifford set, or "false" if it is not or cannot be determined. More... | |
virtual bool | Qrack::QUnit::TrySeparate (const std::vector< bitLenInt > &qubits, real1_f error_tol) |
Qrack::QUnit types maintain explicit separation of representations of qubits, which reduces memory usage and increases gate speed. More... | |
virtual bool | Qrack::QUnit::TrySeparate (bitLenInt qubit) |
Single-qubit TrySeparate() More... | |
virtual bool | Qrack::QUnit::TrySeparate (bitLenInt qubit1, bitLenInt qubit2) |
Two-qubit TrySeparate() More... | |
virtual double | Qrack::QUnit::GetUnitaryFidelity () |
When "Schmidt-decomposition rounding parameter" ("SDRP") is being used, starting from initial 1.0 fidelity, we compound the "unitary fidelity" by successive multiplication by one minus two times the true unitary probability discarded in each single rounding event. More... | |
virtual void | Qrack::QUnit::ResetUnitaryFidelity () |
Reset the internal fidelity calculation tracker to 1.0. More... | |
virtual void | Qrack::QUnit::SetSdrp (real1_f sdrp) |
Set the "Schmidt decomposition rounding parameter" value, (between 0 and 1) More... | |
virtual QInterfacePtr | Qrack::QUnit::Clone () |
Clone this QInterface. More... | |
Direct measure of bit probability to be in |1> state, if control bit is |0>.
Reimplemented in Qrack::QHybrid, Qrack::QEngine, and Qrack::QBdtHybrid.
|
inlinevirtual |
Compare state vectors approximately, component by component, to determine whether this state vector is the same as the target.
Reimplemented in Qrack::QUnitClifford, Qrack::QStabilizerHybrid, and Qrack::QStabilizer.
|
virtual |
Clone this QInterface.
Implements Qrack::QInterface.
|
virtual |
|
pure virtual |
Direct measure of bit probability to be in |1> state, if control bit is |1>.
Reimplemented in Qrack::QHybrid, Qrack::QEngine, and Qrack::QBdtHybrid.
|
virtual |
PSEUDO-QUANTUM Direct measure of bit probability to be in |1> state, if control is in |0>/|1>, false/true, "controlState".
Reimplemented from Qrack::QEngine.
|
virtual |
Simulate a local qubit depolarizing noise channel, under a "strong simulation condition." "Strong" condition supports measurement sampling and direct queries of state, but the expression of state is in terms of one retained ancillary qubit per applied noise channel.
condition, sampling and exact state queries are not accurate, but sampling can be achieved via repeated full execution of a noisy circuit, for each hardware-realistic measurement sample.
This method returns a newly-allocated qubit ancilla index which must be retained to maintain "strong" simulation. Note that "strong" ancilla can be measured at any time and discarded, but this makes the simulation condition "weak".
Simulate a local qubit depolarizing noise channel, under a stochastic "weak simulation condition." Under "weak" condition, sampling and exact state queries are not accurate, but sampling can be achieved via repeated full execution of a noisy circuit, for each hardware-realistic measurement sample.
|
inlinevirtual |
If asynchronous work is still running, let the simulator know that it can be aborted.
Note that this method is typically used internally where appropriate, such that user code typically does not call Dump().
Reimplemented in Qrack::QUnit, Qrack::QTensorNetwork, Qrack::QStabilizerHybrid, Qrack::QPager, Qrack::QHybrid, Qrack::QEngineCPU, and Qrack::QBdtHybrid.
|
inlinevirtual |
If asynchronous work is still running, let the simulator know that it can be aborted.
Note that this method is typically used internally where appropriate, such that user code typically does not call Dump().
Reimplemented from Qrack::QInterface.
|
inlinevirtual |
Get permutation expectation value of bits.
The permutation expectation value of all included bits is returned, with bits valued from low to high as the order of the "bits" array parameter argument.
Reimplemented in Qrack::QStabilizerHybrid, Qrack::QPager, Qrack::QHybrid, Qrack::QEngineOCL, Qrack::QEngineCUDA, and Qrack::QBdtHybrid.
|
inlinevirtual |
Get permutation expectation value of bits, treating all ancillary qubits as post-selected T gate gadgets.
The permutation expectation value of all included bits is returned, with bits valued from low to high as the order of the "bits" array parameter argument.
Reimplemented in Qrack::QStabilizerHybrid.
|
virtual |
Get expectation value of bits, given an array of qubit weights.
The weighter-per-qubit expectation value of is returned, with each "bits" entry corresponding to a "perms" weight entry.
Reimplemented in Qrack::QUnitClifford, Qrack::QUnit, Qrack::QStabilizerHybrid, and Qrack::QStabilizer.
|
inlinevirtual |
Get expectation value of bits, given an array of qubit weights.
The weighter-per-qubit expectation value of is returned, with each "bits" entry corresponding to a "perms" weight entry.
Reimplemented from Qrack::QInterface.
|
inlinevirtual |
Get (reduced density matrix) expectation value of bits, given an array of qubit weights.
The weighter-per-qubit expectation value of is returned, with each "bits" entry corresponding to a "perms" weight entry. If there are stabilizer ancillae, they are traced out of the reduced density matrix, giving an approximate result.
Reimplemented in Qrack::QUnit, and Qrack::QStabilizerHybrid.
|
inlinevirtual |
Get (reduced density matrix) expectation value of bits, given an array of qubit weights.
The weighter-per-qubit expectation value of is returned, with each "bits" entry corresponding to a "perms" weight entry. If there are stabilizer ancillae, they are traced out of the reduced density matrix, giving an approximate result.
Reimplemented from Qrack::QInterface.
|
virtual |
Get expectation value of bits, given a (floating-point) array of qubit weights.
The weighter-per-qubit expectation value of is returned, with each "bits" entry corresponding to a "weights" entry.
Reimplemented in Qrack::QUnitClifford, Qrack::QStabilizerHybrid, and Qrack::QStabilizer.
|
inlinevirtual |
Get (reduced density matrix) expectation value of bits, given a (floating-point) array of qubit weights.
The weighter-per-qubit expectation value of is returned, with each "bits" entry corresponding to a "weights" entry. If there are stabilizer ancillae, they are traced out of the reduced density matrix, giving an approximate result.
Reimplemented in Qrack::QStabilizerHybrid.
|
inlinevirtual |
If asynchronous work is still running, block until it finishes.
Note that this is never necessary to get correct, timely return values. QEngines and other layers will always internally "Finish" when necessary for correct return values. This is primarily for debugging and benchmarking.
Reimplemented in Qrack::QUnit, Qrack::QTensorNetwork, Qrack::QStabilizerHybrid, Qrack::QPager, Qrack::QHybrid, Qrack::QEngineOCL, Qrack::QEngineCUDA, Qrack::QEngineCPU, and Qrack::QBdtHybrid.
|
virtual |
If asynchronous work is still running, block until it finishes.
Note that this is never necessary to get correct, timely return values. QEngines and other layers will always internally "Finish" when necessary for correct return values. This is primarily for debugging and benchmarking.
Reimplemented from Qrack::QInterface.
|
inlinevirtual |
Get phase of lowest permutation nonzero amplitude.
Reimplemented in Qrack::QPager, Qrack::QEngineOCL, Qrack::QEngineCUDA, and Qrack::QEngineCPU.
|
virtual |
Act as if is a measurement of parity of the masked set of qubits was applied, except force the (usually random) result.
Implements Qrack::QParity.
|
virtual |
Act as if is a measurement of parity of the masked set of qubits was applied, except force the (usually random) result.
Implements Qrack::QParity.
|
inlinevirtual |
Get the device index.
("-1" is default).
Reimplemented in Qrack::QUnit, Qrack::QPager, Qrack::QHybrid, Qrack::QEngineOCL, Qrack::QEngineCUDA, Qrack::QEngine, and Qrack::QBdtHybrid.
|
inline |
Get maximum number of amplitudes that can be allocated on current device.
|
inlinevirtual |
Get reactive separation option.
If reactive separation is available, as in Qrack::QUnit, then turning this option on attempts to more-aggresively recover separability of subsystems. It can either hurt or help performance, though it commonly helps.
Reimplemented in Qrack::QUnit.
|
inlinevirtual |
Get the option to use T-injection gadgets.
If T-injection gadgets are available, as in Qrack::QStabilizerHybrid, then turning this option on attempts to simulate Clifford+T with polynomial resource gadgets. It can either hurt or help performance, though it commonly helps.
Reimplemented in Qrack::QStabilizerHybrid, and Qrack::QPager.
|
inlinevirtual |
When "Schmidt-decomposition rounding parameter" ("SDRP") is being used, starting from initial 1.0 fidelity, we compound the "unitary fidelity" by successive multiplication by one minus two times the true unitary probability discarded in each single rounding event.
Then, an overall square-root is applied to the final fidelity estimate. This is a useful metric on fidelity that requires no heavy calculational overhead to compute, and it tends to be usually only slightly pessimistic compared to random circuit sampling fidelity calculated via the inner product. This calculation is automatically reset to 1.0 by SetPermutation() or MAll() or can be manually reset by "QInterface::ResetUnitaryFidelity()".
Reimplemented in Qrack::QUnit, and Qrack::QTensorNetwork.
|
inlinevirtual |
When "Schmidt-decomposition rounding parameter" ("SDRP") is being used, starting from initial 1.0 fidelity, we compound the "unitary fidelity" by successive multiplication by one minus two times the true unitary probability discarded in each single rounding event.
Then, an overall square-root is applied to the final fidelity estimate. This is a useful metric on fidelity that requires no heavy calculational overhead to compute, and it tends to be usually only slightly pessimistic compared to random circuit sampling fidelity calculated via the inner product. This calculation is automatically reset to 1.0 by SetPermutation() or MAll() or can be manually reset by "QInterface::ResetUnitaryFidelity()".
Reimplemented from Qrack::QInterface.
|
inlinevirtual |
Returns "true" if current state representation is definitely a binary decision tree, "false" if it is definitely not, or "true" if it cannot be determined.
Reimplemented in Qrack::QStabilizerHybrid, Qrack::QBdtHybrid, and Qrack::QBdt.
|
inlinevirtual |
Returns "true" if current state is identifiably within the Clifford set, or "false" if it is not or cannot be determined.
Reimplemented in Qrack::QUnit, Qrack::QUnitClifford, Qrack::QUnit, Qrack::QStabilizerHybrid, and Qrack::QStabilizer.
|
inlinevirtual |
Returns "true" if current qubit state is identifiably within the Clifford set, or "false" if it is not or cannot be determined.
Reimplemented in Qrack::QUnitClifford, Qrack::QUnit, Qrack::QStabilizerHybrid, and Qrack::QStabilizer.
|
inlinevirtual |
Returns "true" if current qubit state is identifiably within the Clifford set, or "false" if it is not or cannot be determined.
Reimplemented from Qrack::QInterface.
|
inlinevirtual |
Returns "false" if asynchronous work is still running, and "true" if all previously dispatched asynchronous work is done.
Reimplemented in Qrack::QUnit, Qrack::QTensorNetwork, Qrack::QStabilizerHybrid, Qrack::QPager, Qrack::QHybrid, Qrack::QEngineOCL, Qrack::QEngineCUDA, Qrack::QEngineCPU, and Qrack::QBdtHybrid.
|
virtual |
Returns "false" if asynchronous work is still running, and "true" if all previously dispatched asynchronous work is done.
Reimplemented from Qrack::QInterface.
|
inlinevirtual |
Returns "true" if current simulation is OpenCL-based.
Reimplemented in Qrack::QPager, Qrack::QHybrid, Qrack::QEngineOCL, and Qrack::QEngineCUDA.
|
virtual |
Measure permutation state of all coherent bits.
Reimplemented from Qrack::QInterface.
|
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 in Qrack::QUnitClifford, Qrack::QUnit, Qrack::QTensorNetwork, Qrack::QStabilizerHybrid, and Qrack::QEngine.
|
virtual |
Statistical measure of masked permutation probability (returned as array)
Same Qrack::MultiShotMeasureMask()
, except the shots are returned as an array.
Reimplemented in Qrack::QUnitClifford, Qrack::QUnit, Qrack::QTensorNetwork, Qrack::QStabilizerHybrid, and Qrack::QEngine.
|
virtual |
Apply the normalization factor found by UpdateRunningNorm() or on the fly by a single bit gate.
(On an actual quantum computer, the state should never require manual normalization.)
Implements Qrack::QInterface.
|
virtual |
Apply the normalization factor found by UpdateRunningNorm() or on the fly by a single bit gate.
(On an actual quantum computer, the state should never require manual normalization.)
Implements Qrack::QInterface.
|
pure virtual |
Apply the normalization factor found by UpdateRunningNorm() or on the fly by a single bit gate.
(On an actual quantum computer, the state should never require manual normalization.)
Implemented in Qrack::QUnitClifford, Qrack::QUnit, Qrack::QTensorNetwork, Qrack::QStabilizerHybrid, Qrack::QStabilizer, Qrack::QPager, Qrack::QHybrid, Qrack::QEngineOCL, Qrack::QEngineCUDA, Qrack::QEngineCPU, Qrack::QBdtHybrid, and Qrack::QBdt.
Direct measure of bit probability to be in |1> state.
Implements Qrack::QInterface.
PSEUDO-QUANTUM Direct measure of bit probability to be in |1> state.
Implements Qrack::QInterface.
Direct measure of bit probability to be in |1> state.
Implemented in Qrack::QPager, Qrack::QHybrid, Qrack::QEngineCPU, Qrack::QBdtHybrid, Qrack::QBdt, Qrack::QUnitClifford, Qrack::QUnit, Qrack::QTensorNetwork, Qrack::QStabilizerHybrid, Qrack::QStabilizer, Qrack::QEngineOCL, and Qrack::QEngineCUDA.
Direct measure of full permutation probability.
Reimplemented in Qrack::QUnit, Qrack::QStabilizerHybrid, Qrack::QPager, Qrack::QTensorNetwork, Qrack::QHybrid, Qrack::QEngine, Qrack::QBdtHybrid, and Qrack::QBdt.
Direct measure of full permutation probability.
Reimplemented from Qrack::QInterface.
|
inlinevirtual |
Direct measure of full permutation probability, treating all ancillary qubits as post-selected T gate gadgets.
Reimplemented in Qrack::QUnit, and Qrack::QStabilizerHybrid.
Direct measure of full permutation probability, treating all ancillary qubits as post-selected T gate gadgets.
Reimplemented from Qrack::QInterface.
|
virtual |
Direct measure of listed permutation probability.
The probabilities of all included permutations of bits, with bits valued from low to high as the order of the "bits" array parameter argument, are returned in the "probsArray" parameter.
Direct measure of masked permutation probability.
Returns probability of permutation of the mask.
"mask" masks the bits to check the probability of. "permutation" sets the 0 or 1 value for each bit in the mask. Bits which are set in the mask can be set to 0 or 1 in the permutation, while reset bits in the mask should be 0 in the permutation.
Implements Qrack::QEngine.
Direct measure of masked permutation probability.
Returns probability of permutation of the mask.
"mask" masks the bits to check the probability of. "permutation" sets the 0 or 1 value for each bit in the mask. Bits which are set in the mask can be set to 0 or 1 in the permutation, while reset bits in the mask should be 0 in the permutation.
Reimplemented in Qrack::QEngine, Qrack::QUnitClifford, Qrack::QStabilizerHybrid, Qrack::QStabilizer, Qrack::QPager, Qrack::QHybrid, Qrack::QEngineOCL, Qrack::QEngineCUDA, Qrack::QEngineCPU, and Qrack::QBdtHybrid.
Direct measure of masked permutation probability.
"mask" masks the bits to check the probability of. The probabilities of all permutations of the masked bits, from left/low to right/high are returned in the "probsArray" argument.
Reimplemented in Qrack::QEngineOCL, and Qrack::QEngineCUDA.
|
inlinevirtual |
Direct measure of masked permutation probability, treating all ancillary qubits as post-selected T gate gadgets.
"mask" masks the bits to check the probability of. "permutation" sets the 0 or 1 value for each bit in the mask. Bits which are set in the mask can be set to 0 or 1 in the permutation, while reset bits in the mask should be 0 in the permutation.
Reimplemented in Qrack::QStabilizerHybrid.
Overall probability of any odd permutation of the masked set of bits.
Implements Qrack::QParity.
Overall probability of any odd permutation of the masked set of bits.
Implements Qrack::QParity.
Direct measure of bit probability to be in |1> state, treating all ancillary qubits as post-selected T gate gadgets.
Reimplemented in Qrack::QUnit, and Qrack::QStabilizerHybrid.
|
virtual |
Direct measure of register permutation probability.
Returns probability of permutation of the register.
Implements Qrack::QEngine.
|
virtual |
Direct measure of register permutation probability.
Returns probability of permutation of the register.
Reimplemented in Qrack::QEngine, Qrack::QPager, Qrack::QHybrid, Qrack::QEngineOCL, Qrack::QEngineCUDA, Qrack::QEngineCPU, and Qrack::QBdtHybrid.
|
inlinevirtual |
Reset the internal fidelity calculation tracker to 1.0.
Reimplemented in Qrack::QUnit.
|
inlinevirtual |
Reset the internal fidelity calculation tracker to 1.0.
Reimplemented from Qrack::QInterface.
|
inlinevirtual |
Set individual bit to pure |0> (false) or |1> (true) state.
To set a bit, the bit is first measured. If the result of measurement matches "value," the bit is considered set. If the result of measurement is the opposite of "value," an X gate is applied to the bit. The state ends up entirely in the "value" state, with a random phase factor.
|
pure virtual |
Set the device index, if more than one device is available.
Implemented in Qrack::QUnitClifford, Qrack::QUnit, Qrack::QTensorNetwork, Qrack::QStabilizerHybrid, Qrack::QStabilizer, Qrack::QPager, Qrack::QHybrid, Qrack::QEngineOCL, Qrack::QEngineCUDA, Qrack::QEngineCPU, Qrack::QEngine, Qrack::QBdtHybrid, and Qrack::QBdt.
|
inlinevirtual |
Set reactive separation option (on by default if available)
If reactive separation is available, as in Qrack::QUnit, then turning this option on attempts to more-aggresively recover separability of subsystems. It can either hurt or help performance, though it commonly helps.
Reimplemented in Qrack::QUnit.
|
inlinevirtual |
Set the "Schmidt decomposition rounding parameter" value, (between 0 and 1)
Reimplemented in Qrack::QUnit.
|
inlinevirtual |
Set the "Schmidt decomposition rounding parameter" value, (between 0 and 1)
Reimplemented from Qrack::QInterface.
|
inlinevirtual |
Set the option to use T-injection gadgets (off by default)
If T-injection gadgets are available, as in Qrack::QStabilizerHybrid, then turning this option on attempts to simulate Clifford+T with polynomial resource gadgets. It can either hurt or help performance, though it commonly helps.
Reimplemented in Qrack::QUnit, Qrack::QStabilizerHybrid, and Qrack::QPager.
real1_f Qrack::QEngineCPU::SumSqrDiff | ( | QEngineCPUPtr | toCompare | ) |
|
inlinevirtual |
Implements Qrack::QInterface.
|
inlinevirtual |
Implements Qrack::QInterface.
|
pure virtual |
|
virtual |
Reimplemented in Qrack::QHybrid, and Qrack::QBdtHybrid.
|
inlinevirtual |
Single-qubit TrySeparate()
Reimplemented in Qrack::QUnitClifford, Qrack::QUnit, Qrack::QStabilizerHybrid, and Qrack::QStabilizer.
|
virtual |
Single-qubit TrySeparate()
Reimplemented from Qrack::QInterface.
Two-qubit TrySeparate()
Reimplemented in Qrack::QUnitClifford, Qrack::QUnit, Qrack::QStabilizerHybrid, and Qrack::QStabilizer.
Two-qubit TrySeparate()
Reimplemented from Qrack::QInterface.
|
inlinevirtual |
Qrack::QUnit types maintain explicit separation of representations of qubits, which reduces memory usage and increases gate speed.
This method is used to manually attempt internal separation of a QUnit subsytem. We attempt a Decompose() operation, on a state which might not be separable. If the state is not separable, we abort and return false. Otherwise, we complete the operation, add the separated subsystem back in place into the QUnit "shards," and return true.
This should never change the logical/physical state of the QInterface, only possibly its internal representation, for simulation optimization purposes. This is not a truly quantum computational operation, but it also does not lead to nonphysical effects.
Reimplemented in Qrack::QUnitClifford, Qrack::QStabilizer, Qrack::QUnit, and Qrack::QStabilizerHybrid.
|
virtual |
Qrack::QUnit types maintain explicit separation of representations of qubits, which reduces memory usage and increases gate speed.
This method is used to manually attempt internal separation of a QUnit subsytem. We attempt a Decompose() operation, on a state which might not be separable. If the state is not separable, we abort and return false. Otherwise, we complete the operation, add the separated subsystem back in place into the QUnit "shards," and return true.
This should never change the logical/physical state of the QInterface, only possibly its internal representation, for simulation optimization purposes. This is not a truly quantum computational operation, but it also does not lead to nonphysical effects.
Reimplemented from Qrack::QInterface.
|
virtual |
Force a calculation of the norm of the state vector, in order to make it unit length before the next probability or measurement operation.
(On an actual quantum computer, the state should never require manual normalization.)
Implements Qrack::QInterface.
|
pure virtual |
Force a calculation of the norm of the state vector, in order to make it unit length before the next probability or measurement operation.
(On an actual quantum computer, the state should never require manual normalization.)
Implemented in Qrack::QUnitClifford, Qrack::QUnit, Qrack::QTensorNetwork, Qrack::QStabilizerHybrid, Qrack::QStabilizer, Qrack::QPager, Qrack::QHybrid, Qrack::QEngineOCL, Qrack::QEngineCUDA, Qrack::QEngineCPU, Qrack::QBdtHybrid, and Qrack::QBdt.