Class : HermitianMatrix

class deriving from Matrix

HermitianMatrix :

prototype: HermitianMatrix ()

description:default constructor



HermitianMatrix :

prototype: HermitianMatrix (int , bool zero = false )

description:constructor for an empty matrix


input parameters:
dimension = matrix dimension
zero = true if matrix has to be filled with zeros



HermitianMatrix :

prototype: HermitianMatrix (double* , double* , double* , int dimension )

description:constructor from matrix elements (without duplicating datas)


input parameters:
diagonal = pointer to diagonal element array
realOffDiagonal = pointer to real part of off-diagonal elements
imaginaryOffDiagonal = pointer to imaginary part of off-diagonal elements
dimension = matrix dimension



HermitianMatrix :

prototype: HermitianMatrix (const HermitianMatrix& M )

description:copy constructor (without duplicating datas)


input parameters:
M = matrix to copy



HermitianMatrix :

prototype: HermitianMatrix (const RealTriDiagonalSymmetricMatrix& M )

description:copy constructor from a real tridiagonal symmetric matrix (without duplicating diagonal elements)


input parameters:
M = matrix to copy



~HermitianMatrix :

prototype: ~HermitianMatrix ()

description:destructor



operator = :

prototype: HermitianMatrix& operator = (const HermitianMatrix& M )

description:assignement (without duplicating datas)


input parameters:
M = matrix to copy


return value: reference on modified matrix



operator = :

prototype: HermitianMatrix& operator = (const RealTriDiagonalSymmetricMatrix& M )

description:assignement from a real tridiagonal symmetric matrix (without duplicating datas)


input parameters:
M = matrix to copy


return value: reference on modified matrix



Clone :

prototype: Matrix* Clone ()

description:return pointer on a clone matrix (without duplicating datas)


input parameters:
retrun value = pointer on new matrix



SetMatrixElement :

prototype: void SetMatrixElement (int , int , double x )

description:set a matrix element


input parameters:
i = line position
j = column position
x = new value for matrix element



SetMatrixElement :

prototype: void SetMatrixElement (int , int , const Complex& x )

description:set a matrix element


input parameters:
i = line position
j = column position
x = new value for matrix element



AddToMatrixElement :

prototype: void AddToMatrixElement (int , int , double x )

description:add a value to a matrix element


input parameters:
i = line position
j = column position
x = value to add to matrix element



AddToMatrixElement :

prototype: void AddToMatrixElement (int , int , const Complex& x )

description:add a value a matrix element


input parameters:
i = line position
j = column position
x = value to add to matrix element



Resize :

prototype: void Resize (int , int nbrColumn )

description:Resize matrix


input parameters:
nbrRow = new number of rows
nbrColumn = new number of columns



ResizeAndClean :

prototype: void ResizeAndClean (int , int nbrColumn )

description:Resize matrix and set to zero all elements that have been added


input parameters:
nbrRow = new number of rows
nbrColumn = new number of columns



operator + :

prototype: friend HermitianMatrix operator + (const HermitianMatrix& , const HermitianMatrix& M2 )

description:add two matrices


input parameters:
M1 = first matrix
M2 = second matrix


return value: sum of the two matrices



operator + :

prototype: friend HermitianMatrix operator + (const RealTriDiagonalSymmetricMatrix& , const HermitianMatrix& M2 )

description:add two matrices where the left one is a real tridiagonal symmetric matrix


input parameters:
M1 = left matrix
M2 = right matrix


return value: sum of the two matrices



operator + :

prototype: friend HermitianMatrix operator + (const HermitianMatrix& , const RealTriDiagonalSymmetricMatrix& M2 )

description:add two matrices where the right one is a real tridiagonal symmetric matrix


input parameters:
M1 = left matrix
M2 = right matrix


return value: sum of the two matrices



operator - :

prototype: friend HermitianMatrix operator - (const HermitianMatrix& , const HermitianMatrix& M2 )

description:substract two matrices


input parameters:
M1 = first matrix
M2 = matrix to substract to M1


return value: difference of the two matrices



operator - :

prototype: friend HermitianMatrix operator - (const RealTriDiagonalSymmetricMatrix& , const HermitianMatrix& M2 )

description:substract two matrices where the left one is a real tridiagonal symmetric matrix


input parameters:
M1 = first matrix
M2 = matrix to substract to M1


return value: difference of the two matrices



operator - :

prototype: friend HermitianMatrix operator - (const HermitianMatrix& , const RealTriDiagonalSymmetricMatrix& M2 )

description:substract two matrices where the right one is a real tridiagonal symmetric matrix


input parameters:
M1 = first matrix
M2 = matrix to substract to M1


return value: difference of the two matrices



operator * :

prototype: friend HermitianMatrix operator * (const HermitianMatrix& , double x )

description:multiply a matrix by a real number (right multiplication)


input parameters:
M = source matrix
x = real number to use


return value: product result



operator * :

prototype: friend HermitianMatrix operator * (double , const HermitianMatrix& M )

description:multiply a matrix by a real number (left multiplication)


input parameters:
M = source matrix
x = real number to use


return value: product result



operator / :

prototype: friend HermitianMatrix operator / (const HermitianMatrix& , double x )

description:divide a matrix by a real number (right multiplication)


input parameters:
M = source matrix
x = real number to use


return value: division result



operator += :

prototype: HermitianMatrix& operator += (const HermitianMatrix& M )

