Qrack  1.7
General classical-emulating-quantum development framework
Functions
Utility functions

Functions

virtual complexQrack::QEngineCPU::GetStateVector ()
 
virtual void Qrack::QEngineCPU::CopyState (QInterfacePtr orig)
 Direct copy of raw state vector to produce a clone. More...
 
virtual real1 Qrack::QEngineCPU::Prob (bitLenInt qubitIndex)
 PSEUDO-QUANTUM Direct measure of bit probability to be in |1> state. More...
 
virtual real1 Qrack::QEngineCPU::ProbAll (bitCapInt fullRegister)
 PSEUDO-QUANTUM Direct measure of full register probability to be in permutation state. More...
 
virtual real1 Qrack::QEngineCPU::GetNorm (bool update=true)
 
virtual void Qrack::QEngineCPU::SetNorm (real1 n)
 
virtual void Qrack::QEngineCPU::NormalizeState (real1 nrm=-999.0)
 
virtual void Qrack::QInterface::CopyState (QInterfacePtr orig)=0
 Direct copy of raw state vector to produce a clone. More...
 
virtual real1 Qrack::QInterface::Prob (bitLenInt qubitIndex)=0
 Direct measure of bit probability to be in |1> state. More...
 
virtual real1 Qrack::QInterface::ProbAll (bitCapInt fullRegister)=0
 Direct measure of full register probability to be in permutation state. More...
 
virtual void Qrack::QInterface::SetBit (bitLenInt qubitIndex1, bool value)
 Set individual bit to pure |0> (false) or |1> (true) state. More...
 
virtual bool Qrack::QInterface::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...
 
virtual void Qrack::QUnit::CopyState (QUnitPtr orig)
 
virtual void Qrack::QUnit::CopyState (QInterfacePtr orig)
 Direct copy of raw state vector to produce a clone. More...
 
virtual real1 Qrack::QUnit::Prob (bitLenInt qubit)
 Direct measure of bit probability to be in |1> state. More...
 
virtual real1 Qrack::QUnit::ProbAll (bitCapInt fullRegister)
 Direct measure of full register probability to be in permutation state. More...
 
virtual void Qrack::QUnit::SetBit (bitLenInt qubit1, bool value)
 Set individual bit to pure |0> (false) or |1> (true) state. More...
 

Detailed Description

Function Documentation

void Qrack::QEngineCPU::CopyState ( QInterfacePtr  orig)
virtual

Direct copy of raw state vector to produce a clone.

Warning
PSEUDO-QUANTUM

Implements Qrack::QInterface.

void Qrack::QUnit::CopyState ( QUnitPtr  orig)
virtual
void Qrack::QUnit::CopyState ( QInterfacePtr  orig)
virtual

Direct copy of raw state vector to produce a clone.

Warning
PSEUDO-QUANTUM

Implements Qrack::QInterface.

virtual void Qrack::QInterface::CopyState ( QInterfacePtr  orig)
pure virtual

Direct copy of raw state vector to produce a clone.

Warning
PSEUDO-QUANTUM

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

bool Qrack::QInterface::ForceM ( bitLenInt  qubit,
bool  result,
bool  doForce = true,
real1  nrmlzr = 1.0 
)
virtual

Act as though a measurement was applied, except force the result of the measurement.

Measurement gate.

That is, genuine measurement of a qubit in superposition has a probabilistic result. This method allows the programmer to choose the outcome of the measurement, and proceed as if the measurement randomly resulted in the chosen bit value.

Warning
PSEUDO-QUANTUM

PSEUDO-QUANTUM - Acts like a measurement gate, except with a specified forced result.

virtual real1 Qrack::QEngineCPU::GetNorm ( bool  update = true)
inlinevirtual
complex * Qrack::QEngineCPU::GetStateVector ( )
virtual
void Qrack::QEngineCPU::NormalizeState ( real1  nrm = -999.0)
virtual

Implements Qrack::QInterface.

real1 Qrack::QEngineCPU::Prob ( bitLenInt  qubitIndex)
virtual

PSEUDO-QUANTUM Direct measure of bit probability to be in |1> state.

Implements Qrack::QInterface.

real1 Qrack::QUnit::Prob ( bitLenInt  qubitIndex)
virtual

Direct measure of bit probability to be in |1> state.

Warning
PSEUDO-QUANTUM

Implements Qrack::QInterface.

virtual real1 Qrack::QInterface::Prob ( bitLenInt  qubitIndex)
pure virtual

Direct measure of bit probability to be in |1> state.

Warning
PSEUDO-QUANTUM

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

real1 Qrack::QEngineCPU::ProbAll ( bitCapInt  fullRegister)
virtual

PSEUDO-QUANTUM Direct measure of full register probability to be in permutation state.

Implements Qrack::QInterface.

real1 Qrack::QUnit::ProbAll ( bitCapInt  fullRegister)
virtual

Direct measure of full register probability to be in permutation state.

Warning
PSEUDO-QUANTUM

Implements Qrack::QInterface.

virtual real1 Qrack::QInterface::ProbAll ( bitCapInt  fullRegister)
pure virtual

Direct measure of full register probability to be in permutation state.

Warning
PSEUDO-QUANTUM

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

void Qrack::QUnit::SetBit ( bitLenInt  qubitIndex1,
bool  value 
)
virtual

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.

Reimplemented from Qrack::QInterface.

void Qrack::QInterface::SetBit ( bitLenInt  qubitIndex1,
bool  value 
)
virtual

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.

Reimplemented in Qrack::QUnit.

virtual void Qrack::QEngineCPU::SetNorm ( real1  n)
inlinevirtual