|
Maestro 0.2.11
Unified interface for quantum circuit simulation
|
#include <Tensor.h>
Public Member Functions | |
| Tensor () | |
| Tensor (const std::vector< int > &dims, bool dummy=false) | |
| Tensor (const std::vector< size_t > &dims, bool dummy=false) | |
| Tensor (const Tensor< T, Storage > &other) | |
| template<class indT = size_t> | |
| Tensor (std::initializer_list< indT > dims, bool dummy=false) | |
| Tensor (Tensor< T, Storage > &&other) noexcept | |
| virtual | ~Tensor ()=default |
| const T | at (const std::vector< size_t > &indices) const |
| T | atOffset (size_t offset) |
| void | Clear () |
| void | ClearValues () |
| void | Conj () |
| Tensor< T, Storage > | Contract (const Tensor< T, Storage > &other, const std::vector< std::pair< size_t, size_t > > &indices, bool allowMultithreading=true) const |
| Tensor< T, Storage > | Contract (const Tensor< T, Storage > &other, size_t ind1, size_t ind2, bool allowMultithreading=true) const |
| bool | Empty () const |
| size_t | GetDim (size_t index) const |
| const std::vector< size_t > & | GetDims () const |
| size_t | GetOffset (const std::vector< size_t > &indices) const |
| const size_t | GetRank () const |
| size_t | GetSize () const |
| Storage & | GetValues () |
| const Storage & | GetValues () const |
| bool | IncrementIndex (std::vector< size_t > &indices) const |
| bool | IncrementIndexSkip (std::vector< size_t > &indices, const std::vector< int > &skipv) const |
| bool | IncrementIndexSkip (std::vector< size_t > &indices, int skip) const |
| std::vector< size_t > | IndexFromOffset (size_t offset) const |
| bool | IsDummy () const |
| T & | operator() (const std::vector< size_t > &indices) |
| const T & | operator() (const std::vector< size_t > &indices) const |
| template<class indT = size_t> | |
| T & | operator() (std::initializer_list< indT > args) |
| template<class indT = size_t> | |
| const T & | operator() (std::initializer_list< indT > args) const |
| Tensor< T, Storage > | operator* (const T &scalar) const |
| Tensor< T, Storage > | operator* (const Tensor< T, Storage > &other) const |
| Tensor< T, Storage > & | operator*= (const double scalar) |
| Tensor< T, Storage > & | operator*= (const T &scalar) |
| Tensor< T, Storage > & | operator*= (const Tensor< T, Storage > &other) |
| Tensor< T, Storage > | operator+ (const T &scalar) const |
| Tensor< T, Storage > | operator+ (const Tensor< T, Storage > &other) const |
| Tensor< T, Storage > & | operator+= (const double scalar) |
| Tensor< T, Storage > & | operator+= (const T &scalar) |
| Tensor< T, Storage > & | operator+= (const Tensor< T, Storage > &other) |
| Tensor< T, Storage > | operator- () const |
| Tensor< T, Storage > | operator- (const T &scalar) const |
| Tensor< T, Storage > | operator- (const Tensor< T, Storage > &other) const |
| Tensor< T, Storage > & | operator-= (const double scalar) |
| Tensor< T, Storage > & | operator-= (const T &scalar) |
| Tensor< T, Storage > & | operator-= (const Tensor< T, Storage > &other) |
| Tensor< T, Storage > | operator/ (const T &scalar) const |
| Tensor< T, Storage > | operator/ (const Tensor< T, Storage > &other) const |
| Tensor< T, Storage > & | operator/= (const double scalar) |
| Tensor< T, Storage > & | operator/= (const T &scalar) |
| Tensor< T, Storage > & | operator/= (const Tensor< T, Storage > &other) |
| Tensor< T, Storage > & | operator= (const Tensor< T, Storage > &other) |
| Tensor< T, Storage > & | operator= (Tensor< T, Storage > &&other) noexcept |
| T & | operator[] (const std::vector< size_t > &indices) |
| const T & | operator[] (const std::vector< size_t > &indices) const |
| T & | operator[] (size_t offset) |
| const T & | operator[] (size_t offset) const |
| template<class indT = size_t> | |
| T & | operator[] (std::initializer_list< indT > args) |
| template<class indT = size_t> | |
| const T & | operator[] (std::initializer_list< indT > args) const |
| Tensor< T, Storage > | Reshape (const std::vector< size_t > &newdims) const |
| template<class indT = size_t> | |
| Tensor< T, Storage > | Reshape (std::initializer_list< indT > args) const |
| void | Resize (const std::vector< size_t > &newdims) |
| template<class indT = size_t> | |
| void | Resize (std::initializer_list< indT > newdims) |
| template<class Archive> | |
| void | serialize (Archive &ar, const unsigned int) |
| Tensor< T, Storage > | Shuffle (const std::vector< size_t > &indices) const |
| template<class indT = size_t> | |
| Tensor< T, Storage > | Shuffle (std::initializer_list< indT > args) const |
| void | Swap (Tensor< T, Storage > &other) |
| Tensor< T, Storage > | TensorProduct (const Tensor< T, Storage > &other) const |
| T | Trace () const |
| Tensor< T, Storage > | Trace (const std::vector< size_t > &tindices) const |
| Tensor< T, Storage > | Trace (size_t ind1, size_t ind2) const |
| template<class indT = size_t> | |
| Tensor< T, Storage > | Trace (std::initializer_list< indT > args) const |
Static Protected Member Functions | |
| static int | GetNumberOfThreads () |
Protected Attributes | |
| std::vector< size_t > | dims |
| size_t | sz |
| Storage | values |
Static Protected Attributes | |
| static constexpr int | divSchedule = 2 |
| static constexpr size_t | OmpLimit = 1024 |
Friends | |
| class | boost::serialization::access |
|
inline |
Definition at line 56 of file Tensor.h.
References sz.
Referenced by Tensor(), Tensor(), Contract(), Contract(), operator*(), operator*(), operator*=(), operator*=(), operator*=(), operator+(), operator+(), operator+=(), operator+=(), operator+=(), operator-(), operator-(), operator-(), operator-=(), operator-=(), operator-=(), operator/(), operator/(), operator/=(), operator/=(), operator/=(), operator=(), operator=(), Reshape(), Reshape(), Shuffle(), Shuffle(), Swap(), TensorProduct(), Trace(), Trace(), and Trace().
|
inline |
|
inline |
|
inline |
|
inline |
|
inlinenoexcept |
|
virtualdefault |
|
inline |
Definition at line 247 of file Tensor.h.
References dims, GetOffset(), and values.
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
Definition at line 612 of file Tensor.h.
References Tensor(), dims, GetNumberOfThreads(), GetOffset(), GetSize(), IncrementIndex(), IndexFromOffset(), IsDummy(), OmpLimit, sz, and values.
|
inline |
Definition at line 519 of file Tensor.h.
References Tensor(), dims, GetNumberOfThreads(), GetOffset(), GetSize(), IndexFromOffset(), IsDummy(), OmpLimit, sz, and values.
|
inline |
|
inline |
|
inline |
|
inlinestaticprotected |
Definition at line 49 of file Tensor.h.
Referenced by Contract(), and Contract().
|
inline |
Definition at line 924 of file Tensor.h.
Referenced by at(), Contract(), Contract(), operator()(), operator()(), operator()(), operator()(), operator[](), operator[](), operator[](), operator[](), Trace(), Trace(), and Trace().
|
inline |
|
inline |
Definition at line 132 of file Tensor.h.
Referenced by Tensor(), Tensor(), Tensor(), Conj(), Contract(), Contract(), operator*(), operator*(), operator*=(), operator*=(), operator*=(), operator+(), operator+(), operator+=(), operator+=(), operator+=(), operator-(), operator-(), operator-(), operator-=(), operator-=(), operator-=(), operator/(), operator/(), operator/=(), operator/=(), operator/=(), Reshape(), Resize(), Resize(), Shuffle(), TensorProduct(), Trace(), and Trace().
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
Definition at line 928 of file Tensor.h.
Referenced by Contract(), Contract(), Shuffle(), Trace(), and Trace().
|
inline |
Definition at line 150 of file Tensor.h.
References values.
Referenced by Contract(), Contract(), and TensorProduct().
|
inline |
Definition at line 295 of file Tensor.h.
References dims, GetOffset(), and values.
|
inline |
Definition at line 301 of file Tensor.h.
References GetOffset(), and values.
|
inline |
Definition at line 306 of file Tensor.h.
References dims, GetOffset(), and values.
|
inline |
Definition at line 315 of file Tensor.h.
References dims, GetOffset(), and values.
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inlinenoexcept |
|
inline |
Definition at line 253 of file Tensor.h.
References dims, GetOffset(), and values.
|
inline |
Definition at line 259 of file Tensor.h.
References GetOffset(), and values.
|
inline |
|
inline |
|
inline |
Definition at line 278 of file Tensor.h.
References dims, GetOffset(), and values.
|
inline |
Definition at line 287 of file Tensor.h.
References dims, GetOffset(), and values.
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
Definition at line 804 of file Tensor.h.
References Tensor(), dims, GetOffset(), GetSize(), IndexFromOffset(), and values.
|
inline |
Definition at line 759 of file Tensor.h.
References Tensor(), dims, GetOffset(), GetSize(), IndexFromOffset(), and values.
|
inline |
|
friend |
Definition at line 54 of file Tensor.h.
References boost::serialization::access.
Referenced by boost::serialization::access.
|
protected |
Definition at line 43 of file Tensor.h.
Referenced by Tensor(), Tensor(), Tensor(), Tensor(), Tensor(), at(), Clear(), Contract(), Contract(), Empty(), GetDim(), GetDims(), GetRank(), GetSize(), IncrementIndex(), IncrementIndexSkip(), IncrementIndexSkip(), operator()(), operator()(), operator()(), operator*(), operator*(), operator*=(), operator+(), operator+(), operator+=(), operator-(), operator-(), operator-(), operator-=(), operator/(), operator/(), operator/=(), operator=(), operator[](), operator[](), operator[](), Resize(), Resize(), serialize(), Shuffle(), Swap(), TensorProduct(), Trace(), Trace(), and Trace().
|
staticconstexprprotected |
|
staticconstexprprotected |
Definition at line 46 of file Tensor.h.
Referenced by Contract(), and Contract().
|
mutableprotected |
Definition at line 44 of file Tensor.h.
Referenced by Tensor(), Tensor(), Tensor(), Tensor(), Tensor(), Tensor(), ClearValues(), Contract(), Contract(), GetSize(), operator=(), Resize(), Resize(), serialize(), and Swap().
|
protected |
Definition at line 42 of file Tensor.h.
Referenced by Tensor(), Tensor(), Tensor(), Tensor(), Tensor(), at(), atOffset(), ClearValues(), Conj(), Contract(), Contract(), GetValues(), GetValues(), IsDummy(), operator()(), operator()(), operator()(), operator()(), operator*(), operator*(), operator*=(), operator*=(), operator*=(), operator+(), operator+(), operator+=(), operator+=(), operator+=(), operator-(), operator-(), operator-(), operator-=(), operator-=(), operator-=(), operator/(), operator/(), operator/=(), operator/=(), operator/=(), operator=(), operator[](), operator[](), operator[](), operator[](), operator[](), operator[](), Reshape(), Resize(), Resize(), serialize(), Shuffle(), Swap(), TensorProduct(), Trace(), Trace(), and Trace().