### Install pyUni10 on Windows Source: https://uni10-tutorials.readthedocs.io/en/latest/setup.html Use this command in a Windows command prompt after navigating to the pyUni10 directory to install the library. Administrator privileges may be required. ```batch python.exe setup.py install ``` -------------------------------- ### Install pyUni10 on Linux/Mac OS X Source: https://uni10-tutorials.readthedocs.io/en/latest/setup.html Use this command in a shell terminal after navigating to the pyUni10 directory to install the library. Administrator privileges may be required. ```bash python setup.py install ``` -------------------------------- ### Network Constructor Source: https://uni10-tutorials.readthedocs.io/en/latest/pyUni10.Network.html Initializes a Network object by loading a network structure from a specified file. Optionally, a list of tensors can be provided to populate the network. ```APIDOC ## Network Constructor ### Description Loads the network structure from file. Optionally, a list of tensors can be provided. ### Parameters * **filename** (str) – file where the network structure is stored * **tensors** (array of UniTensors) – list of tensors to be put into Network ### Returns a Network object ### Return type Network ``` -------------------------------- ### Matrix.load() Source: https://uni10-tutorials.readthedocs.io/en/latest/pyUni10.Matrix.html Loads Matrix from a binary file. ```APIDOC ## Matrix.load(filename) ### Description Loads Matrix from a binary file named filename. ### Parameters #### Path Parameters - **filename** (str) - Required - input filename ``` -------------------------------- ### Bond Constructors Source: https://uni10-tutorials.readthedocs.io/en/latest/pyUni10.Bond.html Provides three ways to create a Bond object: by bond type and dimension, by bond type and quantum numbers, or by copying an existing Bond object. ```APIDOC ## Bond Constructors ### Description Creates a Bond object. ### Parameters #### bdtype (BondType) - Required - BD_IN / BD_OUT #### dim (int) - Required - dimension of the bond (no symmetry) #### qnums (array of Qnums) - Required - list of quantum numbers #### bd (Bond) - Required - a Bond object ### Returns a Bond object ### Return type Bond ``` -------------------------------- ### Matrix Constructor (Real) Source: https://uni10-tutorials.readthedocs.io/en/latest/pyUni10.Matrix.html Creates a Real Matrix object. It can be initialized with dimensions, elements, or by copying another matrix. ```APIDOC ## Matrix Constructor (Real) ### Description Creates a Real Matrix object. It can be initialized with dimensions, elements, or by copying another matrix. ### Parameters #### Path Parameters - **Rnum** (int) - Required - number of Rows - **Cnum** (int) - Required - number of Columns - **diag** (bool) - Optional - Set True for a diagonal matrix - **elem** (iterable) - Optional - Matrix elements - **Ma** (Matrix) - Optional - another Matrix object ### Returns - **Matrix** - a Matrix object ``` -------------------------------- ### UniTensor.profile Source: https://uni10-tutorials.readthedocs.io/en/latest/pyUni10.UniTensor.html Prints the memory usage of all existing UniTensors. ```APIDOC ## UniTensor.profile ### Description Prints the memory usage of all the existing UniTensors. ### Method `profile()` ### Parameters None ``` -------------------------------- ### pyUni10.Qnum Constructor Source: https://uni10-tutorials.readthedocs.io/en/latest/pyUni10.Qnum.html Constructs a Qnum object. It can be initialized with U1 and parity quantum numbers, or by copying another Qnum object. ```APIDOC ## pyUni10.Qnum() ### Description Creates a Qnum object. It can be initialized with U1 and parity quantum numbers, or by copying another Qnum object. ### Parameters #### Constructor Overloads - `__init__(self, U1=0, prt=PRT_EVEN)`: Initializes with U1 and parity. - `__init__(self, q)`: Initializes by copying another Qnum object `q`. ### Parameters (for `__init__(self, U1, prt)`) #### Path Parameters - **U1** (int) - U1 quantum number - **prt** (parityType) - parity quantum number ### Parameters (for `__init__(self, q)`) #### Path Parameters - **q** (Qnum) - Another Qnum object ### Returns - Qnum object ### Return Type - Qnum ``` -------------------------------- ### Network.profile Source: https://uni10-tutorials.readthedocs.io/en/latest/pyUni10.Network.html Prints the memory usage details of the Network object. ```APIDOC ## Network.profile ### Description Prints the memory usage of Network. ### Returns current memory usage of Network ### Return type str ``` -------------------------------- ### Matrix.save() Source: https://uni10-tutorials.readthedocs.io/en/latest/pyUni10.Matrix.html Saves the Matrix to a binary file. ```APIDOC ## Matrix.save(filename) ### Description Saves the Matrix to a binary file named filename. ### Parameters #### Path Parameters - **filename** (str) - Required - output filename ``` -------------------------------- ### printRawElem Source: https://uni10-tutorials.readthedocs.io/en/latest/pyUni10.UniTensor.html Prints the raw elements of the UniTensor to the console. ```APIDOC ## UniTensor.printRawElem() ### Description Prints the raw elements of the UniTensor. ### Returns - None. Prints to standard output. ``` -------------------------------- ### Block Methods Source: https://uni10-tutorials.readthedocs.io/en/latest/pyUni10.Block.html Provides documentation for various methods available on Block objects, including element access, property checks, and matrix operations. ```APIDOC ## Block Methods ### elemNum() #### Description Returns the number of elements in the Block. #### Returns - **int**: The total number of elements in the Block. ### getElem() #### Description Returns a reference to the elements of the Matrix held by the Block. #### Returns - **float***: A reference to the matrix elements. ### isDiag() #### Description Checks if the Block represents a diagonal matrix. #### Returns - **bool**: True if the Block is diagonal, False otherwise. ### norm() #### Description Calculates and returns the L2 norm of the Block. #### Returns - **float**: The L2 norm of the Block. ### col() #### Description Returns the number of columns in the Matrix associated with the Block. #### Returns - **int**: The number of columns. ### row() #### Description Returns the number of rows in the Matrix associated with the Block. #### Returns - **int**: The number of rows. ### load(filename) #### Description Loads Matrix data from a binary file. #### Parameters - **filename** (str) – The name of the input binary file. ### save(filename) #### Description Saves the Matrix data to a binary file. #### Parameters - **filename** (str) – The name of the output binary file. ### resize(Rnum, Cnum) #### Description Resizes the Matrix associated with the Block to the specified dimensions. #### Parameters - **Rnum** (int) – The new number of rows. - **Cnum** (int) – The new number of columns. #### Returns - **Matrix**: The resized Matrix. ### setElem(elem) #### Description Sets the elements of the Matrix to the provided data. #### Parameters - **elem** (array of floats) – The data to set as matrix elements. ### set_zero() #### Description Sets all elements of the Matrix to zero. ### sum() #### Description Calculates the sum of all elements in the Matrix. #### Returns - **float**: The sum of all elements. ### trace() #### Description Calculates the trace of a square matrix. #### Returns - **float**: The trace of the matrix. #### Raises - **RunTimeError**: If the Matrix is not a square matrix. ### transpose() #### Description Performs an in-place transpose of the Matrix. The number of rows and columns are exchanged. #### Returns - **Matrix**: The transposed Matrix. ### eigh() #### Description Diagonalizes a symmetric Matrix and returns eigenvalues and eigenvectors. This is a wrapper for the LAPACK function dsyev(). #### Returns - **tuple of Matrix**: A tuple containing (DD, UU), where DD is a diagonal matrix of eigenvalues and UU is a matrix of eigenvectors. #### Note This function does not check if the matrix is symmetric. ### svd() #### Description Performs Singular Value Decomposition (SVD) on the Matrix. Factorizes the matrix AA into U, Σ, and V† such that A=UΣV†. This is a wrapper for the Lapack function dgesvd(). #### Returns - **tuple of Matrix**: A tuple containing (UU, ΣΣ, V†V†), where UU is a row-major matrix, ΣΣ is a diagonal matrix of singular values, and V†V† is a row-major matrix. ``` -------------------------------- ### getElem Source: https://uni10-tutorials.readthedocs.io/en/latest/pyUni10.UniTensor.html Provides a reference to the elements of the UniTensor. ```APIDOC ## UniTensor.getElem() ### Description Returns a reference to the elements contained within the UniTensor. ### Returns - A reference to the elements. ### Return Type - float * ``` -------------------------------- ### Bond.Qlist() Source: https://uni10-tutorials.readthedocs.io/en/latest/pyUni10.Bond.html Retrieves a tuple of quantum numbers associated with the Bond object. ```APIDOC ## Bond.Qlist() ### Description Returns a tuple of quantum numbers associate with Bond. ### Returns a tuple of quantum numbers ### Return type tuple of Qnum ``` -------------------------------- ### UniTensor.save Source: https://uni10-tutorials.readthedocs.io/en/latest/pyUni10.UniTensor.html Saves the content of the UniTensor to a binary file. ```APIDOC ## UniTensor.save ### Description Saves the content of UniTensor to the binary file filename. ### Method `save(filename)` ### Parameters #### Path Parameters * **filename** (str) - Required - The name of the binary file to save to. ``` -------------------------------- ### pyUni10 Constants Source: https://uni10-tutorials.readthedocs.io/en/latest/pyUni10.html Lists the predefined constants available in the pyUni10 library. ```APIDOC ## pyUni10 Constants ### Description Provides access to various constants used within the pyUni10 library. ### Constants - **BD_IN** - **BD_OUT** - **PRTF_EVEN** - **PRTF_ODD** - **PRT_EVEN** - **PRT_ODD** - **CTYPE** - **RTYPE** ``` -------------------------------- ### pyUni10.QnumF Constructor Source: https://uni10-tutorials.readthedocs.io/en/latest/pyUni10.Qnum.html Constructs a Qnum object with fermionic parity. ```APIDOC ## pyUni10.QnumF() ### Description Construct a Qnum object with fermionic parity. ### Parameters #### Path Parameters - **prtF** (parityFType) - fermionic parity quantum number - **U1** (int) - U1 quantum number - **prt** (parityType) - parity quantum number ### Returns - Qnum object ### Return Type - Qnum ``` -------------------------------- ### getBlocks Source: https://uni10-tutorials.readthedocs.io/en/latest/pyUni10.UniTensor.html Returns a dictionary mapping quantum numbers to their corresponding block matrices. ```APIDOC ## UniTensor.getBlocks() ### Description Returns a dictionary where keys are quantum numbers (Qnum) and values are their corresponding block matrices. ### Returns - A dictionary mapping Qnum to Matrix. ### Return Type - dict ``` -------------------------------- ### UniTensor Constructor (Bonds and Labels) Source: https://uni10-tutorials.readthedocs.io/en/latest/pyUni10.UniTensor.html Constructs a UniTensor object with specified bonds, labels, and an optional name. ```APIDOC ## UniTensor(bds, labels, name="") ### Description Constructs a UniTensor with specified bonds and labels. ### Parameters #### Path Parameters - **bds** (array of Bond) - List of bonds - **labels** (array of int) - List of labels - **name** (str) - Name of the tensor (optional, defaults to "") ### Returns - a UniTensor object ### Return Type - UniTensor ``` -------------------------------- ### pyUni10 Classes Source: https://uni10-tutorials.readthedocs.io/en/latest/pyUni10.html Outlines the main classes available in the pyUni10 library. ```APIDOC ## pyUni10 Classes ### Description Defines the core classes that form the foundation of the pyUni10 library. ### Classes - **Qnum** - **Bond** - **Matrix** - **Network** - **UniTensor** ``` -------------------------------- ### Matrix.Decompositions (qr, rq, ql, lq) Source: https://uni10-tutorials.readthedocs.io/en/latest/pyUni10.Matrix.html Performs matrix decompositions including QR, RQ, QL, and LQ. Returns a tuple containing the triangular matrix (R or L) and the orthogonal/unitary matrix (Q). ```APIDOC ## Matrix.Decompositions ### Description Performs QR, RQ, QL, LQ decompositions of Matrix. ### Methods - `qr()` - `rq()` - `ql()` - `lq()` ### Returns - **tuple of Matrix** - A tuple containing the upper/lower triangular matrix (R/L) and the unitary matrix (Q). ``` -------------------------------- ### pyUni10 Global Functions Source: https://uni10-tutorials.readthedocs.io/en/latest/pyUni10.html Details the global functions exposed by the pyUni10 library. ```APIDOC ## pyUni10 Global Functions ### Description These are top-level functions available for direct use in pyUni10. ### Functions - **combine** - **contract** - **otimes** - **takeExp** ``` -------------------------------- ### elemCmp Source: https://uni10-tutorials.readthedocs.io/en/latest/pyUni10.UniTensor.html Compares the elements of the UniTensor with another UniTensor. ```APIDOC ## UniTensor.elemCmp(Tb) ### Description Tests whether the elements of this UniTensor are identical to the elements in another UniTensor (Tb). ### Parameters #### Path Parameters - **Tb** (UniTensor) - The UniTensor to compare elements with. ### Returns - True if the elements are the same, False otherwise. ### Return Type - bool ``` -------------------------------- ### Network.launch Source: https://uni10-tutorials.readthedocs.io/en/latest/pyUni10.Network.html Performs the contraction of tensors within the network. It can return a specific UniTensor by its name if provided. ```APIDOC ## Network.launch ### Description Performs contraction of the tensors in the network, and returns a UniTensor named name (optional). ### Parameters * **name** (str) – name of the output UniTensor ### Returns contracted tensor ### Return type UniTensor ``` -------------------------------- ### getName Source: https://uni10-tutorials.readthedocs.io/en/latest/pyUni10.UniTensor.html Returns the name assigned to the UniTensor. ```APIDOC ## UniTensor.getName() ### Description Returns the name of the UniTensor. ### Returns - The name of the UniTensor. ### Return Type - str ``` -------------------------------- ### getBlock Source: https://uni10-tutorials.readthedocs.io/en/latest/pyUni10.UniTensor.html Retrieves a specific block's elements based on quantum number, with an option for diagonal elements only. ```APIDOC ## UniTensor.getBlock([qnum, ]diag=false) ### Description Returns the elements of a block specified by its quantum number (qnum) as a Matrix. If the `diag` flag is set to True, only the diagonal elements of that block are returned in a diagonal Matrix. If `qnum` is not provided, the Qnum(0) block is returned. ### Parameters #### Path Parameters - **qnum** (Qnum) - The quantum number identifying the block (optional). - **diag** (bool) - If True, returns only the diagonal elements of the block (optional, defaults to False). ### Returns - A Matrix containing the elements of the specified block. ### Return Type - Matrix ``` -------------------------------- ### Qnum.assign() Source: https://uni10-tutorials.readthedocs.io/en/latest/pyUni10.Qnum.html Assigns a quantum number (U1 and parity) to a Qnum object. ```APIDOC ## Qnum.assign() ### Description Assign a quantum number to a Qnum object. ### Parameters #### Path Parameters - **U1** (int) - U1 quantum number - **prt** (parityType) - parity quantum number ### Returns - a Qnum object ### Return Type - Qnum ``` -------------------------------- ### Matrix.sum() Source: https://uni10-tutorials.readthedocs.io/en/latest/pyUni10.Matrix.html Performs the summation of all elements in the Matrix. ```APIDOC ## Matrix.sum() ### Description Performs the summation of all elements in the Matrix. ### Returns - **float** - sum of all elements in the Matrix ``` -------------------------------- ### Matrix.getElem() Source: https://uni10-tutorials.readthedocs.io/en/latest/pyUni10.Matrix.html Returns the reference to the elements of the Matrix. ```APIDOC ## Matrix.getElem() ### Description Returns the reference to the elements of the Matrix. ### Returns - **float *** - reference to the element of the Matrix ``` -------------------------------- ### Bond.assign() Source: https://uni10-tutorials.readthedocs.io/en/latest/pyUni10.Bond.html Sets the dimensions or quantum numbers of a bond. Can be called with either bond type and dimension, or bond type and quantum numbers. ```APIDOC ## Bond.assign() ### Description Set the dimensions / quantum numbers of a bond. ### Parameters #### bdtype (BondType) - Required - BD_IN / BD_OUT #### dim (int) - Required - dimension of a bond (no symmetry) #### qnum (arrays of Qnum) - Required - arrays of quantum numbers ``` -------------------------------- ### Block Constructors Source: https://uni10-tutorials.readthedocs.io/en/latest/pyUni10.Block.html Constructs a Block object. It can be initialized with dimensions and optional elements or by copying another Matrix object. ```APIDOC ## pyUni10.Block Constructor ### Description Initializes a Block object. Memory allocation is handled by the Matrix class. ### Parameters #### Constructor 1: - **Rnum** (int) – number of Rows - **Cnum** (int) – number of Columns - **diag** (bool) – Optional. Set True for a diagonal matrix. Defaults to False. - **elem** (iterable) – Optional. Matrix elements. #### Constructor 2: - **Ma** (Matrix) – Another Matrix object to create a Block from. ### Return Type Block ``` -------------------------------- ### label Source: https://uni10-tutorials.readthedocs.io/en/latest/pyUni10.UniTensor.html Retrieves the label of a specific bond or all bond labels. ```APIDOC ## UniTensor.label([idx]) ### Description Returns the label of the bond at the specified index. If no index is provided, it returns an array containing the labels of all bonds. ### Parameters #### Path Parameters - **idx** (int) - The index of the bond (optional). ### Returns - The label of the specified bond or an array of all bond labels. ### Return Type - (array of) int ``` -------------------------------- ### Matrix.identity() Source: https://uni10-tutorials.readthedocs.io/en/latest/pyUni10.Matrix.html Returns an identity matrix. ```APIDOC ## Matrix.identity() ### Description Returns an identity matrix. ### Returns - **Matrix** - an identity matrix ``` -------------------------------- ### Qnum.isFermionic() Source: https://uni10-tutorials.readthedocs.io/en/latest/pyUni10.Qnum.html A static method that tests whether fermionic parity PRTF_ODD is ever defined. ```APIDOC ## Qnum.isFermionic() ### Description Tests whether fermionic parity PRTF_ODD is ever defined. ### Returns - True or False ### Return Type - bool ``` -------------------------------- ### bond Source: https://uni10-tutorials.readthedocs.io/en/latest/pyUni10.UniTensor.html Retrieves the specified bond or all bonds of the UniTensor. ```APIDOC ## UniTensor.bond([idx]) ### Description Returns the specified bond by its index. If no index is provided, it returns an array of all bonds associated with the UniTensor. ### Parameters #### Path Parameters - **idx** (int) - The index of the bond (optional) ### Returns - The specified bond or an array of all bonds. ### Return Type - (array of) Bond ``` -------------------------------- ### Matrix.resize() Source: https://uni10-tutorials.readthedocs.io/en/latest/pyUni10.Matrix.html Sets the dimensions of the Matrix to (Rnum, Cnum). ```APIDOC ## Matrix.resize(Rnum, Cnum) ### Description Set the dimensions of the Matrix to (Rnum, Cnum). ### Parameters #### Path Parameters - **Rnum** (int) - Required - number of Rows - **Cnum** (int) - Required - number of Columns ### Returns - **Matrix** - Matrix of size (Rnum, Cnum) ``` -------------------------------- ### UniTensor.trace Source: https://uni10-tutorials.readthedocs.io/en/latest/pyUni10.UniTensor.html Traces out incoming and outgoing bonds and returns the trace value. ```APIDOC ## UniTensor.trace ### Description Traces out incoming and outgoing bonds, and returns the trace value. ### Method `trace()` ### Parameters None ### Returns * **float** - The trace of the UniTensor. ``` -------------------------------- ### Bond.change() Source: https://uni10-tutorials.readthedocs.io/en/latest/pyUni10.Bond.html Changes the type of the Bond (BD_IN to BD_OUT or vice versa) and updates the associated quantum numbers accordingly. ```APIDOC ## Bond.change() ### Description Changes the type of Bond , and changes the Qnums of Bond . If the bond is changed from in-coming(BD_IN) to out-going(BD_OUT) type or vice versa, the resulting Qnums is -Qnums. ### Parameters #### bdtype (BondType) - Required - BD_IN / BD_OUT ### Returns _Bond_ with type bdtype ### Return type Bond ``` -------------------------------- ### Matrix.trace Source: https://uni10-tutorials.readthedocs.io/en/latest/pyUni10.Matrix.html Calculates the trace of a square matrix. The trace is the sum of the elements on the main diagonal. ```APIDOC ## Matrix.trace ### Description Takes the trace of a square matrix. ### Method `trace()` ### Returns - **trace** (float) - The trace of the square matrix. ### Raises - **RunTimeError** - If the matrix is not square. ``` -------------------------------- ### combineBond Source: https://uni10-tutorials.readthedocs.io/en/latest/pyUni10.UniTensor.html Combines specified bonds into a single bond. ```APIDOC ## UniTensor.combineBond(labels) ### Description Combines multiple bonds, identified by their labels, into a single bond. The resulting bond inherits the label and bondType from the first bond in the provided list. ### Parameters #### Path Parameters - **labels** (list) - An array of labels corresponding to the bonds to be combined. ### Returns - A single combined bond. ### Return Type - Bond ``` -------------------------------- ### CMatrix Constructor (Complex) Source: https://uni10-tutorials.readthedocs.io/en/latest/pyUni10.Matrix.html Creates a Complex Matrix object. It can be initialized with dimensions, elements, or by copying another matrix. ```APIDOC ## CMatrix Constructor (Complex) ### Description Creates a Complex Matrix object. It can be initialized with dimensions, elements, or by copying another matrix. ### Parameters #### Path Parameters - **Rnum** (int) - Required - number of Rows - **Cnum** (int) - Required - number of Columns - **diag** (bool) - Optional - Set True for a diagonal matrix - **elem** (iterable) - Optional - Matrix elements - **Ma** (Matrix) - Optional - another Matrix object ### Returns - **Matrix** - a Complex Matrix object ``` -------------------------------- ### pyUni10.takeExp Source: https://uni10-tutorials.readthedocs.io/en/latest/pyUni10.takeExp.html Calculates the matrix exponential of a given matrix multiplied by a scalar constant. ```APIDOC ## pyUni10.takeExp ### Description Calculates the matrix exponential of a given matrix multiplied by a scalar constant. The function computes exp(aM), where 'a' is a scalar and 'M' is the input matrix. ### Method N/A (Python function call) ### Parameters #### Path Parameters N/A #### Query Parameters N/A #### Request Body N/A ### Parameters * **a** (float) - The scalar multiplication constant. * **mat** (Matrix) - The input matrix. ### Returns * **Matrix** - A matrix representing exp(aM). ### Return Type Matrix ``` -------------------------------- ### Matrix.eig() Source: https://uni10-tutorials.readthedocs.io/en/latest/pyUni10.Matrix.html Diagonalizes a general Matrix and returns a tuple of matrices (D,UD,U), where DD is a diagonal matrix of eigenvalues and UU is a matrix of row-vectors of right eigenvectors. Only the right eigenvectors will be given. ```APIDOC ## Matrix.eig() ### Description Diagonalizes a general Matrix and returns a tuple of matrices (D,UD,U), where DD is a diagonal matrix of eigenvalues and UU is a matrix of row-vectors of right eigenvectors. Only the right eigenvectors will be given. ### Returns - **tuple of Matrix** - DD: diagonal matrix of eigenvalues, UU: matrix of right eigenvectors ``` -------------------------------- ### Qnum.assignF() Source: https://uni10-tutorials.readthedocs.io/en/latest/pyUni10.Qnum.html Assigns a fermionic quantum number (fermionic parity, U1, and parity) to a Qnum object. ```APIDOC ## Qnum.assignF() ### Description Assign a fermionic quantum number to a Qnum object. ### Parameters #### Path Parameters - **prtF** (parityFType) - fermionic parity quantum number - **U1** (int) - U1 quantum number - **prt** (parityType) - parity quantum number ### Returns - a Qnum object ### Return Type - Qnum ``` -------------------------------- ### elemNum Source: https://uni10-tutorials.readthedocs.io/en/latest/pyUni10.UniTensor.html Returns the total number of elements in the UniTensor. ```APIDOC ## UniTensor.elemNum() ### Description Returns the total count of elements within the UniTensor. ### Returns - The total number of elements. ### Return Type - int ``` -------------------------------- ### Matrix.transpose Source: https://uni10-tutorials.readthedocs.io/en/latest/pyUni10.Matrix.html Performs an in-place transpose of a real matrix, swapping rows and columns. ```APIDOC ## Matrix.transpose ### Description Performs in-place transpose of a Real Matrix. The number of rows and the number of columns are exchanged. ### Method `transpose()` ### Returns - **Matrix** - The transposed matrix. ``` -------------------------------- ### Matrix.svd() Source: https://uni10-tutorials.readthedocs.io/en/latest/pyUni10.Matrix.html Performs Singular Value Decomposition (SVD) of the Matrix. Factorizes the m x n matrix A into two unitary matrices U and V†, and a diagonal matrix Σ of singular values such that A = UΣV†. ```APIDOC ## Matrix.svd() ### Description Performs SVD of the Matrix. Factorizes the m x n matrix A into two unitary matrices U and V†, and a diagonal matrix Σ of singular values (real, non-negative) such that A=UΣV†. ### Returns - **tuple of Matrix** - UU: a m x n row-major matrix, Σ: a n x n diagonal matrix, V†: a n x m row-major matrix ``` -------------------------------- ### Matrix.elemNum() Source: https://uni10-tutorials.readthedocs.io/en/latest/pyUni10.Matrix.html Returns the number of elements in the Matrix. ```APIDOC ## Matrix.elemNum() ### Description Returns the number of elements in the Matrix. ### Returns - **int** - number of elements in the Matrix ``` -------------------------------- ### UniTensor.transpose Source: https://uni10-tutorials.readthedocs.io/en/latest/pyUni10.UniTensor.html Transposes all blocks associated with quantum numbers. The bonds are changed from incoming to outcoming or vice versa while the quantum numbers remain the same on the bonds. ```APIDOC ## UniTensor.transpose ### Description Transposes all blocks associated with quantum numbers. The bonds are changed from incoming to outcoming or vice versa while the quantum numbers remain the same on the bonds. ### Method `transpose()` ### Parameters None ### Returns * **UniTensor &** - A reference to the transposed tensor. ``` -------------------------------- ### Matrix.setElem() Source: https://uni10-tutorials.readthedocs.io/en/latest/pyUni10.Matrix.html Sets the elements of the Matrix to the provided data. ```APIDOC ## Matrix.setElem(elem) ### Description Set elements of the Matrix to elem. ### Parameters #### Path Parameters - **elem** (array of floats) - Required - data ``` -------------------------------- ### Bond.combine() Source: https://uni10-tutorials.readthedocs.io/en/latest/pyUni10.Bond.html Merges another Bond object into the current Bond object. ```APIDOC ## Bond.combine() ### Description Merge bd into _Bond_. ### Parameters #### bd (Bond) - Required - bond to be merged ### Returns merged bond ### Return type Bond ``` -------------------------------- ### partialTrace Source: https://uni10-tutorials.readthedocs.io/en/latest/pyUni10.UniTensor.html Traces out specified bonds and returns a reference to the resulting tensor. ```APIDOC ## UniTensor.partialTrace(la, lb) ### Description Traces out the bonds identified by labels `la` and `lb`. Returns a reference to the resulting tensor after the partial trace operation. ### Parameters #### Path Parameters - **la** - Label of the first bond to trace out. - **lb** - Label of the second bond to trace out. ### Returns - A reference to the UniTensor after the partial trace. ### Return Type - float * ``` -------------------------------- ### assign Source: https://uni10-tutorials.readthedocs.io/en/latest/pyUni10.UniTensor.html Restructures the UniTensor with new bonds and clears its content. ```APIDOC ## UniTensor.assign(bds) ### Description Restructures the UniTensor with the provided bonds and clears all existing content. ### Parameters #### Path Parameters - **bds** (array of Bonds) - List of bonds to restructure with ### Returns - A UniTensor object restructured with the new bonds. ### Return Type - UniTensor ``` -------------------------------- ### inBondNum Source: https://uni10-tutorials.readthedocs.io/en/latest/pyUni10.UniTensor.html Returns the number of incoming bonds in the UniTensor. ```APIDOC ## UniTensor.inBondNum() ### Description Returns the count of incoming bonds associated with the UniTensor. ### Returns - The number of incoming bonds. ### Return Type - int ``` -------------------------------- ### UniTensor.setElem Source: https://uni10-tutorials.readthedocs.io/en/latest/pyUni10.UniTensor.html Assigns elements to the UniTensor, replacing the original elements. ```APIDOC ## UniTensor.setElem ### Description Assigns the elements to UniTensor, replacing the originals. ### Method `setElem(elem)` ### Parameters #### Path Parameters * **elem** (array of float) - Required - The elements to assign. ``` -------------------------------- ### Qnum.U1() Source: https://uni10-tutorials.readthedocs.io/en/latest/pyUni10.Qnum.html Returns the U1 quantum number of the Qnum object. ```APIDOC ## Qnum.U1() ### Description Returns the U1 quantum number. ### Returns - U1 quantum number ### Return Type - int ``` -------------------------------- ### Matrix.inverse() Source: https://uni10-tutorials.readthedocs.io/en/latest/pyUni10.Matrix.html Returns the inverse matrix of the current Matrix. ```APIDOC ## Matrix.inverse() ### Description Returns the inverse matrix of the current Matrix. ### Returns - **Matrix** - inverse matrix of the Matrix ``` -------------------------------- ### blockQnum Source: https://uni10-tutorials.readthedocs.io/en/latest/pyUni10.UniTensor.html Retrieves the quantum number(s) of a specific block or all blocks. ```APIDOC ## UniTensor.blockQnum([idx]) ### Description Returns the quantum number of the specified block index. If no index is provided, it returns a list of all quantum numbers associated with the blocks. ### Parameters #### Path Parameters - **idx** (int) - The index of the block (optional) ### Returns - The quantum number(s) of the block(s). ### Return Type - (array of) Qnum ``` -------------------------------- ### bondNum Source: https://uni10-tutorials.readthedocs.io/en/latest/pyUni10.UniTensor.html Returns the total number of bonds in the UniTensor. ```APIDOC ## UniTensor.bondNum() ### Description Returns the total number of bonds present in the UniTensor. ### Returns - The total number of bonds. ### Return Type - int ``` -------------------------------- ### getRawElem Source: https://uni10-tutorials.readthedocs.io/en/latest/pyUni10.UniTensor.html Returns the raw elements of the UniTensor based on incoming and outgoing bond definitions. ```APIDOC ## UniTensor.getRawElem() ### Description Returns the raw elements of the UniTensor. The row and column basis are defined by the incoming and outgoing bonds, respectively. ### Returns - The raw elements of the UniTensor. ### Return Type - Matrix ``` -------------------------------- ### UniTensor.putBlock Source: https://uni10-tutorials.readthedocs.io/en/latest/pyUni10.UniTensor.html Assigns the elements of a Matrix to a specific block of the UniTensor identified by its Qnum. ```APIDOC ## UniTensor.putBlock ### Description Assigns the elements of Matrix mat into the block with Qnum qnum of UniTensor. If qnum is not given, assigns to Qnum(0) block. ### Method `putBlock([qnum, ]mat)` ### Parameters #### Path Parameters * **qnum** (Qnum) - Required - quantum number of the block being assigned to * **mat** (Matrix) - Required - matrix to be assigned. ``` -------------------------------- ### pyUni10.combine Source: https://uni10-tutorials.readthedocs.io/en/latest/pyUni10.combine.html Combines bonds of a specified type (BD_IN or BD_OUT) from a list of bonds into a single combined bond. ```APIDOC ## pyUni10.combine ### Description Combines bonds of a specified type (BD_IN or BD_OUT) from a list of bonds into a single combined bond. ### Method N/A (Python function) ### Parameters #### Path Parameters None #### Query Parameters None #### Request Body None ### Parameters * **tp** (BondType) - Required - Specifies the type of bond to combine (BD_IN/BD_OUT). * **bds** (array of bonds) - Required - A list of bonds to be combined. ### Returns * **combined bond** (Bond) - The resulting combined bond. ### Request Example None (Python function call) ### Response #### Success Response * **combined bond** (Bond) - The combined bond object. #### Response Example None (Python function return value) ``` -------------------------------- ### UniTensor.hosvd (version 1) Source: https://uni10-tutorials.readthedocs.io/en/latest/pyUni10.UniTensor.html Performs High-order SVD of UniTensor using group labels and groups. ```APIDOC ## UniTensor.hosvd (version 1) ### Description Performs High-order SVD of UniTensor. ### Method hosvd(group_labels, groups, groupSize, Ls) ### Parameters #### Path Parameters * **group_labels** (array of int) - Required - Ordered labels of the bonds * **groups** (list) - Required - Number of external bonds in each mode * **groupSize** (int) - Required - Number of modes * **Ls** (array of Matrix) - Required - Singular values in each direction ### Returns * **array** - Array of unitaries, and the core tensor. ``` -------------------------------- ### Qnum.prt() Source: https://uni10-tutorials.readthedocs.io/en/latest/pyUni10.Qnum.html Returns the parity quantum number of the Qnum object. ```APIDOC ## Qnum.prt() ### Description Returns the parity quantum number. ### Returns - PRT_EVEN or PRT_ODD ### Return Type - parityType ``` -------------------------------- ### Bond.degeneracy() Source: https://uni10-tutorials.readthedocs.io/en/latest/pyUni10.Bond.html Returns a dictionary where keys are quantum numbers and values are their corresponding degeneracy counts. ```APIDOC ## Bond.degeneracy() ### Description Returns a dictionary of quantum numbers as the key and the correspoding number of degeneracy as the value ({Qnum: int}). ### Returns dictionary of quantum number:degeracy pairs ### Return type dict ({Qnum: int}) ``` -------------------------------- ### Matrix.randomize() Source: https://uni10-tutorials.readthedocs.io/en/latest/pyUni10.Matrix.html Assigns random elements to the Matrix. ```APIDOC ## Matrix.randomize() ### Description Assigns random elements to the Matrix. ### Returns - **Matrix** - Matrix of random elements ``` -------------------------------- ### Matrix.orthoRand() Source: https://uni10-tutorials.readthedocs.io/en/latest/pyUni10.Matrix.html Generates an orthogonal basis with random elements and assigns it to the elements of the Matrix. ```APIDOC ## Matrix.orthoRand() ### Description Generates an orthogonal basis with random elements and assigns it to the elements of the Matrix. ### Returns - **Matrix** - Matrix of orthogonal basis ``` -------------------------------- ### Matrix.set_zero() Source: https://uni10-tutorials.readthedocs.io/en/latest/pyUni10.Matrix.html Sets all elements of the Matrix to zero. ```APIDOC ## Matrix.set_zero() ### Description Set elements of the Matrix to zero. ### Parameters #### Path Parameters - **elem** (array of floats) - Required - data ``` -------------------------------- ### blockNum Source: https://uni10-tutorials.readthedocs.io/en/latest/pyUni10.UniTensor.html Returns the total number of blocks within the UniTensor. ```APIDOC ## UniTensor.blockNum() ### Description Returns the total number of blocks present in the UniTensor. ### Returns - The total number of blocks. ### Return Type - int ``` -------------------------------- ### UniTensor.hosvd (version 2) Source: https://uni10-tutorials.readthedocs.io/en/latest/pyUni10.UniTensor.html Performs High-order SVD of UniTensor specifying mode number and fixed number of bonds. ```APIDOC ## UniTensor.hosvd (version 2) ### Description Performs High-order SVD of UniTensor. ### Method hosvd(modeNum, fixedNum, Ls) ### Parameters #### Path Parameters * **modeNum** (int) - Required - Number of output modes * **fixedNum** (int) - Required - Number of bonds to remain unchanged * **Ls** (array of Matrix) - Required - Singular values in each direction ### Returns * **array** - Array of unitaries, and the core tensor. ``` -------------------------------- ### Matrix.eigh() Source: https://uni10-tutorials.readthedocs.io/en/latest/pyUni10.Matrix.html Diagonalizes a symmetric/hermitian Matrix and returns a tuple of matrices (D,UD,U), where DD is a diagonal matrix of eigenvalues and UU is a matrix of row-vectors of eigenvectors. This function does not check if the matrix is symmetric/hermitian. ```APIDOC ## Matrix.eigh() ### Description Diagonalizes a symmetric/hermitian Matrix and returns a tuple of matrices (D,UD,U), where DD is a diagonal matrix of eigenvalues and UU is a matrix of row-vectors of eigenvectors. This function does not check if the matrix is symmetric/hermitian. ### Returns - **tuple of Matrix** - DD: diagonal matrix of eigenvalues, UU: matrix of eigenvectors ``` -------------------------------- ### UniTensor.randomize Source: https://uni10-tutorials.readthedocs.io/en/latest/pyUni10.UniTensor.html Assigns random numbers between 0 and 1 to the elements of the UniTensor. ```APIDOC ## UniTensor.randomize ### Description Assigns random numbers between 0 and 1 to the elements of UniTensor. ### Method `randomize()` ### Parameters None ``` -------------------------------- ### Matrix.col() Source: https://uni10-tutorials.readthedocs.io/en/latest/pyUni10.Matrix.html Returns the number of columns in the Matrix. ```APIDOC ## Matrix.col() ### Description Returns the number of columns in the Matrix. ### Returns - **int** - number of columns in the Matrix ``` -------------------------------- ### Matrix.row() Source: https://uni10-tutorials.readthedocs.io/en/latest/pyUni10.Matrix.html Returns the number of rows in the Matrix. ```APIDOC ## Matrix.row() ### Description Returns the number of rows in the Matrix. ### Returns - **int** - number of rows in the Matrix ``` -------------------------------- ### Bond.dim() Source: https://uni10-tutorials.readthedocs.io/en/latest/pyUni10.Bond.html Returns the total dimension of the Bond. ```APIDOC ## Bond.dim() ### Description Returns the total dimension of _Bond_ ### Returns dimension of _Bond_ ### Return type int ``` -------------------------------- ### Matrix.conj Source: https://uni10-tutorials.readthedocs.io/en/latest/pyUni10.Matrix.html Performs in-place complex conjugation of all elements in the matrix. ```APIDOC ## Matrix.conj ### Description Performs in-place complex conjugation of elements in Matrix. ### Method `conj()` ### Returns - **Matrix** - The matrix with complex conjugated elements. ``` -------------------------------- ### permute Source: https://uni10-tutorials.readthedocs.io/en/latest/pyUni10.UniTensor.html Permutes the order of bonds and adjusts the number of incoming bonds. ```APIDOC ## UniTensor.permute([new_label, ]inBondNum) ### Description Permutes the order of the bonds according to `new_label` and adjusts the number of incoming bonds to `inBondNum`. Returns a reference to the permuted UniTensor. ### Parameters #### Path Parameters - **new_label** (list) - The new order of bond labels (optional). - **inBondNum** (int) - The new number of incoming bonds. ### Returns - A reference to the permuted UniTensor. ### Return Type - float * ``` -------------------------------- ### UniTensor.setName Source: https://uni10-tutorials.readthedocs.io/en/latest/pyUni10.UniTensor.html Assigns a name to the UniTensor. ```APIDOC ## UniTensor.setName ### Description Assigns name to UniTensor. ### Method `setName(name)` ### Parameters #### Path Parameters * **name** (str) - Required - The name to assign. ``` -------------------------------- ### orthoRand Source: https://uni10-tutorials.readthedocs.io/en/latest/pyUni10.UniTensor.html Randomly generates orthogonal bases and assigns them to the blocks. ```APIDOC ## UniTensor.orthoRand() ### Description Randomly generates orthogonal bases and assigns them to the blocks within the UniTensor. ### Returns - None. Modifies the UniTensor in-place. ``` -------------------------------- ### UniTensor.setRawElem Source: https://uni10-tutorials.readthedocs.io/en/latest/pyUni10.UniTensor.html Assigns raw (non-block-diagonal) elements to the UniTensor. ```APIDOC ## UniTensor.setRawElem ### Description Assigns raw elements (non-block-diagonal) to UniTensor. ### Method `setRawElem(rawElem)` ### Parameters #### Path Parameters * **rawElem** (array of float) - Required - The input elements. ``` -------------------------------- ### UniTensor.similar Source: https://uni10-tutorials.readthedocs.io/en/latest/pyUni10.UniTensor.html Tests whether the UniTensor is similar to another UniTensor (Tb). Two tensors are similar if their bonds are exactly the same. ```APIDOC ## UniTensor.similar ### Description Tests whether the UniTensor is similar to input tensor Tb. Two tensors are said to be similar if the bonds of the tensors are exactly the same. ### Method `similar(Tb)` ### Parameters #### Path Parameters * **Tb** (UniTensor) - Required - The tensor to be compared to. ### Returns * **bool** - True if UniTensor and Tb are similar. ``` -------------------------------- ### UniTensor Constructor (Scalar) Source: https://uni10-tutorials.readthedocs.io/en/latest/pyUni10.UniTensor.html Constructs a rank-0 tensor (scalar) with an initial value. ```APIDOC ## UniTensor() ### Description Constructs a rank-0 tensor (scalar). ### Parameters #### Path Parameters - **val** (float) - Initial value ### Returns - a rank-0 tensor (scalar) ### Return Type - UniTensor ``` -------------------------------- ### Qnum.prtF() Source: https://uni10-tutorials.readthedocs.io/en/latest/pyUni10.Qnum.html Returns the fermionic parity quantum number of the Qnum object. ```APIDOC ## Qnum.prtF() ### Description Returns the fermionic parity quantum number. ### Returns - PRTF_EVEN or PRTF_ODD ### Return Type - parityFType ``` -------------------------------- ### UniTensor.setLabel Source: https://uni10-tutorials.readthedocs.io/en/latest/pyUni10.UniTensor.html Assigns new labels to the bonds of the UniTensor, replacing the original labels. ```APIDOC ## UniTensor.setLabel ### Description Assigns new_labels to the bonds of UniTensor, replacing the originals. ### Method `setLabel(new_labels)` ### Parameters #### Path Parameters * **new_labels** (array of int) - Required - The new labels to assign. ``` -------------------------------- ### Matrix.max Source: https://uni10-tutorials.readthedocs.io/en/latest/pyUni10.Matrix.html Returns the maximum value among all elements in the matrix. ```APIDOC ## Matrix.max ### Description Returns the maximum matrix element. ### Method `max()` ### Returns - **float** - The maximum element in the matrix. ``` -------------------------------- ### identity Source: https://uni10-tutorials.readthedocs.io/en/latest/pyUni10.UniTensor.html Sets diagonal elements to 1 and off-diagonal to 0, optionally for a specific block. ```APIDOC ## UniTensor.identity([qnum]) ### Description Sets the diagonal elements to 1 and off-diagonal elements to 0 in all blocks. If a quantum number `qnum` is provided, this operation is applied only to the block corresponding to that `qnum`. ### Parameters #### Path Parameters - **qnum** (Qnum) - The quantum number specifying the block to modify (optional). ### Returns - None. Modifies the UniTensor in-place. ``` -------------------------------- ### Network.putTensorT Source: https://uni10-tutorials.readthedocs.io/en/latest/pyUni10.Network.html Replaces a tensor in the network, identified by its index or name, with the transpose of a new UniTensor. The force flag determines if the contraction sequence is reconstructed. ```APIDOC ## Network.putTensorT ### Description Replaces the tensor of index idx / name tname in the network file with the transpose of T. If the force flag is set, the tensor will be put in the network without reconstructing the pair-wise contraction sequence. ### Parameters * **idx** (int) – sequential index of a tensor in Network * **name** (str) – name of a tensor in Network * **T** (UniTensor) – tensor to be put into Network * **force** (bool) – if set True, the contraction sequence is not reconstructed ``` -------------------------------- ### Matrix.absMaxNorm Source: https://uni10-tutorials.readthedocs.io/en/latest/pyUni10.Matrix.html Normalizes the matrix in-place such that the element with the maximum absolute value becomes 1. This method is applicable only to Real matrices. ```APIDOC ## Matrix.absMaxNorm ### Description Normalizes the Matrix such that the maximum matrix element has absolute value 1. ### Method `absMaxNorm()` ### Returns - **Matrix** - The normalized matrix. ### Note This method only works for Real matrix. ``` -------------------------------- ### UniTensor.set_zero Source: https://uni10-tutorials.readthedocs.io/en/latest/pyUni10.UniTensor.html Sets all elements of the UniTensor to zero. ```APIDOC ## UniTensor.set_zero ### Description Sets the elements of UniTensor to zero. ### Method `set_zero()` ### Parameters None ``` -------------------------------- ### Matrix.norm() Source: https://uni10-tutorials.readthedocs.io/en/latest/pyUni10.Matrix.html Returns the L2L2 norm of the Matrix. ```APIDOC ## Matrix.norm() ### Description Returns the L2L2 norm of the Matrix. ### Returns - **float** - L2L2 norm of the Matrix ``` -------------------------------- ### Matrix.cTranspose Source: https://uni10-tutorials.readthedocs.io/en/latest/pyUni10.Matrix.html Performs in-place Hermitian conjugate (conjugate transpose) of a complex matrix, swapping rows and columns. ```APIDOC ## Matrix.cTranspose ### Description Performs in-place Hermitian conjugate of a Complex Matrix. The number of rows and the number of columns are exchanged. ### Method `cTranspose()` ### Returns - **Matrix** - The Hermitian conjugate of the matrix. ``` -------------------------------- ### Define Particle Parity Odd Source: https://uni10-tutorials.readthedocs.io/en/latest/pyUni10.PRTF_ODD.html Sets the pyUni10.PRTF_ODD constant to 1. This value is used to define odd parity for particles within a fermionic system. ```python pyUni10.PRTF_ODD = 1 ``` -------------------------------- ### Bond.type() Source: https://uni10-tutorials.readthedocs.io/en/latest/pyUni10.Bond.html Returns the type of the Bond, which is either BD_IN or BD_OUT. ```APIDOC ## Bond.type() ### Description Returns the type of _Bond_ ### Returns BD_IN / BD_OUT ### Return type BondType ``` -------------------------------- ### Matrix.absMax Source: https://uni10-tutorials.readthedocs.io/en/latest/pyUni10.Matrix.html Returns the element with the maximum absolute value in the matrix. This method is applicable only to Real matrices. ```APIDOC ## Matrix.absMax ### Description Returns the matrix element with the maximum absolute value. ### Method `absMax()` ### Returns - **float** - The matrix element with the maximum absolute value. ### Note This method only works for Real matrix. ``` -------------------------------- ### Network.putTensor Source: https://uni10-tutorials.readthedocs.io/en/latest/pyUni10.Network.html Replaces a tensor in the network, identified by its index or name, with a new UniTensor. The force flag determines if the contraction sequence is reconstructed. ```APIDOC ## Network.putTensor ### Description Replaces the tensor of index idx / name tname in the network file with T. If the force flag is set, the tensor will be put in the network without reconstructing the pair-wise contraction sequence. ### Parameters * **idx** (int) – sequential index of a tensor in Network * **name** (str) – name of a tensor in Network * **T** (UniTensor) – tensor to be put into Network * **force** (bool) – if set True, the contraction sequence is not reconstructed ``` -------------------------------- ### Matrix.isDiag() Source: https://uni10-tutorials.readthedocs.io/en/latest/pyUni10.Matrix.html Checks whether the Matrix is diagonal. ```APIDOC ## Matrix.isDiag() ### Description Checks whether the Matrix is diagonal. ### Returns - **bool** - True or False ``` -------------------------------- ### Matrix.typeID Source: https://uni10-tutorials.readthedocs.io/en/latest/pyUni10.Matrix.html Returns the data type identifier of the matrix elements. ```APIDOC ## Matrix.typeID ### Description Returns datatype of Matrix. ### Method `typeID()` ### Returns - **int** - The datatype identifier (CTYPE or RTYPE) of the matrix elements. ``` -------------------------------- ### pyUni10.contract Source: https://uni10-tutorials.readthedocs.io/en/latest/pyUni10.contract.html Contracts two UniTensors, Ta and Tb, by their common labels. This operation is memory-efficient as it permutes the tensors in-place without copying. ```APIDOC ## pyUni10.contract ### Description Contracts two UniTensors, Ta and Tb, by their common labels. This operation is memory-efficient as it permutes the tensors in-place without copying. ### Method N/A (Python function) ### Signature `pyUni10.contract(_Ta_, _Tb_, _fast=False_)` ### Parameters #### Arguments - **Ta** (_UniTensor_) - The first UniTensor to contract. - **Tb** (_UniTensor_) - The second UniTensor to contract. - **fast** (_bool_) - If True, Ta and Tb will not be permuted back to their original labels after contraction. Defaults to False. ### Returns - **UniTensor** - A new UniTensor representing the result of the contraction with remaining bonds. ``` -------------------------------- ### pyUni10.otimes Source: https://uni10-tutorials.readthedocs.io/en/latest/pyUni10.otimes.html Computes the tensor product of two matrices or UniTensors. This function takes two arguments, Ta and Tb, which can be either Matrix or UniTensor objects, and returns their tensor product. ```APIDOC ## pyUni10.otimes ### Description Tensor product of two matrices/tensors. ### Method Not applicable (Python function) ### Parameters #### Arguments - **Ta** (Matrix / UniTensor) - The first matrix or UniTensor. - **Tb** (Matrix / UniTensor) - The second matrix or UniTensor. ### Returns - **tensor product** (Matrix / UniTensor) - The result of the tensor product of Ta and Tb. ``` === COMPLETE CONTENT === This response contains all available snippets from this library. No additional content exists. Do not make further requests.