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.

IsVector(x)

IsVector(x) : Predicate checking if the object x is a vector. Note: matrices are also considered vectors, so if x is a matrix, then IsVector(x) will return True.

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);