ParaMonte Fortran 2.0.0
Parallel Monte Carlo and Machine Learning Library
See the latest version documentation. |
This module contains procedures and generic interfaces for computing the additive or multiplicative trace of a given square matrix in arbitrary packing formats. More...
Data Types | |
interface | getMatMulTrace |
Generate and return the multiplicative trace of an input square matrix of type integer , complex , or real of arbitrary kind.More... | |
interface | getMatMulTraceLog |
Generate and return the natural logarithm of the multiplicative trace of an input square matrix of type integer , complex , or real of arbitrary kind.More... | |
interface | getMatTrace |
Generate and return the trace of an input square matrix of type integer , complex , or real of arbitrary kind.More... | |
Variables | |
character(*, SK), parameter | MODULE_NAME = "@pm_matrixPack" |
This module contains procedures and generic interfaces for computing the additive or multiplicative trace of a given square matrix in arbitrary packing formats.
In linear algebra, the trace of a square matrix \(A\), denoted \(tr(A)\), is defined to be the sum of elements on the main diagonal (from the upper left to the lower right) of \(A\).
The trace is only defined for a square matrix \((n\times n)\).
It can be proven that the trace of a matrix is the sum of its (complex) eigenvalues (counted with multiplicities).
It can also be proven that \(tr(AB) = tr(BA)\) for any two matrices \(A\) and \(B\).
This implies that similar matrices have the same trace.
As a consequence one can define the trace of a linear operator mapping a finite-dimensional vector space into itself, since all matrices describing such an operator with respect to a basis are similar.
The trace is related to the derivative of the determinant (through Jacobi formula).
The trace of an \((n\times n)\) square matrix \(A\) is defined as,
\begin{equation} \up{tr} (\mathbf {A} ) = \sum_{i=1}^{n}a_{ii} = a_{11} + a_{22} + \dots + a_{nn} ~, \end{equation}
where \(a_{ii}\) denotes the entry on the \(i\)th row and \(i\)th column of \(A\).
The entries of \(A\) can be real numbers or (more generally) complex numbers.
\begin{equation} \up{tre}(A) = \up{tr}(\exp(A)) ~. \end{equation}
\(\up{tre}\) is sometimes referred to as the exponential trace function and is used in the Golden–Thompson inequality.This module additionally also computes the multiplicative trace function of a square-matrix which is defined as,
\begin{equation} \up{trl}(\mathbf{A}) = \prod_{i=1}^{n} a_{ii} = a_{11} \times a_{22} \times \dots \times a_{nn} ~, \end{equation}
where \(a_{ii}\) denotes the entry on the \(i\)th row and \(i\)th column of \(A\).
The entries of \(A\) can be real numbers or (more generally) complex numbers.
This multiplicative definition of trace appears in the computation of the determinant of square positive definite matrices.
Final Remarks ⛓
If you believe this algorithm or its documentation can be improved, we appreciate your contribution and help to edit this page's documentation and source file on GitHub.
For details on the naming abbreviations, see this page.
For details on the naming conventions, see this page.
This software is distributed under the MIT license with additional terms outlined below.
This software is available to the public under a highly permissive license.
Help us justify its continued development and maintenance by acknowledging its benefit to society, distributing it, and contributing to it.
character(*,SK), parameter pm_matrixTrace::MODULE_NAME = "@pm_matrixPack" |
Definition at line 80 of file pm_matrixTrace.F90.