ECF 1.5
Public Member Functions | Public Attributes | List of all members
quantum::DensityList Class Reference

Public Member Functions

void applyOp (int space)
 
void applyOp (int startSpace, int endSpace)
 
void applyOp (int space1, int space2, Basis &op)
 
void applyOp (int space1, int space2, int space3, Basis &op)
 
void applyOp (int space, algebra::mat &U)
 
void applyOp (algebra::mat &U, int transitSpace)
 
void applyConditionalOp (int condSpace, int cond, int space, algebra::mat &U)
 
void swap (int space1, int space2)
 
void measureAndSave (int measureSpace, int saveSpace)
 
void measure (int measureSpace)
 
double SafeLog (double x)
 
double ShannonEntropy ()
 
double entropy ()
 
double calculatePr (int measureSpace, int state)
 
double calculatePr (int space1, int state1, int space2, int state2)
 
double calculatePr (const std::vector< int > &spaceList, const std::vector< int > &stateList)
 
void splitAndSave (double p1, double p2, int space)
 
void computeDensityMat (algebra::mat &output)
 
void computeDensityMat (std::vector< Basis > &basis, algebra::mat &output)
 
void computeDensityMatFast (algebra::mat &output)
 
void trace (int space, DensityList &output)
 
void trace (int space)
 
double trace ()
 
void project (int space, int state, DensityList &output)
 
void project (int space, int state)
 
void CNOT (int controlSpace, int targetSpace)
 
void NOT (int space)
 
void applyHadamard (int space)
 
void applyRotation (int space, double rotation)
 
void applySU2 (int space, double p, double theta, double psi)
 
void applyHadamard (int target, int control)
 
void applyNOT (int target, int control)
 
void applyPiOver8 (int target, int control)
 
void applySU2 (int target, int control, double p, double theta, double psi)
 
void conditionalSet (std::vector< int > &targetSpace, std::vector< int > &targetVal, std::vector< int > &condSpace, std::vector< int > &condVal)
 
void print (std::ostream &f)
 

Public Attributes

std::vector< int > dimension
 
std::list< KetBradensity
 

Detailed Description

Definition at line 103 of file Quantum.h.

Member Function Documentation

◆ applyConditionalOp()

void quantum::DensityList::applyConditionalOp ( int  condSpace,
int  cond,
int  space,
algebra::mat U 
)

Definition at line 439 of file Quantum.cpp.

◆ applyHadamard() [1/2]

void quantum::DensityList::applyHadamard ( int  space)

Definition at line 680 of file Quantum.cpp.

◆ applyHadamard() [2/2]

void quantum::DensityList::applyHadamard ( int  target,
int  control 
)

Definition at line 722 of file Quantum.cpp.

◆ applyNOT()

void quantum::DensityList::applyNOT ( int  target,
int  control 
)

Definition at line 772 of file Quantum.cpp.

◆ applyOp() [1/6]

void quantum::DensityList::applyOp ( algebra::mat U,
int  transitSpace 
)

Definition at line 571 of file Quantum.cpp.

◆ applyOp() [2/6]

void quantum::DensityList::applyOp ( int  space)

Definition at line 113 of file Quantum.cpp.

◆ applyOp() [3/6]

void quantum::DensityList::applyOp ( int  space,
algebra::mat U 
)

Definition at line 504 of file Quantum.cpp.

◆ applyOp() [4/6]

void quantum::DensityList::applyOp ( int  space1,
int  space2,
Basis op 
)

Definition at line 281 of file Quantum.cpp.

◆ applyOp() [5/6]

void quantum::DensityList::applyOp ( int  space1,
int  space2,
int  space3,
Basis op 
)

Definition at line 353 of file Quantum.cpp.

◆ applyOp() [6/6]

void quantum::DensityList::applyOp ( int  startSpace,
int  endSpace 
)

Definition at line 174 of file Quantum.cpp.

◆ applyPiOver8()

void quantum::DensityList::applyPiOver8 ( int  target,
int  control 
)

Definition at line 736 of file Quantum.cpp.

◆ applyRotation()

void quantum::DensityList::applyRotation ( int  space,
double  rotation 
)

Definition at line 691 of file Quantum.cpp.

◆ applySU2() [1/2]

void quantum::DensityList::applySU2 ( int  space,
double  p,
double  theta,
double  psi 
)

