Collaboration diagram for Objects with a TPS:
![]() |
Classes | |
class | TensorProductStructure |
Defines a tensor product structure on a finite dimensional Hilbert space. More... | |
class | TensorProductIndex |
Defines an index for iterating over a tensor product structure. More... | |
class | ProductState |
A tensor product state vector. More... | |
class | SinglyBranchingState |
A sum of product states that can be distinguished perfectly by measuring one (special) subsystem. More... | |
class | ProductOperator |
A tensor product of operators (complex matrices). More... | |
class | ProductOperatorSum |
A sum of TensorProductOperator operators. More... | |
Functions | |
std::ostream & | operator<< (std::ostream &os, const TensorProductStructure &TPS) |
Prints a TensorProductStructure to a stream, as a list "{a,b,...,z}". | |
std::ostream & | operator<< (std::ostream &os, const TensorProductIndex &TPI) |
Prints a TensorProductIndex to a stream, as a list "{a,b,...,z}". | |
void | SimplifySubsystemDivision (TensorProductStructure &Universe, ISet &Subsystem) |
Specialized function to collapse a TensorProductStructure for partial iteration. | |
complex | c_dot (ProductState &star, ProductState &nostar, int index=(-1)) |
Computes the conjugate dot product between two ProductStates, or between two of their subsystem states if the optional index parameter is provided. |
|
Specialized function to collapse a TensorProductStructure for partial iteration. One main application of tensor product iteration is partial tracing, where only a subset of the indices are summed over, and the rest are kept fixed. Typically the object iterated over has no particular structure (e.g. sparse), so there is no logical significance to the particular structure of the index. The only aspect of the multi-index that matters is whether a particular index should be summed over, or not. Since doing multi-index iteration is slower (more bookkeeping) than flat index iteration, a useful optimization step is to collapse adjacent indices that should be iterated over into one. E.g., if the TensorProductStructure is {2x2x2x2}, and the last two indices are iterated over, then it is faster to iterate over a {2x2x4} structure. In the extreme case of full tracing, all indices could be collapsed to one. |