Collaboration diagram for Functions and operations:
Functions  
template<class T>  
DenseMatrix< T >  Commutator (const DenseMatrix< T > &m1, const DenseMatrix< T > &m2) 
Creates a new DenseMatrix containing the commutator of two DenseMatrices: .  
template<class T>  
DenseMatrix< T >  AntiCommutator (const DenseMatrix< T > &m1, const DenseMatrix< T > &m2) 
Creates a new DenseMatrix containing the anticommutator of two DenseMatrices: .  
template<class T>  
DenseMatrix< T > &  scavenge (DenseMatrix< T > &m, typename linalg_traits< T >::abs_type minabs) 
Sets all the entries of m whose absolute value falls below minabs to zero, and returns a reference to the result.  
template<class T>  
DenseVector< T > &  scavenge (DenseVector< T > &v, typename linalg_traits< T >::abs_type minabs) 
Sets all the entries of v whose absolute value falls below minabs to zero, and returns a reference to the result.  
template<class T>  
DenseMatrix< T >  scavenge (const DenseMatrix< T > &m, typename linalg_traits< T >::abs_type minabs) 
Creates a new DenseMatrix which is a scavenged copy of m , and returns it.  
template<class T>  
DenseVector< T >  scavenge (const DenseVector< T > &v, typename linalg_traits< T >::abs_type minabs) 
Creates a new DenseVector which is a scavenged copy of m , and returns it.  
double  Entropy (Operator &rho) 
Computes the Von Neumann entropy of the positive semidefinite matrix rho .  
double  LinearEntropy (Operator &rho) 
Computes the linear entropy of the positive semidefinite matrix rho .  
Operator &  RandomMixedState (Operator &Rho, itype Nancillae) 
Assigns to Rho a random mixed state from the induced measure on 1+Nancillae copies.  
Operator &  HaarRandomize (Operator &Rho) 
Assigns to Rho a random pure state. Equivalent to RandomMixedState() with Nancillae =0.  
Operator &  HilbertSchmidtRandomize (Operator &Rho) 
Assigns to Rho a positive semidefinite matrix selected from HilbertSchmidt measure. Equivalent to RandomMixedState() with Nancillae =1.  
double  TraceNorm (Operator &M) 
Computes the sum of the absolute values of the eigenvalues of a Hermitian matrix M.  
double  InfinityNorm (Operator &M) 
Computes the square root of the largest eigenvalue of . If is Hermitian, then this is the maximum of the absolute values of 's eigenvalues.  
double  Fidelity (Operator &Sigma, Operator &Rho) 
Computes the fidelity between two states as .  
double  Fidelity (Operator &Sigma, State &Psi) 
Computes the fidelity between a mixed state and a pure state : .  
double  Fidelity (State &Psi, Operator &Rho) 
Computes the fidelity between a pure state and a mixed state a mixed state : .  
double  Fidelity (State &Psi, State &Phi) 
Computes the fidelity between two pure states and : .  
double  NullspaceProjection (Operator &Sigma, Operator &Rho, double MinProbability=DBL_EPSILON) 
Computes the projection of onto the nullspace of .  
double  RelativeEntropy (Operator &Sigma, Operator &Rho, double MinProbability=DBL_EPSILON) 
Computes the relative entropy, or KullbackLeibler divergence, of relative to : .  
void  RelativeEntropyAndNullProjection (double &RelEnt, double &NullProj, Operator &Sigma, Operator &Rho, double MinProbability) 
Computes the relative entropy of relative to and the projection of onto 's null space.  
Operator &  Positivize (Operator &M) 
Converts M to a positivedefinite matrix by replacing all its negative eigenvalues with 0.  
Operator &  SquareRoot (Operator &M) 
Replaces the Hermitian positivedefinite matrix M with its unique positivedefinite square root.  
template<class Op>  
double  Entanglement (const State &psi, const TensorProductStructure &Universe, ISet &SubSystem, Op EntropyFunction) 
Computes the bipartite entanglement of psi between SubSystem and its complement, using the usersupplied EntropyFunction .  
double  Entanglement (const State &psi, const TensorProductStructure &Universe, ISet &Subsystem) 
Computes the bipartite entanglement of psi between SubSystem and its complement, using Von Neumann entropy. 

Sets all the entries of
For complexvalued matrices, 

Sets all the entries of
For complexvalued vectors, 

Computes the Von Neumann entropy of the positive semidefinite matrix The Von Neumann entropy is computed by diagonalizing the density matrix, and computing the sum of over all eigenvalues $x_i$. We assume Hermiticity, but we do verify that:


Assigns to Rho a random mixed state from the induced measure on 1+Nancillae copies.
There is no unique measure from which to choose a random mixed state. One appealing class of measures is the set of induced measures obtained by partialtracing a random pure state (according to Haar measure) on a larger system. This function generates such a state for a Warning: be cautious in setting Nancillae too high; generating the state could take huge amounts of memory, increasing exponentially with Nancillae. 

Computes the fidelity between two states as . Both arguments must be positivedefinite, or the routine will complain to std::cerr and return 0. This routine is rather computationally intensive, so if one of the two states is known to be pure, use the faster routine for that case. 

Computes the projection of onto the nullspace of .
This can be interpreted as the maximum of the probability that an event for which predicts zero probability is selected from an ensemble represented by . Any eigenvalue of less than MinProbability will be considered effectively zero for the purposes of computing the null space. MinProbability can therefore be any real number, although the default value is 

Computes the relative entropy, or KullbackLeibler divergence, of relative to : .
If has zero or negative eigenvalues (which may occur due to rounding error), then the relative entropy will probably be infinite. In order to avoid this, all eigenvalues of less than MinProbability will be rounded up to MinProbability. This parameter should always be a positive number; by default it is 

Computes the relative entropy of relative to and the projection of onto 's null space. The results are stored in RelEnt and NullProj, respectively. The parameter MinProbability divides the eigenvalues of into:


Replaces the Hermitian positivedefinite matrix M with its unique positivedefinite square root. NOTE: if the argument turns out not to be positivedefinite, then the result is nonunique, nonHermitian, and will be constructed by setting . Hermiticity is a precondition; nonHermitian inputs will lead to undefined results including possible failure. 

Computes the bipartite entanglement of
The entropy function should be a function pointer or class such that for a density matrix 