|
mptensor v0.4.0
Parallel Library for Tensor Network Methods
|
| template<template< typename > class Matrix, typename C > | |
| Tensor< Matrix, C > | mptensor::transpose (Tensor< Matrix, C > T, const Axes &axes) |
| Transposition of tensor with lazy evaluation. | |
| template<template< typename > class Matrix, typename C > | |
| Tensor< Matrix, C > | mptensor::transpose (const Tensor< Matrix, C > &T, const Axes &axes, size_t urank_new) |
| Transposition of tensor without lazy evaluation. | |
| template<template< typename > class Matrix, typename C > | |
| Tensor< Matrix, C > | mptensor::reshape (const Tensor< Matrix, C > &T, const Shape &shape_new) |
| Change the shape of tensor. | |
| template<template< typename > class Matrix, typename C > | |
| Tensor< Matrix, C > | mptensor::slice (const Tensor< Matrix, C > &T, size_t n_axes, size_t i_begin, size_t i_end) |
| Slice a tensor. | |
| template<template< typename > class Matrix, typename C > | |
| Tensor< Matrix, C > | mptensor::slice (const Tensor< Matrix, C > &T, const Index &index_begin, const Index &index_end) |
| Slice a tensor. | |
| template<template< typename > class Matrix, typename C > | |
| Tensor< Matrix, C > | mptensor::extend (const Tensor< Matrix, C > &T, const Shape &shape_new) |
| Extend the size of a tensor. | |
Operations in order to change the shape of a tensor
Extend the size of a tensor.
| [in] | T | Tensor to be extended. |
| [in] | shape_new | New shape. |
Change the shape of tensor.
| [in] | T | Tensor to be reshaped. |
| [in] | shape_new | New shape. |
| Tensor< Matrix, C > mptensor::slice | ( | const Tensor< Matrix, C > & | 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< Matrix, C > mptensor::slice | ( | const Tensor< Matrix, C > & | T, |
| size_t | n_axes, | ||
| size_t | i_begin, | ||
| size_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< Matrix, C > mptensor::transpose | ( | const Tensor< Matrix, C > & | 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. |