|
Cytnx v0.9.6
|
Helper function to print vector with ODT: More...
Namespaces | |
| namespace | algo |
| Some basic algorithms API. | |
| namespace | linalg |
| linear algebra related functions. | |
| namespace | operators |
| namespace | physics |
| namespace | random |
| The randomization related functions. | |
| namespace | stat |
| namespace | tn_algo |
Classes | |
| class | Accessor |
| object that mimic the python slice to access elements in C++ [this is for c++ API only]. More... | |
| class | Bond |
| the object contains auxiliary properties for each Tensor rank (bond) More... | |
| class | LinOp |
| class | Network |
| class | Qs |
| class | Symmetry |
| the symmetry object More... | |
| class | Tensor |
| an tensor (multi-dimensional array) More... | |
| class | UniTensor |
| An Enhanced tensor specifically designed for physical Tensor network simulation. More... | |
Typedefs | |
| template<class T > | |
| using | vec3d = std::vector< std::vector< std::vector< T > > > |
| template<class T > | |
| using | vec2d = std::vector< std::vector< T > > |
| typedef double | cytnx_double |
| typedef float | cytnx_float |
| typedef uint64_t | cytnx_uint64 |
| typedef uint32_t | cytnx_uint32 |
| typedef uint16_t | cytnx_uint16 |
| typedef int64_t | cytnx_int64 |
| typedef int32_t | cytnx_int32 |
| typedef int16_t | cytnx_int16 |
| typedef size_t | cytnx_size_t |
| typedef std::complex< float > | cytnx_complex64 |
| typedef std::complex< double > | cytnx_complex128 |
| typedef bool | cytnx_bool |
Enumerations | |
| enum | bondType : int { BD_KET = -1 , BD_BRA = 1 , BD_REG = 0 , BD_NONE = 0 , BD_IN = -1 , BD_OUT = 1 } |
| bond type More... | |
Functions | |
| Tensor | zeros (const cytnx_uint64 &Nelem, const unsigned int &dtype=Type.Double, const int &device=Device.cpu) |
| create an rank-1 Tensor with all the elements are initialized with zero. | |
| Tensor | zeros (const std::vector< cytnx_uint64 > &Nelem, const unsigned int &dtype=Type.Double, const int &device=Device.cpu) |
| create an Tensor with all the elements are initialized with zero. | |
| Tensor | identity (const cytnx_uint64 &Dim, const unsigned int &dtype=Type.Double, const int &device=Device.cpu) |
| create an square rank-2 Tensor with all diagonal to be one. | |
| Tensor | eye (const cytnx_uint64 &Dim, const unsigned int &dtype=Type.Double, const int &device=Device.cpu) |
| create an square rank-2 Tensor with all diagonal to be one. | |
| Tensor | ones (const cytnx_uint64 &Nelem, const unsigned int &dtype=Type.Double, const int &device=Device.cpu) |
| create an rank-1 Tensor with all the elements are initialized with one. | |
| Tensor | ones (const std::vector< cytnx_uint64 > &Nelem, const unsigned int &dtype=Type.Double, const int &device=Device.cpu) |
| create an Tensor with all the elements are initialized with one. | |
| Tensor | arange (const cytnx_int64 &Nelem) |
| create an rank-1 Tensor with incremental unsigned integer elements start with [0,Nelem) | |
| Tensor | arange (const cytnx_double &start, const cytnx_double &end, const cytnx_double &step=1, const unsigned int &dtype=Type.Double, const int &device=Device.cpu) |
| create an rank-1 Tensor with elements defined in range [start,end) with assigned step-size | |
| Tensor | linspace (const cytnx_double &start, const cytnx_double &end, const cytnx_uint64 &Nelem, const bool &endpoint=true, const unsigned int &dtype=Type.Double, const int &device=Device.cpu) |
| int | set_mkl_ilp64 () |
| int | get_mkl_code () |
| cytnx::UniTensor | operator+ (const cytnx::UniTensor &Lt, const cytnx::UniTensor &Rt) |
| The addtion operator between two UniTensor. | |
| template<class T > | |
| cytnx::UniTensor | operator+ (const T &lc, const cytnx::UniTensor &Rt) |
| The addtion operator between a template type and a UniTensor. | |
| template<class T > | |
| cytnx::UniTensor | operator+ (const cytnx::UniTensor &Lt, const T &rc) |
| The addtion operator between a UniTensor and a template type. | |
| cytnx::UniTensor | operator- (const cytnx::UniTensor &Lt, const cytnx::UniTensor &Rt) |
| The subtraction operator between two UniTensor. | |
| template<class T > | |
| cytnx::UniTensor | operator- (const T &lc, const cytnx::UniTensor &Rt) |
| The subtraction operator between a template type and a UniTensor. | |
| template<class T > | |
| cytnx::UniTensor | operator- (const cytnx::UniTensor &Lt, const T &rc) |
| The subtraction operator between a UniTensor and a template type. | |
| cytnx::UniTensor | operator* (const cytnx::UniTensor &Lt, const cytnx::UniTensor &Rt) |
| The multiplication operator between two UniTensor. | |
| template<class T > | |
| cytnx::UniTensor | operator* (const T &lc, const cytnx::UniTensor &Rt) |
| The multiplication operator between a template type and a UniTensor. | |
| template<class T > | |
| cytnx::UniTensor | operator* (const cytnx::UniTensor &Lt, const T &rc) |
| The multiplication operator between a UniTensor and a template type. | |
| cytnx::UniTensor | operator/ (const cytnx::UniTensor &Lt, const cytnx::UniTensor &Rt) |
| The division operator between two UniTensor. | |
| template<class T > | |
| cytnx::UniTensor | operator/ (const T &lc, const cytnx::UniTensor &Rt) |
| The division operator between a template type and a UniTensor. | |
| template<class T > | |
| cytnx::UniTensor | operator/ (const cytnx::UniTensor &Lt, const T &rc) |
| The division operator between a UniTensor and a template type. | |
| cytnx::UniTensor | operator% (const cytnx::UniTensor &Lt, const cytnx::UniTensor &Rt) |
| The modulo operator between two UniTensor. | |
| template<class T > | |
| cytnx::UniTensor | operator% (const T &lc, const cytnx::UniTensor &Rt) |
| The modulo operator between a template type and a UniTensor. | |
| template<class T > | |
| cytnx::UniTensor | operator% (const cytnx::UniTensor &Lt, const T &rc) |
| The modulo operator between a UniTensor and a template type. | |
| Tensor | operator+ (const Tensor &Lt, const Tensor &Rt) |
| The addition operator for Tensor. | |
| template<class T > | |
| Tensor | operator+ (const T &lc, const Tensor &Rt) |
| The addition operator between a template type and Tensor. | |
| template<class T > | |
| Tensor | operator+ (const Tensor &Lt, const T &rc) |
| The addition operator between Tensor and a template type. | |
| Tensor | operator- (const Tensor &Lt, const Tensor &Rt) |
| The subtraction operator for Tensor. | |
| template<class T > | |
| Tensor | operator- (const T &lc, const Tensor &Rt) |
| The subtraction operator between a template type and Tensor. | |
| template<class T > | |
| Tensor | operator- (const Tensor &Lt, const T &rc) |
| The subtraction operator between Tensor and a template type. | |
| Tensor | operator* (const Tensor &Lt, const Tensor &Rt) |
| The multiplication operator for Tensor. | |
| template<class T > | |
| Tensor | operator* (const T &lc, const Tensor &Rt) |
| The multiplication operator between a template type and Tensor. | |
| template<class T > | |
| Tensor | operator* (const Tensor &Lt, const T &rc) |
| The multiplication operator between Tensor and a template type. | |
| Tensor | operator/ (const Tensor &Lt, const Tensor &Rt) |
| The division operator for Tensor. | |
| template<class T > | |
| Tensor | operator/ (const T &lc, const Tensor &Rt) |
| The division operator between a template type and Tensor. | |
| template<class T > | |
| Tensor | operator/ (const Tensor &Lt, const T &rc) |
| The division operator between Tensor and a template type. | |
| Tensor | operator% (const Tensor &Lt, const Tensor &Rt) |
| The mode operator for Tensor. | |
| template<class T > | |
| Tensor | operator% (const T &lc, const Tensor &Rt) |
| The mode operator between a template type and Tensor. | |
| template<class T > | |
| Tensor | operator% (const Tensor &Lt, const T &rc) |
| The mode operator between Tensor and a template type. | |
| Tensor | operator== (const Tensor &Lt, const Tensor &Rt) |
| The comparison operator for Tensor. | |
| template<class T > | |
| Tensor | operator== (const T &lc, const Tensor &Rt) |
| The comparison operator between a template type and Tensor. | |
| template<class T > | |
| Tensor | operator== (const Tensor &Lt, const T &rc) |
| The comparison operator between Tensor and a template type. | |
| UniTensor | ncon (const std::vector< UniTensor > &tensor_list_in, const std::vector< std::vector< cytnx_int64 > > &connect_list_in, const bool check_network=false, const bool optimize=false, std::vector< cytnx_int64 > cont_order=std::vector< cytnx_int64 >(), const std::vector< std::string > &out_labels=std::vector< std::string >()) |
| Tensor | operator+ (const Tensor &lhs, const Tensor::Tproxy &rhs) |
| Tensor | operator- (const Tensor &lhs, const Tensor::Tproxy &rhs) |
| Tensor | operator* (const Tensor &lhs, const Tensor::Tproxy &rhs) |
| Tensor | operator/ (const Tensor &lhs, const Tensor::Tproxy &rhs) |
| Tensor | operator+ (const Tensor &lhs, const Scalar::Sproxy &rhs) |
| Tensor | operator- (const Tensor &lhs, const Scalar::Sproxy &rhs) |
| Tensor | operator* (const Tensor &lhs, const Scalar::Sproxy &rhs) |
| Tensor | operator/ (const Tensor &lhs, const Scalar::Sproxy &rhs) |
| UniTensor | Contract (const UniTensor &inL, const UniTensor &inR, const bool &cacheL=false, const bool &cacheR=false) |
| Contract two UniTensor by tracing the ranks with common labels. | |
| UniTensor | Contracts (const std::vector< UniTensor > &TNs, const std::string &order, const bool &optimal) |
| Contract multiple UniTensor by tracing the ranks with common labels with pairwise operation. | |
| template<class... T> | |
| UniTensor | Contracts (const UniTensor &in, const T &...args, const std::string &order, const bool &optimal) |
| Contract multiple UniTensor by tracing the ranks with common labels with pairwise operation. | |
| bool | _fx_compare_vec_inc (const std::vector< cytnx_int64 > &v1, const std::vector< cytnx_int64 > &v2) |
| bool | _fx_compare_vec_dec (const std::vector< cytnx_int64 > &v1, const std::vector< cytnx_int64 > &v2) |
Variables | |
| Device_class | Device |
| data on which devices. | |
| SymmetryType_class | SymType |
| Symmetry type. | |
| Type_class | Type |
| data type | |
| int | __blasINTsize__ |
| bool | User_debug |
| UniTensorType_class | UTenType |
| UniTensor type. | |
Helper function to print vector with ODT:
| typedef bool cytnx::cytnx_bool |
| typedef std::complex<double> cytnx::cytnx_complex128 |
| typedef std::complex<float> cytnx::cytnx_complex64 |
| typedef double cytnx::cytnx_double |
| typedef float cytnx::cytnx_float |
| typedef int16_t cytnx::cytnx_int16 |
| typedef int32_t cytnx::cytnx_int32 |
| typedef int64_t cytnx::cytnx_int64 |
| typedef size_t cytnx::cytnx_size_t |
| typedef uint16_t cytnx::cytnx_uint16 |
| typedef uint32_t cytnx::cytnx_uint32 |
| typedef uint64_t cytnx::cytnx_uint64 |
| using cytnx::vec2d = typedef std::vector<std::vector<T> > |
| using cytnx::vec3d = typedef std::vector<std::vector<std::vector<T> >> |
| enum cytnx::bondType : int |
bond type
This is about the enumeration of the type of the object Bond.
| Enumerator | |
|---|---|
| BD_KET | -1, represent ket state in physics |
| BD_BRA | 1, represent bra state in physics |
| BD_REG | 0, only can be used in non-symmetry UniTensor |
| BD_NONE | 0, same as BD_REG |
| BD_IN | -1, same as BD_KET |
| BD_OUT | 1, same as BD_BRA |
| bool cytnx::_fx_compare_vec_dec | ( | const std::vector< cytnx_int64 > & | v1, |
| const std::vector< cytnx_int64 > & | v2 | ||
| ) |
| bool cytnx::_fx_compare_vec_inc | ( | const std::vector< cytnx_int64 > & | v1, |
| const std::vector< cytnx_int64 > & | v2 | ||
| ) |
| Tensor cytnx::arange | ( | const cytnx_double & | start, |
| const cytnx_double & | end, | ||
| const cytnx_double & | step = 1, |
||
| const unsigned int & | dtype = Type.Double, |
||
| const int & | device = Device.cpu |
||
| ) |
create an rank-1 Tensor with elements defined in range [start,end) with assigned step-size
| start | the start value of the range |
| end | the end value of the range |
| step | the step-size of the range |
| dtype | the dtype of the Tensor. It can be any type defined in cytnx::Type |
| device | the device that the Tensor is put on. It can be any device defined in cytnx::Device |
| Tensor cytnx::arange | ( | const cytnx_int64 & | Nelem | ) |
| UniTensor cytnx::Contract | ( | const UniTensor & | inL, |
| const UniTensor & | inR, | ||
| const bool & | cacheL = false, |
||
| const bool & | cacheR = false |
||
| ) |
Contract two UniTensor by tracing the ranks with common labels.
| [in] | inL | the Tensor #1 |
| [in] | inR | the Tensor #2 |
| [in] | cacheL | if the inL should be contiguous align after calling |
| [in] | cacheR | if the inR should be contiguous align after calling |
| UniTensor cytnx::Contracts | ( | const std::vector< UniTensor > & | TNs, |
| const std::string & | order, | ||
| const bool & | optimal | ||
| ) |
Contract multiple UniTensor by tracing the ranks with common labels with pairwise operation.
| [in] | TNs | the Tensors. |
| [in] | order | desired contraction order. |
| [in] | optimal | wheather to find the optimal contraction order automatically. |
See also UniTensor.contract
| UniTensor cytnx::Contracts | ( | const UniTensor & | in, |
| const T &... | args, | ||
| const std::string & | order, | ||
| const bool & | optimal | ||
| ) |
Contract multiple UniTensor by tracing the ranks with common labels with pairwise operation.
| in | the Tensors. |
| args | the Tensors. |
See also UniTensor.contract
| Tensor cytnx::eye | ( | const cytnx_uint64 & | Dim, |
| const unsigned int & | dtype = Type.Double, |
||
| const int & | device = Device.cpu |
||
| ) |
create an square rank-2 Tensor with all diagonal to be one.
| Dim | the dimension of diagonal. |
| dtype | the dtype of the Tensor. It can be any type defined in cytnx::Type |
| device | the device that the Tensor is put on. It can be any device defined in cytnx::Device |
Note: This function is a alias of cytnx::identity().
| int cytnx::get_mkl_code | ( | ) |
| Tensor cytnx::identity | ( | const cytnx_uint64 & | Dim, |
| const unsigned int & | dtype = Type.Double, |
||
| const int & | device = Device.cpu |
||
| ) |
create an square rank-2 Tensor with all diagonal to be one.
| Dim | the dimension of diagonal. |
| dtype | the dtype of the Tensor. It can be any type defined in cytnx::Type |
| device | the device that the Tensor is put on. It can be any device defined in cytnx::Device |
| Tensor cytnx::linspace | ( | const cytnx_double & | start, |
| const cytnx_double & | end, | ||
| const cytnx_uint64 & | Nelem, | ||
| const bool & | endpoint = true, |
||
| const unsigned int & | dtype = Type.Double, |
||
| const int & | device = Device.cpu |
||
| ) |
| UniTensor cytnx::ncon | ( | const std::vector< UniTensor > & | tensor_list_in, |
| const std::vector< std::vector< cytnx_int64 > > & | connect_list_in, | ||
| const bool | check_network = false, |
||
| const bool | optimize = false, |
||
| std::vector< cytnx_int64 > | cont_order = std::vector< cytnx_int64 >(), |
||
| const std::vector< std::string > & | out_labels = std::vector< std::string >() |
||
| ) |
| Tensor cytnx::ones | ( | const cytnx_uint64 & | Nelem, |
| const unsigned int & | dtype = Type.Double, |
||
| const int & | device = Device.cpu |
||
| ) |
create an rank-1 Tensor with all the elements are initialized with one.
| Nelem | the number of elements |
| dtype | the dtype of the Tensor. It can be any type defined in cytnx::Type |
| device | the device that the Tensor is put on. It can be any device defined in cytnx::Device |
| Tensor cytnx::ones | ( | const std::vector< cytnx_uint64 > & | Nelem, |
| const unsigned int & | dtype = Type.Double, |
||
| const int & | device = Device.cpu |
||
| ) |
create an Tensor with all the elements are initialized with one.
| Nelem | the shape of the Tensor |
| dtype | the dtype of the Tensor. It can be any type defined in cytnx::Type |
| device | the device that the Tensor is put on. It can be any device defined in cytnx::Device |
| cytnx::UniTensor cytnx::operator% | ( | const cytnx::UniTensor & | Lt, |
| const cytnx::UniTensor & | Rt | ||
| ) |
The modulo operator between two UniTensor.
This is the modulo function for UniTensor. It will call linalg::Mod(const UniTensor &Lt, const UniTensor &Rt) function.
Lt and Rt must have the same shape. | cytnx::UniTensor cytnx::operator% | ( | const cytnx::UniTensor & | Lt, |
| const T & | rc | ||
| ) |
The modulo operator between a UniTensor and a template type.
This is the modulo function for UniTensor. It will call linalg::Mod(const UniTensor &Lt, const T &rc) function.
| [in] | Lt | The left UniTensor. |
| [in] | rc | The right template type. |
| cytnx::UniTensor cytnx::operator% | ( | const T & | lc, |
| const cytnx::UniTensor & | Rt | ||
| ) |
The modulo operator between a template type and a UniTensor.
This is the modulo function for UniTensor. It will call linalg::Mod(const T &lc, const UniTensor &Rt) function.
| [in] | lc | The left template type. |
| [in] | Rt | The right UniTensor. |
The mode operator between a template type and Tensor.
This operator call linalg::Mod(const T &lc, const Tensor &Rt) to perform the mode between a template type and Tensor.
| [in] | lc | Left template type. |
| [in] | Rt | Right Tensor. |
The mode operator between Tensor and a template type.
This operator call linalg::Mod(const Tensor &Lt, const T &rc) to perform the mode between Tensor and a template type.
| [in] | Lt | Left Tensor. |
| [in] | rc | Right template type. |
The mode operator for Tensor.
This operator call linalg::Mod(const Tensor &Lt, const Tensor &Rt) to perform the mode.
Lt and Rt must have the same shape. | cytnx::UniTensor cytnx::operator* | ( | const cytnx::UniTensor & | Lt, |
| const cytnx::UniTensor & | Rt | ||
| ) |
The multiplication operator between two UniTensor.
This is the multiplication function for UniTensor. It will call linalg::Mul(const UniTensor &Lt, const UniTensor &Rt) function.
Lt and Rt must have the same shape. | cytnx::UniTensor cytnx::operator* | ( | const cytnx::UniTensor & | Lt, |
| const T & | rc | ||
| ) |
The multiplication operator between a UniTensor and a template type.
This is the multiplication function for UniTensor. It will call linalg::Mul(const UniTensor &Lt, const T &rc) function.
| [in] | Lt | The left UniTensor. |
| [in] | rc | The right template type. |
| cytnx::UniTensor cytnx::operator* | ( | const T & | lc, |
| const cytnx::UniTensor & | Rt | ||
| ) |
The multiplication operator between a template type and a UniTensor.
This is the multiplication function for UniTensor. It will call linalg::Mul(const T &lc, const UniTensor &Rt) function.
| [in] | lc | The left template type. |
| [in] | Rt | The right UniTensor. |
The multiplication operator between a template type and Tensor.
This operator call linalg::Mul(const T &lc, const Tensor &Rt) to perform the multiplication between a template type and Tensor.
| [in] | lc | Left template type. |
| [in] | Rt | Right Tensor. |
| Tensor cytnx::operator* | ( | const Tensor & | lhs, |
| const Tensor::Tproxy & | rhs | ||
| ) |
The multiplication operator between Tensor and a template type.
This operator call linalg::Mul(const Tensor &Lt, const T &rc) to perform the multiplication between Tensor and a template type.
| [in] | Lt | Left Tensor. |
| [in] | rc | Right template type. |
The multiplication operator for Tensor.
This operator call linalg::Mul(const Tensor &Lt, const Tensor &Rt) to perform the multiplication.
Lt and Rt must have the same shape. | cytnx::UniTensor cytnx::operator+ | ( | const cytnx::UniTensor & | Lt, |
| const cytnx::UniTensor & | Rt | ||
| ) |
The addtion operator between two UniTensor.
This is the addtion function for UniTensor. It will call linalg::Add(const UniTensor &Lt, const UniTensor &Rt) function.
Lt and Rt must have the same shape. | cytnx::UniTensor cytnx::operator+ | ( | const cytnx::UniTensor & | Lt, |
| const T & | rc | ||
| ) |
The addtion operator between a UniTensor and a template type.
This is the addtion function for UniTensor. It will call linalg::Add(const UniTensor &Lt, const T &rc) function.
| [in] | Lt | The left UniTensor. |
| [in] | rc | The right template type. |
| cytnx::UniTensor cytnx::operator+ | ( | const T & | lc, |
| const cytnx::UniTensor & | Rt | ||
| ) |
The addtion operator between a template type and a UniTensor.
This is the addtion function for UniTensor. It will call linalg::Add(const T &lc, const UniTensor &Rt) function.
| [in] | lc | The left template type. |
| [in] | Rt | The right UniTensor. |
The addition operator between a template type and Tensor.
This operator call linalg::Add(const T &lc, const Tensor &Rt) to perform the addition between a template type and Tensor.
| [in] | lc | Left template type. |
| [in] | Rt | Right Tensor. |
| Tensor cytnx::operator+ | ( | const Tensor & | lhs, |
| const Tensor::Tproxy & | rhs | ||
| ) |
The addition operator between Tensor and a template type.
This operator call linalg::Add(const Tensor &Lt, const T &rc) to perform the addition between Tensor and a template type.
| [in] | Lt | Left Tensor. |
| [in] | rc | Right template type. |
The addition operator for Tensor.
This operator call linalg::Add(const Tensor &Lt, const Tensor &Rt) to perform the addition.
Lt and Rt must have the same shape. | cytnx::UniTensor cytnx::operator- | ( | const cytnx::UniTensor & | Lt, |
| const cytnx::UniTensor & | Rt | ||
| ) |
The subtraction operator between two UniTensor.
This is the subtraction function for UniTensor. It will call linalg::Sub(const UniTensor &Lt, const UniTensor &Rt) function.
Lt and Rt must have the same shape. | cytnx::UniTensor cytnx::operator- | ( | const cytnx::UniTensor & | Lt, |
| const T & | rc | ||
| ) |
The subtraction operator between a UniTensor and a template type.
This is the subtraction function for UniTensor. It will call linalg::Sub(const UniTensor &Lt, const T &rc) function.
| [in] | Lt | The left UniTensor. |
| [in] | rc | The right template type. |
| cytnx::UniTensor cytnx::operator- | ( | const T & | lc, |
| const cytnx::UniTensor & | Rt | ||
| ) |
The subtraction operator between a template type and a UniTensor.
This is the subtraction function for UniTensor. It will call linalg::Sub(const T &lc, const UniTensor &Rt) function.
| [in] | lc | The left template type. |
| [in] | Rt | The right UniTensor. |
The subtraction operator between a template type and Tensor.
This operator call linalg::Sub(const T &lc, const Tensor &Rt) to perform the subtraction between a template type and Tensor.
| [in] | lc | Left template type. |
| [in] | Rt | Right Tensor. |
| Tensor cytnx::operator- | ( | const Tensor & | lhs, |
| const Tensor::Tproxy & | rhs | ||
| ) |
The subtraction operator between Tensor and a template type.
This operator call linalg::Sub(const Tensor &Lt, const T &rc) to perform the subtraction between Tensor and a template type.
| [in] | Lt | Left Tensor. |
| [in] | rc | Right template type. |
The subtraction operator for Tensor.
This operator call linalg::Sub(const Tensor &Lt, const Tensor &Rt) to perform the subtraction.
Lt and Rt must have the same shape. | cytnx::UniTensor cytnx::operator/ | ( | const cytnx::UniTensor & | Lt, |
| const cytnx::UniTensor & | Rt | ||
| ) |
The division operator between two UniTensor.
This is the division function for UniTensor. It will call linalg::Div(const UniTensor &Lt, const UniTensor &Rt) function.
Lt and Rt must have the same shape. | cytnx::UniTensor cytnx::operator/ | ( | const cytnx::UniTensor & | Lt, |
| const T & | rc | ||
| ) |
The division operator between a UniTensor and a template type.
This is the division function for UniTensor. It will call linalg::Div(const UniTensor &Lt, const T &rc) function.
| [in] | Lt | The left UniTensor. |
| [in] | rc | The right template type. |
| cytnx::UniTensor cytnx::operator/ | ( | const T & | lc, |
| const cytnx::UniTensor & | Rt | ||
| ) |
The division operator between a template type and a UniTensor.
This is the division function for UniTensor. It will call linalg::Div(const T &lc, const UniTensor &Rt) function.
| [in] | lc | The left template type. |
| [in] | Rt | The right UniTensor. |
The division operator between a template type and Tensor.
This operator call linalg::Div(const T &lc, const Tensor &Rt) to perform the division between a template type and Tensor.
| [in] | lc | Left template type. |
| [in] | Rt | Right Tensor. |
| Tensor cytnx::operator/ | ( | const Tensor & | lhs, |
| const Tensor::Tproxy & | rhs | ||
| ) |
The division operator between Tensor and a template type.
This operator call linalg::Div(const Tensor &Lt, const T &rc) to perform the division between Tensor and a template type.
| [in] | Lt | Left Tensor. |
| [in] | rc | Right template type. |
The division operator for Tensor.
This operator call linalg::Div(const Tensor &Lt, const Tensor &Rt) to perform the division.
Lt and Rt must have the same shape. The comparison operator between a template type and Tensor.
This operator call linalg::Cpr(const T &lc, const Tensor &Rt) to perform the comparison between a template type and Tensor.
| [in] | lc | Left template type. |
| [in] | Rt | Right Tensor. |
The comparison operator between Tensor and a template type.
This operator call linalg::Cpr(const Tensor &Lt, const T &rc) to perform the comparison between Tensor and a template type.
| [in] | Lt | Left Tensor. |
| [in] | rc | Right template type. |
The comparison operator for Tensor.
This operator call linalg::Cpr(const Tensor &Lt, const Tensor &Rt) to perform the comparison.
| int cytnx::set_mkl_ilp64 | ( | ) |
| Tensor cytnx::zeros | ( | const cytnx_uint64 & | Nelem, |
| const unsigned int & | dtype = Type.Double, |
||
| const int & | device = Device.cpu |
||
| ) |
create an rank-1 Tensor with all the elements are initialized with zero.
| Nelem | the number of elements |
| dtype | the dtype of the Tensor. It can be any type defined in cytnx::Type |
| device | the device that the Tensor is put on. It can be any device defined in cytnx::Device |
| Tensor cytnx::zeros | ( | const std::vector< cytnx_uint64 > & | Nelem, |
| const unsigned int & | dtype = Type.Double, |
||
| const int & | device = Device.cpu |
||
| ) |
create an Tensor with all the elements are initialized with zero.
| Nelem | the shape of the Tensor |
| dtype | the dtype of the Tensor. It can be any type defined in cytnx::Type |
| device | the device that the Tensor is put on. It can be any device defined in cytnx::Device |
|
extern |
|
extern |
data on which devices.
This is the variable about the data on which devices .
You can use it as following:
The supported enumerations are as following:
| enumeration | description |
|---|---|
| cpu | -1, on cpu |
| cuda | 0, on cuda |
|
extern |
Symmetry type.
It is about the type of the Symmetry object The supported enumerations are as following:
| enumeration | description |
|---|---|
| Void | -99, void type (that means not initialized) |
| U | -1, U1 symmetry |
| Z | 0, Zn symmetry |
|
extern |
data type
This is the variable about the data type of the UniTensor, Tensor, ... .
You can use it as following:
The supported enumerations are as following:
| enumeration | description |
|---|---|
| Void | the data type is void (nothing) |
| ComplexDouble | complex double type with 128 bits |
| ComplexFloat | complex float type with 64 bits |
| Double | double float type with 64 bits |
| Float | single float type with 32 bits |
| Int64 | long long integer type with 64 bits |
| Uint64 | unsigned long long integer type with 64 bits |
| Int32 | integer type with 32 bits |
| Uint32 | unsigned integer type with 32 bits |
| Int16 | short integer type with 16 bits |
| Uint16 | undigned short integer with 16 bits |
| Bool | boolean type |
|
extern |
|
extern |