LeviCivita , Permutations , InProduct , CrossProduct , ZeroVector , BaseVector , Identity , IsMatrix , Normalize , ZeroMatrix , Transpose , Determinant , DiagonalMatrix , Trace , Inverse , CoFactor , Minor , SolveMatrix , CharacteristicEquation , EigenValues , EigenVectors , IsHermitean , IsUnitary , Linear Algebra

Linear Algebra


LeviCivita({list})

LeviCivita({list}) : "LeviCivita" implements the Levi Civita symbol. This is generally useful for tensor calculus. {list} should be a list of integers, and this function returns 1 if the integers are in successive order, eg. {1,2,3,...} would return 1. Swapping two elements of this list would return -1. So, LeviCivita( {2,1,3} ) would evaluate to -1.


Permutations({list})

Permutations({list}) : Permutations returns a list with all the premutations of the original list.


InProduct(a,b)

InProduct(a,b) (or alternatively a . b) : Calculate the inproduct of two vectors.


CrossProduct(a,b)

CrossProduct(a,b) (or alternatively a X b) : Calculate the crossproduct of two three-dimensional vectors.


ZeroVector(n)

ZeroVector(n) : ZeroVector returns a list with n zeroes.


BaseVector(row,n)

BaseVector(row,n) : BaseVector returns a vector with item row set to 1, the other n-1 set to zero.


Identity(n)

Identity(n) : Identity returns a identity matrix of dimension n x n.


IsMatrix(x)

IsMatrix(x) : Predicates checking if the object x is a matrix.


Normalize(v)

Normalize(v) : Return the normalized vector v.


ZeroMatrix(n,m)

ZeroMatrix(n,m) : Returns a matrix with n rows and m columns, all zeros.


Transpose(M)

Transpose(M) : Return the transpose of a matrix M.


Determinant(M)

Determinant(M) : Return the determinant of a matrix M.


DiagonalMatrix(v)

DiagonalMatrix(v) : Return a square matrix with the elements of vector v on the diagonal of the matrix. All other elements are zero.


Trace(M)

Trace(M) : Return the trace of a matrix M (defined as the sum of the elements on the diagonal of the matrix).


Inverse(M)

Inverse(M) : Return the inverse of matrix M. The determinant of M should be non-zero.


CoFactor(M,i,j)

CoFactor(M,i,j) : This function returns the cofactor of a matrix around the element (i,j). The cofactor is the minor times (-1)^(i+j)


Minor(M,i,j)

Minor(M,i,j) : This function returns the minor of a matrix around the element (i,j). The minor is the determinant of the matrix excluding the ith row and jth column.


SolveMatrix(M,v)

SolveMatrix(M,v) : This function returns the vector x that satisfies the equation "M x = v". The determinant of M should be non-zero.


CharacteristicEquation(matrix,var)

CharacteristicEquation(matrix,var) : calculate characteristic equation of "matrix", using "var". The zeros os this equation are the eigenvalues of the matrix, Det(matrix-I var);


EigenValues

Standard math library
Calling Sequence:
EigenValues(matrix)
Parameters:
matrix - a square matrix
Description:
EigenValues returns the eigenvalues of a matrix. The eigenvalues x of a matrix M are the numbers such that M*v=x*v for some vector.
It first determines the characteristic equation, and then factorizes this equation, returning the roots of the characteristic equation det(matrix-x*identity).
Examples:
In> M:={{1,2},{2,1}}
Out> {{1,2},{2,1}};
In> EigenValues(M)
Out> {3,-1};
See Also:
EigenVectors , CharacteristicEquation ,


EigenVectors

Standard math library
Calling Sequence:
EigenVectors(matrix,eigenvalues) Standard math library
Parameters:
matrix - matrix - a square matrix
eigenvalues - list of eigenvalues as returned by EigenValues
Description:
EigenVectors returns a list of the eigenvectors of a matrix. It uses the eigenvalues and the matrix to set up n equations with n unknowns for each eigenvalue, and then calls Solve to determine the values of each vector.
Examples:
In> M:={{1,2},{2,1}}
Out> {{1,2},{2,1}};
In> e:=EigenValues(M)
Out> {3,-1};
In> EigenVectors(M,e)
Out> {{-ki2/ -1,ki2},{-ki2,ki2}};
See Also:
EigenValues , CharacteristicEquation ,


IsHermitean

Standard math library
Calling Sequence:
IsHermitean(A)
Parameters:
A - square matrix
Description:
IsHermitean(A) returns True if A is Hermitean and False otherwise. A is a Hermitean matrix iff Conjugate(Transpose(A))=A. For real matrices A is tested to be symmetric.
Examples:
In> IsHermitean({{0,I},{-I,0}})
Out> True;
In> IsHermitean({{0,I},{2,0}})
Out> False;
See Also:
IsUnitary ,


IsUnitary

Standard math library
Calling Sequence:
IsUnitary(A)
Parameters:
A - square matrix
Description:
This function tries to find out if A is unitary. Matrix A is orthogonal iff A^(-1) = Transpose(Conjugate(A)). This is equivalent to the fact that the columns of A build an orthonormal system (in respect to the scalar product defined by InProduct).
Examples:
In> IsUnitary({{0,I},{-I,0}})
Out> True;
In> IsUnitary({{0,I},{2,0}})
Out> False;
See Also:
IsHermitean ,