Definition at line 703 of file Quantum.cpp.

◆ applySU2() [2/2]

void quantum::DensityList::applySU2 ( int  target,
int  control,
double  p,
double  theta,
double  psi 
)

Definition at line 751 of file Quantum.cpp.

◆ calculatePr() [1/3]

double quantum::DensityList::calculatePr ( const std::vector< int > &  spaceList,
const std::vector< int > &  stateList 
)

Definition at line 1009 of file Quantum.cpp.

◆ calculatePr() [2/3]

double quantum::DensityList::calculatePr ( int  measureSpace,
int  state 
)

Definition at line 907 of file Quantum.cpp.

◆ calculatePr() [3/3]

double quantum::DensityList::calculatePr ( int  space1,
int  state1,
int  space2,
int  state2 
)

Definition at line 964 of file Quantum.cpp.

◆ CNOT()

void quantum::DensityList::CNOT ( int  controlSpace,
int  targetSpace 
)

Definition at line 783 of file Quantum.cpp.

◆ computeDensityMat()

void quantum::DensityList::computeDensityMat ( algebra::mat output)

Definition at line 1122 of file Quantum.cpp.

◆ computeDensityMatFast()

void quantum::DensityList::computeDensityMatFast ( algebra::mat output)

for(int i=0; i<dimension[basisIndex]; ++i) { for(int j=0; j<dimension[basisIndex]; ++j) { Complex k = basis[basis.size()-1].B[Iter->ket[basisIndex]][i]; // 0 used to be basis index Complex b = conj(basis[basis.size()-1].B[Iter->bra[basisIndex]][j]); Complex c = algebra::ComplexHelper::mult(k, b); k = algebra::ComplexHelper::mult(Iter->p, c); output(startRow+i, startCol+j) += k; } }

Definition at line 1062 of file Quantum.cpp.

◆ conditionalSet()

void quantum::DensityList::conditionalSet ( std::vector< int > &  targetSpace,
std::vector< int > &  targetVal,
std::vector< int > &  condSpace,
std::vector< int > &  condVal 
)

Definition at line 143 of file Quantum.cpp.

◆ entropy()

double quantum::DensityList::entropy ( )

Definition at line 846 of file Quantum.cpp.

◆ measure()

void quantum::DensityList::measure ( int  measureSpace)

Definition at line 889 of file Quantum.cpp.

◆ measureAndSave()

void quantum::DensityList::measureAndSave ( int  measureSpace,
int  saveSpace 
)

Definition at line 869 of file Quantum.cpp.

◆ NOT()

void quantum::DensityList::NOT ( int  space)

Definition at line 799 of file Quantum.cpp.

◆ print()

void quantum::DensityList::print ( std::ostream &  f)
inline

Definition at line 166 of file Quantum.h.

◆ project() [1/2]

void quantum::DensityList::project ( int  space,
int  state 
)

Definition at line 663 of file Quantum.cpp.

◆ project() [2/2]

void quantum::DensityList::project ( int  space,
int  state,
DensityList output 
)

Definition at line 647 of file Quantum.cpp.

◆ SafeLog()

double quantum::DensityList::SafeLog ( double  x)
inline

Definition at line 123 of file Quantum.h.

◆ ShannonEntropy()

double quantum::DensityList::ShannonEntropy ( )

Definition at line 853 of file Quantum.cpp.

◆ splitAndSave()

void quantum::DensityList::splitAndSave ( double  p1,
double  p2,
int  space 
)

Definition at line 811 of file Quantum.cpp.

◆ swap()

void quantum::DensityList::swap ( int  space1,
int  space2 
)

Definition at line 830 of file Quantum.cpp.

◆ trace() [1/3]

double quantum::DensityList::trace ( )

Definition at line 951 of file Quantum.cpp.

◆ trace() [2/3]

void quantum::DensityList::trace ( int  space)

Definition at line 261 of file Quantum.cpp.

◆ trace() [3/3]

void quantum::DensityList::trace ( int  space,
DensityList output 
)

Definition at line 243 of file Quantum.cpp.

Member Data Documentation

◆ density

std::list<KetBra> quantum::DensityList::density

Definition at line 183 of file Quantum.h.

◆ dimension

std::vector<int> quantum::DensityList::dimension

Definition at line 182 of file Quantum.h.


The documentation for this class was generated from the following files: