# Partial traces [Tensor product structures]

Collaboration diagram for Partial traces:

Methods for tracing an operator (or state projector) over part of a tensor product structure. More...

## Functions

OperatorPTrace (const State &psi, Operator &rho, bool flagTraceOverMSB=false)
Does a simple partial trace of over as many dimensions as needed to fit the result in .
DenseMatrix< complexpartial_trace (const DenseMatrix< complex > &m, const TensorProductStructure &TPS, ISet &indices)
Creates and returns a new matrix which is the partial trace of m, over the indices indices in the tensor product structure TPS.
DenseMatrix< complexpartial_trace (const DenseVector< complex > &v, const TensorProductStructure &TPS, ISet &indices)
Creates and returns a new matrix which is the partial trace of the projector onto v, over the indices indices in the tensor product structure TPS.
DenseMatrix< complexpartial_trace_asymm (const DenseVector< complex > &ket, const DenseVector< complex > &bra, const TensorProductStructure &TPS, ISet &indices)
Creates and returns a new matrix which is the partial trace of the (non-Hermitian) outer product |ket><bra|, over the indices indices in the tensor product structure TPS.
StatePurify (const Operator &rho, State &psi)

## Detailed Description

Methods for tracing an operator (or state projector) over part of a tensor product structure.

## Function Documentation

 Operator& PTrace ( const State & psi, Operator & rho, bool flagTraceOverMSB )
 Does a simple partial trace of over as many dimensions as needed to fit the result in . must evenly divide . PTrace will trace out part of to fit the result in . The assumption is that we want to trace over the least significant indices of -- i.e., , but if flagTraceOverMSB is set, then we'll compute .

 State& Purify ( const Operator & rho, State & psi )
 must evenly divide . This function basically undoes a partial trace (nonuniquely!), by generating a pure state on a larger Hilbert space which, when partially traced over its least- significant bits (the ancilla), will yield the desired density matrix. This is not necessarily possible unless the ancilla is just as big as the system with the mixed state, but we try anyway. Eigenvalues of less than are ignored. All others get their eigenvectors correlated with one of a set of mutually orthogonal pure states on the ancilla. The whole superposition is returned in psi. If the ancilla is smaller than the original system but the Schmidt rank of is low, then purification will be successful. Otherwise we generate another warning message, and return a state that might do sort of well.

Generated on Wed Jun 14 22:25:40 2006 for linalg by  1.4.4