description:add two matrices


input parameters:
M = matrix to add to current matrix


return value: reference on current matrix



operator += :

prototype: HermitianMatrix& operator += (const RealTriDiagonalSymmetricMatrix& M )

description:add two matrices where the right one is a real tridiagonal symmetric matrix


input parameters:
M = matrix to add to current matrix


return value: reference on current matrix



operator -= :

prototype: HermitianMatrix& operator -= (const HermitianMatrix& M )

description:substract two matrices


input parameters:
M = matrix to substract to current matrix


return value: reference on current matrix



operator -= :

prototype: HermitianMatrix& operator -= (const RealTriDiagonalSymmetricMatrix& M )

description:substract two matrices where the right one is a real tridiagonal symmetric matrix


input parameters:
M = matrix to substract to current matrix


return value: reference on current matrix



operator *= :

prototype: HermitianMatrix& operator *= (double x )

description:multiply a matrix by a real number


input parameters:
x = real number to use


return value: reference on current matrix



operator /= :

prototype: HermitianMatrix& operator /= (double x )

description:divide a matrix by a real number


input parameters:
x = real number to use


return value: reference on current matrix



MatrixElement :

prototype: Complex MatrixElement (ComplexVector& , ComplexVector& V2 )

description:evaluate matrix element


input parameters:
V1 = vector to left multiply with current matrix
V2 = vector to right multiply with current matrix


return value: corresponding matrix element



Conjugate :

prototype: Matrix* Conjugate (RealMatrix& UnitaryM )

description:conjugate a matrix with an unitary matrix (Ut M U)


input parameters:
UnitaryM = unitary matrix to use


return value: pointer to conjugated matrix



Conjugate :

prototype: HermitianMatrix Conjugate (ComplexMatrix& UnitaryM )

description:conjugate an hermitian matrix with an unitary matrix (Ut M U)


input parameters:
UnitaryM = unitary matrix to use


return value: conjugated matrix



InvConjugate :

prototype: HermitianMatrix InvConjugate (ComplexMatrix& UnitaryM )

description:conjugate an hermitian matrix with an hermitian transposed unitary matrix (U M Ut)


input parameters:
UnitaryM = unitary matrix to use


return value: conjugated matrix



Tr :

prototype: double Tr ()

description:evaluate matrix trace


input parameters:


return value: matrix trace



Det :

prototype: double Det ()

description:evaluate matrix determinant


input parameters:


return value: matrix determinant



Lanczos :

prototype: RealTriDiagonalSymmetricMatrix& Lanczos (int , RealTriDiagonalSymmetricMatrix& , ComplexVector& V1 )

description:Tridiagonalize an hermitian matrix using Lanczos algorithm without re-orthogonalizing base at each step


input parameters:
dimension = maximum iteration number
M = reference on complex tridiagonal hermitian matrix where result has to be stored
V1 = reference on complex vector used as first vector (will contain last produced vector at the end)


return value: reference on complex tridiagonal hermitian matrix



Lanczos :

prototype: RealTriDiagonalSymmetricMatrix& Lanczos (int , RealTriDiagonalSymmetricMatrix& , ComplexMatrix& Q )

description:Tridiagonalize an hermitian matrix using Lanczos algorithm without re-orthogonalizing base at each step


input parameters:
dimension = maximum iteration number
M = reference on real tridiagonal symmetric matrix where result has to be stored
Q = matrix where new orthonormalized base will be stored (first column is used as first vector)


return value: reference on complex tridiagonal hermitian matrix



OrthoLanczos :

prototype: RealTriDiagonalSymmetricMatrix& OrthoLanczos (int , RealTriDiagonalSymmetricMatrix& , ComplexMatrix& , double err = 0.00000001 )

description:Tridiagonalize an hermitian matrix using Lanczos algorithm without re-orthogonalizing base at each step, if during process a
null vector appears then new random vector is evaluated


input parameters:
dimension = maximum iteration number
M = reference on real tridiagonal symmetric matrix where result has to be stored
Q = matrix where new orthonormalized base will be stored (first column is used as first vector)
err = absolute error on vector norm


return value: reference on complex tridiagonal hermitian matrix



Householder :

prototype: RealTriDiagonalSymmetricMatrix& Householder (RealTriDiagonalSymmetricMatrix& , double , ComplexMatrix& Q )

description:Tridiagonalize a hermitian matrix using Householder algorithm and evaluate transformation matrix


input parameters:
M = reference on real tridiagonal symmetric matrix where result has to be stored
err = absolute error on matrix element
Q = matrix where transformation matrix has to be stored


return value: reference on real tridiagonal symmetric matrix



ConvertToSymmetricMatrix :

prototype: RealSymmetricMatrix ConvertToSymmetricMatrix ()

description:store hermitian matrix into a real symmetric matrix (real part as block diagonal element and imaginary part as block off-diagonal element )


input parameters:


return value: real symmetric matrix associated to the hermitian matrix



operator << :

prototype: friend ostream& operator << (ostream& , const HermitianMatrix& P )

description:Output Stream overload


input parameters:
Str = reference on output stream
P = matrix to print


return value: reference on output stream



operator << :

prototype: friend MathematicaOutput& operator << (MathematicaOutput& , const HermitianMatrix& P )

description:Mathematica Output Stream overload


input parameters:
Str = reference on Mathematica output stream
P = matrix to print


return value: reference on output stream



Back to index.