HILA
|
User guide for custom HILA Matrix class
The Matrix object is simply an \(n \times m\) matrix, where n is the number of rows and m is the number of columns. The goal is to have an object which defines the mathematical definition of a Matrix. For a general array type see Array.
NOTE: n,m are integers and T is a HILA standard type or Complex.
Matrix is defined with the base class Matrix_t (See documentation for details). Vector, RowVector and SquareMatrix are special alias cases of Matrix Class additionally SU and DiagonalMatrix are special cases of Matrix_t. Thus most methods for the aliases and special cases are inherited from Matrix.
The special alias cases have some functions specific to them which are documented on this page while SU and DiagonalMatrix have their own dedicated pages.
NOTE: Construction and assignment is possible only when the assignable values type or it's
element type is compatible with the type T of the Matrix<T> variable.
The multiple ways of constructing and assigning a Matrix object can be viewed on the Object documentation page
A simple example of constructing a Matrix object is as follows:
Array indexing operation for matrices and vectors with Matrix::e
Accessing singular elements is insufficient, but matrix elements are often quite small.
Example for matrix:
Example for vector:
Standard array indexing operation for vectors only with Matrix::operator[]
Access row, column or diagonal elemetns
The arithmetic methods and arithmetic assignment methods hold allot of overloads depending on specific objects they are called for. All cases are documented and should be listed in order on the class page. These can be seen by following the links below.
The following standard arithmetic methods are defined in the usual way for Matrices numbers.
Matrix::abs
Matrix::adjoint
Matrix::conj
Matrix::dagger
Matrix::det
Matrix::det_laplace
Matrix::det_lu
Vector::dot
Matrix::eigen_hermitean
Matrix::exp
Matrix::imag
Matrix::mul_trace
Matrix::mult_by_2x2_left
Matrix::mult_by_2x2_right
Matrix::norm
Matrix::real
Matrix::squarenorm
Matrix::svd
Matrix::svd_pivot
Matrix::trace
Matrix::transpose
There are two random number generators available for the Matrix type.
More detailed description on the functionality for both functions can be read on the Class page.