### Basic Uni10 Build and Install Source: https://uni10.gitlab.io/uni10/index.html Standard procedure to build and install Uni10 using CMake. Assumes system C++, BLAS, and LAPACK are available. ```bash > mkdir build > cd build > cmake > make > sudo make install ``` -------------------------------- ### Uni10 Installation with Custom Prefix Source: https://uni10.gitlab.io/uni10/index.html Build and install Uni10 to a specific directory using CMAKE_INSTALL_PREFIX. ```bash > cmake -DCMAKE_INSTALL_PREFIX= ``` -------------------------------- ### Network Definition File Format Source: https://uni10.gitlab.io/uni10/classuni10_1_1_network.html This is an example of the file format used to define a network's connections between tensors. The TOUT line is required to specify output labels. ```text A: 1 2; 3 4 B: 3 4; 5 6 C: -1; 7 1 D: -2; 2 8 E: 7 5; -3 F: 6 8 -4 TOUT: -1 -2; -3 -4 ``` -------------------------------- ### Tensor Bond and Label Initialization for Contraction Source: https://uni10.gitlab.io/uni10/fsy__tensor__tools_8h_source.html Initializes bond and label vectors for two tensors, determining their original bond numbers and dimensions. This is a setup step for tensor contraction. ```C++ uni10_int t1_bondnum = t1_para->bsy->bonds.size(); uni10_int t2_bondnum = t2_para->bsy->bonds.size(); std::vector t1_orilabels = (t1_para->bsy->labels); std::vector t2_orilabels = (t2_para->bsy->labels); uni10_int t1_ori_ibdnum = (t1_para->bsy->RBondNum); uni10_int t2_ori_ibdnum = (t2_para->bsy->RBondNum); ``` -------------------------------- ### Matrix Initialization (from file) Source: https://uni10.gitlab.io/uni10/_matrix_8h_source.html Constructor for the Matrix class, initializing from a file path. ```cpp explicit Matrix(const std::string& kfilename); ``` -------------------------------- ### Initialize and Destroy Uni10 Application Source: https://uni10.gitlab.io/uni10/md__builds_uni10_uni10__dev_guide.html Add Uni10Create() at the beginning and Uni10Destroy() at the end of your main function to enable customized configuration. ```cpp #include "uni10.hpp" using namespace uni10; int main(){ Uni10Create(); ... ... Uni10Destroy(); return 0; } ``` -------------------------------- ### GetDiag() Source: https://uni10.gitlab.io/uni10/group__linalg.html Gets the diagonal elements of a matrix. ```APIDOC ## GetDiag() template Matrix< UniType > uni10::GetDiag | ( | const Block< UniType > & | _kblk_| ) | ### Description Get the diaongal elements of a matrix. ### Parameters - _kblk_ (const Block< UniType > &) - Input matrix. ### Returns A matrix with same diagonal element with `kblk` and other elements are zero. ``` -------------------------------- ### uni10::GetDiag Source: https://uni10.gitlab.io/uni10/group__linalg.html Gets the diagonal elements of a matrix. ```APIDOC ## uni10::GetDiag ### Description Get the diaongal elements of a matrix. ### Template Parameters * `typename UniType` ### Parameters * `const Block< UniType > & kblk` - The input matrix block. ### Returns `Matrix< UniType >` - A matrix containing the diagonal elements. ``` -------------------------------- ### Uni10 Build with MKL and Intel Compilers Source: https://uni10.gitlab.io/uni10/index.html Configure Uni10 build to utilize Intel MKL for BLAS/LAPACK and the Intel C++ compiler. ```bash > cmake -DBUILD_WITH_MKL=on -DBUILD_WITH_INTEL_COMPILERS=on ``` -------------------------------- ### Namespace Members: o Source: https://uni10.gitlab.io/uni10/namespacemembers.html Members starting with 'o' in the uni10 namespace. ```APIDOC ## Namespace Members: o ### Description Members starting with 'o' in the uni10 namespace. ### Functions - **operator<<()** : uni10 - **Otimes()** : uni10 - **OtimesArgs()** : uni10 ``` -------------------------------- ### Namespace Members: i Source: https://uni10.gitlab.io/uni10/namespacemembers.html Members starting with 'i' in the uni10 namespace. ```APIDOC ## Namespace Members: i ### Description Members starting with 'i' in the uni10 namespace. ### Functions - **Inverse()** : uni10 ``` -------------------------------- ### Pre-Construct Network Source: https://uni10.gitlab.io/uni10/_network_8h_source.html Prepares the Network for construction by finding the optimal contraction order. The 'force' parameter can be used to re-calculate the order even if it has been computed before. ```cpp void PreConstruct(bool force=true) ``` -------------------------------- ### PreConstruct Source: https://uni10.gitlab.io/uni10/classuni10_1_1_network-members.html Prepares the network for construction, with an option to force re-initialization. ```APIDOC ## PreConstruct ### Description Prepares the network for construction. This method can be used to ensure the network is in a state ready for further operations, with an option to force re-initialization. ### Method `PreConstruct(bool force=true)` ### Parameters * **force** (bool) - If true, forces re-initialization. Defaults to true. ``` -------------------------------- ### Name Management Source: https://uni10.gitlab.io/uni10/_uni_tensor_8h_source.html Methods for getting and setting the name of the UniTensor. ```cpp std::string GetName() const{return *name;}; ``` ```cpp void SetName(const std::string& _name); ``` -------------------------------- ### Namespace Members: t Source: https://uni10.gitlab.io/uni10/namespacemembers.html Members starting with 't' in the uni10 namespace. ```APIDOC ## Namespace Members: t ### Description Members starting with 't' in the uni10 namespace. ### Functions - **Trace()** : uni10 - **Transpose()** : uni10 ``` -------------------------------- ### Launch (double64) Source: https://uni10.gitlab.io/uni10/classuni10_1_1_network.html Contracts the Network and stores the result in the provided UniTensor of type uni10_double64. ```APIDOC ## Launch(UniTensor< uni10_double64 > &Tout, const std::string &Tname="") ### Description Contracts the Network. ### Parameters #### Path Parameters - **Tout** (UniTensor< uni10_double64 > &) - The UniTensor to store the contracted result. #### Query Parameters - **Tname** (const std::string &) - Optional - Name for the resulting tensor. ``` -------------------------------- ### Namespace Members: s Source: https://uni10.gitlab.io/uni10/namespacemembers.html Members starting with 's' in the uni10 namespace. ```APIDOC ## Namespace Members: s ### Description Members starting with 's' in the uni10 namespace. ### Functions - **Sdd()** : uni10 - **Sum()** : uni10 - **Svd()** : uni10 ``` -------------------------------- ### Initialize Uni10 Environment Source: https://uni10.gitlab.io/uni10/group__config.html Configures Uni10 environment settings using default values or environment variables from .uni10rc. The argc and argv parameters are typically trivial and intended for MPI versions. ```cpp void uni10::Uni10Create (int argc=0, char **argv=NULL) ``` -------------------------------- ### Namespace Members: d Source: https://uni10.gitlab.io/uni10/namespacemembers.html Members starting with 'd' in the uni10 namespace. ```APIDOC ## Namespace Members: d ### Description Members starting with 'd' in the uni10 namespace. ### Functions - **Dagger()** : uni10 - **Det()** : uni10 - **Dot()** : uni10 - **DotArgs()** : uni10 ``` -------------------------------- ### Ql() Source: https://uni10.gitlab.io/uni10/namespacemembers_func.html Performs QL factorization. ```APIDOC ## Ql() ### Description Performs QL factorization. ### Method (Not specified, likely a library function call) ### Endpoint (Not applicable) ### Parameters (Not specified) ### Request Example (Not specified) ### Response (Not specified) ``` -------------------------------- ### Uni10Create Source: https://uni10.gitlab.io/uni10/group__config.html Configures environment settings using default values or collects environment variable values from .uni10rc. It is designed for MPI versions and can accept arguments for configuration. ```APIDOC ## Uni10Create ### Description Configurate the environment settings by default values or Collect the environmnet variable values form .uni10rc. ### Method void ### Parameters #### Path Parameters None #### Query Parameters None #### Request Body None ### Parameters - **argc** (int) - Optional - The number of arguments. Defaults to 0. - **argv** (char **) - Optional - Argument vector. Defaults to NULL. ### Request Example ``` uni10::Uni10Create(argc, argv); ``` ### Response #### Success Response (void) This function does not return a value. #### Response Example None ``` -------------------------------- ### GetName Source: https://uni10.gitlab.io/uni10/functions_func.html Gets the name of a UniTensor. This is a member function of the UniTensor class. ```APIDOC ## GetName() ### Description Gets the name of a UniTensor. ### Method [Method signature implies a function call, not an HTTP method] ### Endpoint [Not applicable for SDK functions] ### Parameters [No parameters explicitly listed in the source] ### Request Example [Not applicable for SDK functions] ### Response - **uni10::UniTensor< UniType >**: The name of the UniTensor. ``` -------------------------------- ### GetElem Source: https://uni10.gitlab.io/uni10/functions_func.html Gets an element from a Block or UniTensor. Overloaded for different types. ```APIDOC ## GetElem() ### Description Gets an element from a Block or UniTensor. This is an overloaded function. ### Method [Method signature implies a function call, not an HTTP method] ### Endpoint [Not applicable for SDK functions] ### Parameters [No parameters explicitly listed in the source] ### Request Example [Not applicable for SDK functions] ### Response - **uni10::Block< UniType >**: The element from the Block. - **uni10::UniTensor< UniType >**: The element from the UniTensor. ``` -------------------------------- ### OtimesArgs Initialization Source: https://uni10.gitlab.io/uni10/uni10__hirnk__linalg__inplace__otimesargs_8h_source.html This function initializes the process by creating the argument list and calling the internal _OtimesArgs helper function. ```cpp template void OtimesArgs(Res& TMout, const Obj& _m1, const Args&... args) { std::vector > umlist; umlist.push_back(std::pair((void*)&_m1, _m1.typeID())); _OtimesArgs(TMout, umlist, args...); } ``` -------------------------------- ### Matrix Initialization (dimensions and source pointer) Source: https://uni10.gitlab.io/uni10/_matrix_8h_source.html Constructor for the Matrix class, initializing with specified dimensions and a pointer to source data. Optionally creates a diagonal matrix. ```cpp explicit Matrix(uni10_uint64 row, uni10_uint64 col, UniType* _src, bool diag=false); ``` -------------------------------- ### GetName Source: https://uni10.gitlab.io/uni10/functions.html Gets the name of a UniTensor. This function is part of the 'g' namespace. ```APIDOC ## GetName() : uni10::UniTensor< UniType > ### Description Gets the name of a UniTensor. ### Method Not specified (likely a member function of UniTensor). ### Endpoint Not applicable (SDK function). ### Parameters Operates on a `uni10::UniTensor< UniType >` object. ### Response Not specified. ``` -------------------------------- ### Bond Constructor (Type and Quantum Numbers) Source: https://uni10.gitlab.io/uni10/_bond_8h_source.html Constructor to initialize a Bond with a specified type and a vector of quantum numbers. ```cpp Bond(bondType tp, const std::vector& qnums); ``` -------------------------------- ### GetBlock Source: https://uni10.gitlab.io/uni10/functions.html Gets a block from a UniTensor. This function is part of the 'g' namespace. ```APIDOC ## GetBlock() : uni10::UniTensor< UniType > ### Description Gets a block from a UniTensor. ### Method Not specified (likely a member function of UniTensor). ### Endpoint Not applicable (SDK function). ### Parameters Operates on a `uni10::UniTensor< UniType >` object. ### Response Not specified. ``` -------------------------------- ### Qnum Constructors Source: https://uni10.gitlab.io/uni10/classuni10_1_1_qnum.html Provides documentation for the various constructors of the Qnum class, including default, fermionic, and copy constructors. ```APIDOC ## Qnum Constructors ### Description Documentation for the constructors of the Qnum class. ### Constructors * **Qnum (int _U1=0, parityType _prt=PRT_EVEN)** Default constructor. * **Qnum (parityFType _prtF, int _U1=0, parityType _prt=PRT_EVEN)** Creates a fermionic quantum number. * **Qnum (const Qnum &_q)** Copy constructor. ``` -------------------------------- ### Get Diagonal Function Source: https://uni10.gitlab.io/uni10/_block_8h_source.html Extracts the diagonal elements of a Block as a Matrix. ```cpp template friend Matrix<_UniType> GetDiag( const Block<_UniType>& kblk ); ``` -------------------------------- ### Matrix Constructors Source: https://uni10.gitlab.io/uni10/classuni10_1_1_matrix.html Provides documentation for the various constructors available for the Matrix class, allowing for different initialization methods. ```APIDOC ## Matrix Constructors ### Description Documentation for the various constructors available for the Matrix class, allowing for different initialization methods. ### Constructors - **Matrix ()** Default constructor. - **Matrix (uni10_uint64 row, uni10_uint64 col, bool diag=false)** Create a Matrix with specified dimensions and an optional diagonal flag. - **Matrix (const std::string &kfilename)** Construct a Matrix by loading data from a specified file. - **template Matrix (Matrix< U > const &kmat)** Copy constructor for creating a new Matrix from an existing one of potentially different UniType. ``` -------------------------------- ### Namespace Members: u Source: https://uni10.gitlab.io/uni10/namespacemembers.html Members starting with 'u' in the uni10 namespace. ```APIDOC ## Namespace Members: u ### Description Members starting with 'u' in the uni10 namespace. ### Functions - **Uni10Create()** : uni10 - **Uni10Destroy()** : uni10 - **Uni10PrintEnvInfo()** : uni10 ``` -------------------------------- ### Launch (double64) Source: https://uni10.gitlab.io/uni10/_network_8h_source.html Launches the tensor network computation. The result is stored in the provided UniTensor Tout. An optional tensor name Tname can be specified. ```APIDOC ## Launch (double64) ### Description Launches the tensor network computation. The result is stored in the provided UniTensor Tout. An optional tensor name Tname can be specified. ### Method void Launch(UniTensor& Tout, const std::string& Tname="") ### Parameters * **Tout** (UniTensor&) - The UniTensor object to store the computation result. * **Tname** (std::string) - Optional. The name of the tensor to be launched. Defaults to an empty string. ``` -------------------------------- ### Namespace Members: r Source: https://uni10.gitlab.io/uni10/namespacemembers.html Members starting with 'r' in the uni10 namespace. ```APIDOC ## Namespace Members: r ### Description Members starting with 'r' in the uni10 namespace. ### Functions - **Randomize()** : uni10 - **Resize()** : uni10 - **Rq()** : uni10 ``` -------------------------------- ### Initializing UniTensors with Specific Values Source: https://uni10.gitlab.io/uni10/_uni_tensor_8h_source.html Methods to initialize UniTensor elements to zero, one, or identity matrices. Overloads allow for specific quantum numbers. ```cpp void Zeros(); ``` ```cpp void Zeros(const Qnum& qnum); ``` ```cpp void Ones(); ``` ```cpp void Ones(const Qnum& qnum); ``` ```cpp void Identity(); ``` ```cpp void Identity(const Qnum& qnum); ``` -------------------------------- ### Namespace Members: q Source: https://uni10.gitlab.io/uni10/namespacemembers.html Members starting with 'q' in the uni10 namespace. ```APIDOC ## Namespace Members: q ### Description Members starting with 'q' in the uni10 namespace. ### Functions - **Qdr()** : uni10 - **Ql()** : uni10 - **Qr()** : uni10 ``` -------------------------------- ### Namespace Members: p Source: https://uni10.gitlab.io/uni10/namespacemembers.html Members starting with 'p' in the uni10 namespace. ```APIDOC ## Namespace Members: p ### Description Members starting with 'p' in the uni10 namespace. ### Variables - **parityFType** : uni10 - **parityType** : uni10 ### Functions - **PartialTrace()** : uni10 - **ParticalTrace()** : uni10 - **Permute()** : uni10 ### Enumerations - **PRT_EVEN** : uni10 - **PRT_ODD** : uni10 - **PRTF_EVEN** : uni10 - **PRTF_ODD** : uni10 ``` -------------------------------- ### Launch Source: https://uni10.gitlab.io/uni10/_network_8h_source.html Contracts the network and returns the resulting tensor. An optional name can be provided for the output tensor. ```APIDOC ## Launch(UniTensor< uni10_double64 > &Tout, const std::string &Tname="") ### Description Contracts the network according to its defined structure and order, returning the resulting tensor. An optional name can be specified for the output tensor. ### Method `Launch` ### Parameters #### Path Parameters - **Tout** (UniTensor< uni10_double64 > &) - Required - A reference to a UniTensor object where the result of the contraction will be stored. - **Tname** (const std::string &) - Optional - Defaults to "". An optional name for the resulting tensor. ``` -------------------------------- ### Namespace Members: n Source: https://uni10.gitlab.io/uni10/namespacemembers.html Members starting with 'n' in the uni10 namespace. ```APIDOC ## Namespace Members: n ### Description Members starting with 'n' in the uni10 namespace. ### Functions - **Norm()** : uni10 ``` -------------------------------- ### Internal Setting Method Source: https://uni10.gitlab.io/uni10/_bond_8h_source.html Private helper method used internally to set up the quantum numbers for a bond. ```cpp void setting(const std::vector& qnums); ``` -------------------------------- ### Namespace Members: l Source: https://uni10.gitlab.io/uni10/namespacemembers.html Members starting with 'l' in the uni10 namespace. ```APIDOC ## Namespace Members: l ### Description Members starting with 'l' in the uni10 namespace. ### Functions - **Ldq()** : uni10 - **Lq()** : uni10 ``` -------------------------------- ### Qnum Constructors and Assignment Source: https://uni10.gitlab.io/uni10/classuni10_1_1_qnum-members.html Details on how to construct and assign values to Qnum objects. ```APIDOC ## Qnum Constructors and Assignment ### Description Provides constructors for initializing Qnum objects and methods for assigning values. ### Methods - **Qnum(int _U1=0, parityType _prt=PRT_EVEN)**: Default constructor. - **Qnum(parityFType _prtF, int _U1=0, parityType _prt=PRT_EVEN)**: Constructor with fermionic parity. - **Qnum(const Qnum &_q)**: Copy constructor. - **assign(int _U1=0, parityType _prt=PRT_EVEN)**: Assigns values to an existing Qnum object. - **assign(parityFType _prtF, int _U1=0, parityType _prt=PRT_EVEN)**: Assigns values with fermionic parity to an existing Qnum object. ``` -------------------------------- ### Namespace Members: h Source: https://uni10.gitlab.io/uni10/namespacemembers.html Members starting with 'h' in the uni10 namespace. ```APIDOC ## Namespace Members: h ### Description Members starting with 'h' in the uni10 namespace. ### Functions - **Hosvd()** : uni10 ``` -------------------------------- ### PreConstruct Source: https://uni10.gitlab.io/uni10/_network_8h_source.html Prepares the network for contraction by finding an optimal contraction order. This operation can be forced to recompute even if the network hasn't changed. ```APIDOC ## PreConstruct(bool force=true) ### Description Finds the optimal contraction order for the network. If `force` is true, it recomputes the order even if the network is considered unchanged. ### Method `PreConstruct` ### Parameters #### Path Parameters - **force** (bool) - Optional - Defaults to true. If true, forces recomputation of the contraction order. ``` -------------------------------- ### Include Uni10 Linalg Inplace API Headers Source: https://uni10.gitlab.io/uni10/linalg__inplace_8h_source.html This C++ code snippet includes header files for various inplace linear algebra operations in the Uni10 library. It covers functions for dot products, QR decomposition, SVD, eigenvalue decomposition, and matrix inversion. ```cpp #include "uni10_api/uni10_linalg_inplace/uni10_linalg_inplace_dotargs.h" #include "uni10_api/uni10_linalg_inplace/uni10_linalg_inplace_dots.h" #include "uni10_api/uni10_linalg_inplace/uni10_linalg_inplace_dot.h" #include "uni10_api/uni10_linalg_inplace/uni10_linalg_inplace_resize.h" #include "uni10_api/uni10_linalg_inplace/uni10_linalg_inplace_qr.h" #include "uni10_api/uni10_linalg_inplace/uni10_linalg_inplace_rq.h" #include "uni10_api/uni10_linalg_inplace/uni10_linalg_inplace_lq.h" #include "uni10_api/uni10_linalg_inplace/uni10_linalg_inplace_ql.h" #include "uni10_api/uni10_linalg_inplace/uni10_linalg_inplace_qdr.h" #include "uni10_api/uni10_linalg_inplace/uni10_linalg_inplace_ldq.h" #include "uni10_api/uni10_linalg_inplace/uni10_linalg_inplace_qdr_cpivot.h" #include "uni10_api/uni10_linalg_inplace/uni10_linalg_inplace_svd.h" #include "uni10_api/uni10_linalg_inplace/uni10_linalg_inplace_sdd.h" #include "uni10_api/uni10_linalg_inplace/uni10_linalg_inplace_eigh.h" #include "uni10_api/uni10_linalg_inplace/uni10_linalg_inplace_eig.h" #include "uni10_api/uni10_linalg_inplace/uni10_linalg_inplace_inverse.h" #include "uni10_api/uni10_linalg_inplace/uni10_linalg_inplace_transpose.h" #include "uni10_api/uni10_linalg_inplace/uni10_linalg_inplace_dagger.h" #include "uni10_api/uni10_linalg_inplace/uni10_linalg_inplace_conj.h" ``` -------------------------------- ### Namespace Members: g Source: https://uni10.gitlab.io/uni10/namespacemembers.html Members starting with 'g' in the uni10 namespace. ```APIDOC ## Namespace Members: g ### Description Members starting with 'g' in the uni10 namespace. ### Functions - **GetDiag()** : uni10 ``` -------------------------------- ### Namespace Members: e Source: https://uni10.gitlab.io/uni10/namespacemembers.html Members starting with 'e' in the uni10 namespace. ```APIDOC ## Namespace Members: e ### Description Members starting with 'e' in the uni10 namespace. ### Functions - **Eig()** : uni10 ``` -------------------------------- ### Uni10Create Source: https://uni10.gitlab.io/uni10/uni10__auxiliary_8h_source.html Configurates the environment settings by default values or collects environment variable values for Uni10. ```APIDOC ## Uni10Create ### Description Configurates the environment settings by default values or collects environment variable values for Uni10. ### Method void ### Parameters - **argc** (int) - Optional - Number of arguments. - **argv** (char**) - Optional - Array of arguments. ### Endpoint N/A (Function call) ``` -------------------------------- ### Namespace Members: c Source: https://uni10.gitlab.io/uni10/namespacemembers.html Members starting with 'c' in the uni10 namespace. ```APIDOC ## Namespace Members: c ### Description Members starting with 'c' in the uni10 namespace. ### Functions - **combine()** : uni10 - **Conj()** : uni10 - **Contract()** : uni10 - **ContractArgs()** : uni10 ``` -------------------------------- ### Bond Constructors Source: https://uni10.gitlab.io/uni10/classuni10_1_1_bond.html Provides documentation for the various constructors of the Bond class, including the default constructor, constructors with bond type and dimension, constructors with bond type and quantum numbers, and the copy constructor. ```APIDOC ## Bond Constructors ### Default Constructor - **Description**: Default constructor for the Bond class. - **Signature**: `Bond()` ### Constructor with Type and Dimension - **Description**: Creates a Bond of a specified type and dimension. - **Signature**: `Bond(bondType tp, size_t dim)` - **Parameters**: - `tp` (bondType): The type of the bond. - `dim` (size_t): The dimension of the bond. ### Constructor with Type and Quantum Numbers - **Description**: Creates a Bond of a specified type and dimension, initialized with quantum numbers. - **Signature**: `Bond(bondType tp, const std::vector< Qnum > &qnums)` - **Parameters**: - `tp` (bondType): The type of the bond. - `qnums` (const std::vector< Qnum > &): A vector of quantum numbers. ### Copy Constructor - **Description**: Copy constructor for the Bond class. - **Signature**: `Bond(const Bond &bd)` - **Parameters**: - `bd` (const Bond &): The Bond object to copy. ``` -------------------------------- ### Namespace Members: b Source: https://uni10.gitlab.io/uni10/namespacemembers.html Members starting with 'b' in the uni10 namespace. ```APIDOC ## Namespace Members: b ### Description Members starting with 'b' in the uni10 namespace. ### Members - **BD_IN** : uni10 - **BD_OUT** : uni10 - **bondType** : uni10 ``` -------------------------------- ### GetElem Source: https://uni10.gitlab.io/uni10/functions.html Gets an element from a Block or UniTensor. This function is part of the 'g' namespace. ```APIDOC ## GetElem() : uni10::Block< UniType > , uni10::UniTensor< UniType > ### Description Gets an element from a Block or UniTensor. ### Method Not specified. ### Endpoint Not applicable (SDK function). ### Parameters Operates on `uni10::Block< UniType >` or `uni10::UniTensor< UniType >` objects. ### Response Not specified. ``` -------------------------------- ### Qnum Constructor with U1 and Parity Source: https://uni10.gitlab.io/uni10/_qnum_8h_source.html Default constructor for Qnum, initializing U1 quantum number and parity (Z2). ```cpp Qnum(int _U1=0, parityType _prt=PRT_EVEN); ``` -------------------------------- ### GetBlock Source: https://uni10.gitlab.io/uni10/functions_func.html Gets a reference to a block within a UniTensor. This is a member function of the UniTensor class. ```APIDOC ## GetBlock() ### Description Gets a reference to a block within a UniTensor. ### Method [Method signature implies a function call, not an HTTP method] ### Endpoint [Not applicable for SDK functions] ### Parameters [No parameters explicitly listed in the source] ### Request Example [Not applicable for SDK functions] ### Response - **uni10::UniTensor< UniType >**: A reference to the specified block. ``` -------------------------------- ### Qnum Constructors Source: https://uni10.gitlab.io/uni10/_qnum_8h_source.html Provides constructors for initializing Qnum objects with different quantum number combinations. ```APIDOC ## Qnum Constructors ### Description Initializes a Qnum object. ### Constructors - `Qnum(int _U1 = 0, parityType _prt = PRT_EVEN)`: Default constructor. - `Qnum(parityFType _prtF, int _U1 = 0, parityType _prt = PRT_EVEN)`: Constructor with fermionic parity. - `Qnum(const Qnum& _q)`: Copy constructor. ``` -------------------------------- ### Saving and Loading UniTensors (Standard) Source: https://uni10.gitlab.io/uni10/_uni_tensor_8h_source.html Methods for saving and loading UniTensor objects using standard file I/O. ```cpp void Save(const std::string& fname) const; ``` ```cpp void Load(const std::string& fname); ``` ```cpp void LoadOldVer(const std::string& fname, const contain_type& type, const std::string& version); ``` -------------------------------- ### GET_COUNTER Source: https://uni10.gitlab.io/uni10/functions.html Gets the current counter value for UniTensor. This function is part of the 'g' namespace. ```APIDOC ## GET_COUNTER() : uni10::UniTensor< UniType > ### Description Gets the current counter value for UniTensor. ### Method Not specified (likely a static member function of UniTensor). ### Endpoint Not applicable (SDK function). ### Parameters None explicitly listed. ### Response Not specified. ``` -------------------------------- ### ConstGetBlocks Source: https://uni10.gitlab.io/uni10/functions.html Gets all blocks from a UniTensor in a const context. This function is part of the 'c' namespace. ```APIDOC ## ConstGetBlocks() : uni10::UniTensor< UniType > ### Description Gets all blocks from a UniTensor in a const context. ### Method Not specified (likely a member function of UniTensor). ### Endpoint Not applicable (SDK function). ### Parameters Operates on a `uni10::UniTensor< UniType >` object. ### Response Not specified. ``` -------------------------------- ### ConstGetBlock Source: https://uni10.gitlab.io/uni10/functions.html Gets a block from a UniTensor in a const context. This function is part of the 'c' namespace. ```APIDOC ## ConstGetBlock() : uni10::UniTensor< UniType > ### Description Gets a block from a UniTensor in a const context. ### Method Not specified (likely a member function of UniTensor). ### Endpoint Not applicable (SDK function). ### Parameters Operates on a `uni10::UniTensor< UniType >` object. ### Response Not specified. ``` -------------------------------- ### Block Constructors Source: https://uni10.gitlab.io/uni10/classuni10_1_1_block-members.html Provides information on how to construct a uni10::Block object. ```APIDOC ## Block() ### Description Default constructor for uni10::Block. ### Method Block() ### Parameters None ### Response None ``` ```APIDOC ## Block(uni10_uint64 row, uni10_uint64 col, bool diag=false) ### Description Constructor for uni10::Block with specified dimensions and an optional diagonal flag. ### Method Block(uni10_uint64 row, uni10_uint64 col, bool diag=false) ### Parameters - **row** (uni10_uint64) - The number of rows in the block. - **col** (uni10_uint64) - The number of columns in the block. - **diag** (bool) - Optional flag indicating if the block is diagonal. Defaults to false. ### Response None ``` ```APIDOC ## Block(const Block &kblk) ### Description Copy constructor for uni10::Block. ### Method Block(const Block &kblk) ### Parameters - **kblk** (const Block &) - The block to copy. ### Response None ``` -------------------------------- ### GET_COUNTER Source: https://uni10.gitlab.io/uni10/functions_func.html Gets the current value of a counter within the UniTensor class. This is a static member function. ```APIDOC ## GET_COUNTER() ### Description Gets the current value of a counter within the UniTensor class. ### Method [Method signature implies a function call, not an HTTP method] ### Endpoint [Not applicable for SDK functions] ### Parameters [No parameters explicitly listed in the source] ### Request Example [Not applicable for SDK functions] ### Response - **uni10::UniTensor< UniType >**: The current value of the counter. ``` -------------------------------- ### Network Constructor Source: https://uni10.gitlab.io/uni10/classuni10_1_1_network-members.html Constructs a Network object, potentially from a file. ```APIDOC ## Network Constructor ### Description Initializes a new instance of the Network class. It can be constructed with a filename. ### Method `Network(const std::string &fname)` ### Parameters * **fname** (const std::string &) - The filename to load the network from. ``` -------------------------------- ### Uni10PrintEnvInfo Source: https://uni10.gitlab.io/uni10/group__config.html Briefly prints the current environment information, including details like CPU cores, threads, and memory usage. ```APIDOC ## Uni10PrintEnvInfo ### Description Briefly print environmnent information. ### Method void ### Parameters None ### Request Example ``` uni10::Uni10PrintEnvInfo(); ``` ### Response #### Success Response (void) This function does not return a value. It prints information to the console. #### Response Example ``` ####### Uni10 environment information ####### # CPU cores : 4 # Threads number: 8 # Total memory : 7903.52 MB # Free memory : 223.00 MB # Swap memory : 4091.73 MB ############################################### ``` ``` -------------------------------- ### ConstGetBlocks Source: https://uni10.gitlab.io/uni10/functions_func.html Gets a constant reference to all blocks within a UniTensor. This is a member function of the UniTensor class. ```APIDOC ## ConstGetBlocks() ### Description Gets a constant reference to all blocks within a UniTensor. ### Method [Method signature implies a function call, not an HTTP method] ### Endpoint [Not applicable for SDK functions] ### Parameters [No parameters explicitly listed in the source] ### Request Example [Not applicable for SDK functions] ### Response - **uni10::UniTensor< UniType >**: A constant reference to all blocks in the UniTensor. ``` -------------------------------- ### Qr() Source: https://uni10.gitlab.io/uni10/namespacemembers_func.html Performs QR factorization. ```APIDOC ## Qr() ### Description Performs QR factorization. ### Method (Not specified, likely a library function call) ### Endpoint (Not applicable) ### Parameters (Not specified) ### Request Example (Not specified) ### Response (Not specified) ``` -------------------------------- ### ConstGetBlock Source: https://uni10.gitlab.io/uni10/functions_func.html Gets a constant reference to a block within a UniTensor. This is a member function of the UniTensor class. ```APIDOC ## ConstGetBlock() ### Description Gets a constant reference to a block within a UniTensor. ### Method [Method signature implies a function call, not an HTTP method] ### Endpoint [Not applicable for SDK functions] ### Parameters [No parameters explicitly listed in the source] ### Request Example [Not applicable for SDK functions] ### Response - **uni10::UniTensor< UniType >**: A constant reference to the specified block. ``` -------------------------------- ### PreConstruct Source: https://uni10.gitlab.io/uni10/classuni10_1_1_network.html Finds the optimal contraction order for the Network. This is a preparatory step before contraction. ```APIDOC ## PreConstruct(bool force=true) ### Description Finds the optimal contraction order of the Network. ### Parameters #### Query Parameters - **force** (bool) - Optional - If true, forces the computation. ``` -------------------------------- ### Element and Type Information Source: https://uni10.gitlab.io/uni10/_uni_tensor_8h_source.html Methods to get the number of elements and the type ID of the UniTensor's elements. ```cpp uni10_uint64 ElemNum()const{return (*U_elemNum); }; ``` ```cpp uni10_uint64 TypeId()const{return (U_elem->uni10_typeid_); }; ``` -------------------------------- ### Get Degeneracies for Quantum Numbers Source: https://uni10.gitlab.io/uni10/_bond_8h_source.html Returns a map where keys are quantum numbers and values are their corresponding degeneracies. ```cpp std::map degeneracy()const; ``` -------------------------------- ### Initialize Matrix as Identity Source: https://uni10.gitlab.io/uni10/_matrix_8h_source.html Sets the matrix to an identity matrix. ```cpp void Identity(); ``` -------------------------------- ### PreConstruct Source: https://uni10.gitlab.io/uni10/_network_8h_source.html Pre-constructs the network. This might involve optimizing the network structure or preparing it for computation. The 'force' parameter can be used to re-run the construction even if it has been done before. ```APIDOC ## PreConstruct ### Description Pre-constructs the network. This might involve optimizing the network structure or preparing it for computation. The 'force' parameter can be used to re-run the construction even if it has been done before. ### Method void PreConstruct(bool force = true) ### Parameters * **force** (bool) - Optional. If true, forces re-construction. Defaults to true. ``` -------------------------------- ### Raw Element Access Source: https://uni10.gitlab.io/uni10/_uni_tensor_8h_source.html Methods to get a pointer to the raw element data and a Matrix representation of the raw elements. ```cpp UniType* GetElem()const{return U_elem->elem_ptr_; } ``` ```cpp Matrix GetRawElem()const; ``` -------------------------------- ### Constructors Source: https://uni10.gitlab.io/uni10/_uni_tensor_8h_source.html Various constructors for initializing UniTensor objects with different parameters. ```APIDOC ## Constructors ### Description Initializes a UniTensor object. ### Methods - **UniTensor()**: Default constructor. - **UniTensor(UniType val, const contain_type s = no_sym)**: Constructor with a value and symmetry type. - **UniTensor(const std::vector& _bonds, const std::string& _name = "")**: Constructor with bonds and an optional name. - **UniTensor(const std::vector& _bonds, int* labels, const std::string& _name = "")**: Constructor with bonds, labels, and an optional name. - **UniTensor(const std::vector& _bonds, std::vector& labels, const std::string& _name = "")**: Constructor with bonds, a vector of labels, and an optional name. - **UniTensor(const Block& UniT)**: Constructor from a Block object. - **UniTensor(const UniTensor& UniT)**: Copy constructor. - **UniTensor(const UniTensor& UniT)**: Template copy constructor for different types. - **UniTensor(const std::string& fname)**: Constructor that loads from a file. ``` -------------------------------- ### ElemNum() Source: https://uni10.gitlab.io/uni10/classuni10_1_1_block.html Gets the total number of elements stored within the Block. This is useful for understanding the size of the data contained in the block. ```APIDOC ## ElemNum() ### Description Get element number of the Block. ### Returns - uni10_uint64 - Element number of the Block. ``` -------------------------------- ### Create Uni10 Environment Source: https://uni10.gitlab.io/uni10/uni10__auxiliary_8h_source.html Configures environment settings using default values or collects environment variable values. Call this function before any other Uni10 functions. ```c++ void Uni10Create(int argc=0, char** argv=NULL); ``` -------------------------------- ### Trim Whitespace from Start of String Source: https://uni10.gitlab.io/uni10/network__tools_8h_source.html Removes leading whitespace characters from a string. Use this function when you need to clean up the beginning of a string. ```cpp #ifndef __UNI10_NETTOOLS_H__ #define __UNI10_NETTOOLS_H__ #include #include #include #include #include namespace uni10{ typedef struct{ int b1; int b2; } _Swap; std::vector<_Swap> recSwap(std::vector& ord, std::vector& ordF); std::vector<_Swap> recSwap(std::vector& ord); //Given the reshape order out to in. // trim from start static inline std::string <rim(std::string &s) { s.erase(s.begin(), std::find_if(s.begin(), s.end(), std::not1(std::ptr_fun(std::isspace)))); return s; } // trim from end static inline std::string &rtrim(std::string &s) { s.erase(std::find_if(s.rbegin(), s.rend(), std::not1(std::ptr_fun(std::isspace))).base(), s.end()); return s; } // trim from both ends static inline std::string &trim(std::string &s) { return ltrim(rtrim(s)); } } #endif ``` -------------------------------- ### Block Matrix Retrieval Source: https://uni10.gitlab.io/uni10/_uni_tensor_8h_source.html Methods to get all blocks as a map of quantum numbers to matrices, or a single matrix representing a block (optionally diagonal). ```cpp std::map< Qnum, Matrix > GetBlocks()const; ``` ```cpp Matrix GetBlock(bool diag = false)const; ``` -------------------------------- ### Load Matrix from File Source: https://uni10.gitlab.io/uni10/_matrix_8h_source.html Loads matrix data from a specified file. Requires the file path as input. ```cpp void Load(const std::string& kfilename); ``` -------------------------------- ### Uni10 Build with Specified BLAS/LAPACK Libraries Source: https://uni10.gitlab.io/uni10/index.html Manually specify the paths to BLAS and LAPACK libraries if CMake fails to detect them automatically. ```bash > cmake -DBLAS_LIBRARIES= -DLAPACK_LIBRARIES= ``` -------------------------------- ### Overload operator<< for Qnum Source: https://uni10.gitlab.io/uni10/classuni10_1_1_qnum.html Prints a Qnum object to an output stream in a specific format. Example format: (U1 = 1, P = 0, 1). ```cpp friend std::ostream& operator<<(std::ostream & _os_ , const Qnum & _q_ ) ``` -------------------------------- ### Qlist() Source: https://uni10.gitlab.io/uni10/classuni10_1_1_bond.html Accesses the quantum numbers for states within the bond. ```APIDOC ## Qlist() ### Description Access quantum numbers. ### Returns Vector of Qnum ``` -------------------------------- ### Matrix Initialization (default) Source: https://uni10.gitlab.io/uni10/_matrix_8h_source.html Default constructor for the Matrix class. Initializes an empty matrix. ```cpp explicit Matrix(); ``` -------------------------------- ### In-place Eigenvalue Decomposition Function Source: https://uni10.gitlab.io/uni10/uni10__linalg__inplace__eig_8h_source.html Performs in-place eigenvalue decomposition on a block. Ensures the input block is square and the inplace flag is set correctly. This function is intended for internal use and requires specific setup. ```cpp #ifndef __UNI10_LINALG_INPLACE_EIG_H__ #define __UNI10_LINALG_INPLACE_EIG_H__ #include "uni10_api/Matrix.h" namespace uni10{ template void Eig( const Block& kblk, Matrix& z, Matrix& w, UNI10_INPLACE on ); template void Eig( const Block& kblk, Matrix& z, Matrix& w, UNI10_INPLACE on ){ uni10_error_msg(on != 1, "%s", "Setting a wrong flag of uni10_Inplace." ); uni10_error_msg(kblk.row_ != kblk.col_, "%s", "For doing eigenvalue decomposition, the matrix have to be square." ); //GPU_NOT_READY z.Assign(kblk.row_, kblk.col_, true); w.Assign(kblk.row_, kblk.col_); linalg_unielem_internal::EigDecompose(&kblk.elem_, &kblk.diag_, &kblk.col_, &z.elem_, &w.elem_); } } #endif ``` -------------------------------- ### Bond Constructor (Type and Quantum Numbers) Source: https://uni10.gitlab.io/uni10/classuni10_1_1_bond.html Creates a Bond object with a specified type and a vector of quantum numbers. ```APIDOC ## Bond() ### Description Creates a Bond of type `tp` and dimension `dim`. The dimension is inferred from the size of the provided quantum numbers vector. ### Parameters - **tp** (bondType) - Type of bond - **qnums** (const std::vector< Qnum > &) - Vector of quantum numbers ``` -------------------------------- ### QR Decomposition with Column Pivoting Source: https://uni10.gitlab.io/uni10/_block_8h_source.html Performs QR decomposition on a Block with column pivoting, returning Q, D, and R matrices. Supports in-place computation. ```cpp template friend void QdrColPivot( const Block<_UniType>& kblk, Matrix<_UniType>& q, Matrix<_UniType>& d, Matrix<_UniType>& r, UNI10_INPLACE on ); ``` -------------------------------- ### Print Uni10 Environment Information Source: https://uni10.gitlab.io/uni10/group__config.html Briefly prints the current environment information for Uni10. This includes details like CPU cores, memory, and swap usage. ```cpp void uni10::Uni10PrintEnvInfo () ``` ```text ####### Uni10 environment information ####### # CPU cores : 4 # Threads number: 8 # Total memory : 7903.52 MB # Free memory : 223.00 MB # Swap memory : 4091.73 MB ############################################### ``` -------------------------------- ### uni10::Network::Launch Source: https://uni10.gitlab.io/uni10/classuni10_1_1_network.html Launches the network computation, optionally specifying the output tensor and its name. This is an overloaded function for convenience. ```APIDOC ## void uni10::Network::Launch(UniTensor& _Tout_, const std::string& _Tname_ = "") ### Description Launches the network computation with the specified output tensor and name. This is an overloaded member function for convenience. ### Method void ### Parameters #### Path Parameters - **_Tout_** (UniTensor&) - Required - The output tensor. - **_Tname_** (const std::string&) - Optional - The name of the output tensor. Defaults to an empty string. ``` -------------------------------- ### Qnum Constructor with Fermionic Parity, U1, and Parity Source: https://uni10.gitlab.io/uni10/_qnum_8h_source.html Constructor for Qnum that includes fermionic parity, U1 quantum number, and parity (Z2). ```cpp Qnum(parityFType _prtF, int _U1 = 0, parityType _prt = PRT_EVEN); ``` -------------------------------- ### Launch Source: https://uni10.gitlab.io/uni10/classuni10_1_1_network-members.html Launches a network operation, outputting the result to a UniTensor. Overloaded for different data types. ```APIDOC ## Launch ### Description Launches a network operation, outputting the result to a UniTensor. This method is overloaded to support different numerical types. ### Method `Launch(UniTensor< uni10_double64 > &Tout, const std::string &Tname="")` `Launch(UniTensor< uni10_complex128 > &Tout, const std::string &Tname="")` ### Parameters * **Tout** (UniTensor< T > &) - The UniTensor to store the output. * **Tname** (const std::string &) - Optional name for the output tensor. ``` -------------------------------- ### Matrix Constructor (File Path) Source: https://uni10.gitlab.io/uni10/classuni10_1_1_matrix.html Constructs a Matrix by loading a stored Matrix from a specified file path. ```APIDOC ## Matrix() [2/3] template | uni10::Matrix< UniType >::Matrix | ( | const std::string & | _kfilename_| ) | ---|---|---|---|---|--- explicit Construct a Matrix, and assign a stored Matrix to it. Parameters kfilename| Path where the Matrix stored. ---|--- ```