|
mptensor v0.6.0
Parallel Library for Tensor Network Methods
|
Operations that change the shape of a tensor. More...
Operations that change the shape of a tensor.
| Tensor< MatrixType > mptensor::extend | ( | const Tensor< MatrixType > & | T, |
| const Shape & | shape_new | ||
| ) |
Extend the size of a tensor.
| [in] | T | Tensor to be extended. |
| [in] | shape_new | New shape. |
| Tensor< MatrixType > mptensor::reshape | ( | const Tensor< MatrixType > & | T, |
| const Shape & | shape_new | ||
| ) |
Change the shape of tensor.
| [in] | T | Tensor to be reshaped. |
| [in] | shape_new | New shape. |
| Tensor< MatrixType > mptensor::slice | ( | const Tensor< MatrixType > & | T, |
| const Index & | index_begin, | ||
| const Index & | index_end | ||
| ) |
Slice a tensor.
This function mimics slicing in python such as [start:end]. If index_begin[r]==index_end[r], this rank is not sliced. For example,
will return T[1:4, :, 3:6].
| [in] | T | Tensor to be sliced. |
| [in] | index_begin | Start of indices. |
| [in] | index_end | End of indices. |
| Tensor< MatrixType > mptensor::slice | ( | const Tensor< MatrixType > & | T, |
| std::ptrdiff_t | n_axes, | ||
| std::ptrdiff_t | i_begin, | ||
| std::ptrdiff_t | i_end | ||
| ) |
Slice a tensor.
This function mimics slicing in python such as [start:end].
| [in] | T | Tensor to be sliced. |
| [in] | n_axes | Axes to be sliced. |
| [in] | i_begin | Start of index. |
| [in] | i_end | End of index. |
| Tensor< MatrixType > mptensor::transpose | ( | const Tensor< MatrixType > & | T, |
| const Axes & | axes, | ||
| size_t | urank_new | ||
| ) |
Transposition of tensor without lazy evaluation.
When axes=[1,2,0], \( T_{ijk} \) is transformed into \( T_{jki} \).
| [in] | T | Tensor to be transposed. |
| [in] | axes | Order of axes. |
| [in] | urank_new | Upper rank of new tensor. |
|
inline |
Transposition of tensor with lazy evaluation.
When axes=[1,2,0], \( T_{ijk} \) is transformed into \( T_{jki} \).
| [in] | T | Tensor to be transposed. |
| [in] | axes | Order of axes |