LeviCivita | The totally anti-symmetric Levi-Civita symbol |
Permutations | Form all permutations of a list |
InProduct | Inner product of vectors |
CrossProduct | Outer product of vectors |
ZeroVector | Create a vector with all zeroes |
BaseVector | Base vector |
Identity | Identity matrix |
ZeroMatrix | Matrix filled with zeroes |
DiagonalMatrix | Construct a diagonal matrix |
IsMatrix | Test whether argument is a matrix |
Normalize | Normalize a vector |
Transpose | Transpose of a matrix |
Determinant | Determinant of a matrix |
Trace | Trace of a matrix |
Inverse | Inverse of a matrix |
Minor | Principal minor of a matrix |
CoFactor | Cofactor of a matrix |
SolveMatrix | Solve a linear system |
CharacteristicEquation | Characteristic polynomial of a matrix |
EigenValues | Eigenvalues of a matrix |
EigenVectors | Eigenvectors of a matrix |
IsHermitean | Test whether a matrix is Hermitean |
IsUnitary | Test whether a matrix is unitary |
SylvesterMatrix | calculate the Sylvester matrix of two polynomials |
In> LeviCivita({1,2,3}) Out> 1; In> LeviCivita({2,1,3}) Out> -1; In> LeviCivita({2,2,3}) Out> 0; |
In> Permutations({a,b,c}) Out> {{a,b,c},{a,c,b},{c,a,b},{b,a,c}, {b,c,a},{c,b,a}}; |
a . b (prec. 3)
In> {a,b,c} . {d,e,f}; Out> a*d+b*e+c*f; |
a X b (prec. 3)
In> {a,b,c} X {d,e,f}; Out> {b*f-c*e,c*d-a*f,a*e-b*d}; |
In> ZeroVector(4) Out> {0,0,0,0}; |
n - dimension of the vector
In> BaseVector(2,4) Out> {0,1,0,0}; |
In> Identity(3) Out> {{1,0,0},{0,1,0},{0,0,1}}; |
m - number of columns
In> ZeroMatrix(3,4) Out> {{0,0,0,0},{0,0,0,0},{0,0,0,0}}; |
In> DiagonalMatrix(1 .. 4) Out> {{1,0,0,0},{0,2,0,0},{0,0,3,0}, {0,0,0,4}}; |
In> IsMatrix(ZeroMatrix(3,4)) Out> True; In> IsMatrix(ZeroVector(4)) Out> False; In> IsMatrix(3) Out> False; |
In> Normalize({3,4}) Out> {3/5,4/5}; In> % . % Out> 1; |
In> Transpose({{a,b}}) Out> {{a},{b}}; |
In> DiagonalMatrix(1 .. 4) Out> {{1,0,0,0},{0,2,0,0},{0,0,3,0}, {0,0,0,4}}; In> Determinant(%) Out> 24; |
In> DiagonalMatrix(1 .. 4) Out> {{1,0,0,0},{0,2,0,0},{0,0,3,0}, {0,0,0,4}}; In> Trace(%) Out> 10; |
In> DiagonalMatrix({a,b,c}) Out> {{a,0,0},{0,b,0},{0,0,c}}; In> Inverse(%) Out> {{(b*c)/(a*b*c),0,0},{0,(a*c)/(a*b*c),0}, {0,0,(a*b)/(a*b*c)}}; In> Simplify(%) Out> {{1/a,0,0},{0,1/b,0},{0,0,1/c}}; |
i, j - positive integers
In> A := {{1,2,3}, {4,5,6}, {7,8,9}}; Out> {{1,2,3},{4,5,6},{7,8,9}}; In> PrettyForm(A); / \ | ( 1 ) ( 2 ) ( 3 ) | | | | ( 4 ) ( 5 ) ( 6 ) | | | | ( 7 ) ( 8 ) ( 9 ) | \ / Out> True; In> Minor(A,1,2); Out> -6; In> Determinant({{2,3}, {8,9}}); Out> -6; |
i, j - positive integers
In> A := {{1,2,3}, {4,5,6}, {7,8,9}}; Out> {{1,2,3},{4,5,6},{7,8,9}}; In> PrettyForm(A); / \ | ( 1 ) ( 2 ) ( 3 ) | | | | ( 4 ) ( 5 ) ( 6 ) | | | | ( 7 ) ( 8 ) ( 9 ) | \ / Out> True; In> CoFactor(A,1,2); Out> 6; In> Minor(A,1,2); Out> -6; In> Minor(A,1,2) * (-1)^(1+2); Out> 6; |
v - a vector
In> A := {{1,2}, {3,4}}; Out> {{1,2},{3,4}}; In> v := {5,6}; Out> {5,6}; In> x := SolveMatrix(A, v); Out> {-4,9/2}; In> A * x; Out> {5,6}; |
var - a free variable
In> DiagonalMatrix({a,b,c}) Out> {{a,0,0},{0,b,0},{0,0,c}}; In> CharacteristicEquation(%,x) Out> (a-x)*(b-x)*(c-x); In> Expand(%,x) Out> (b+a+c)*x^2-x^3-((b+a)*c+a*b)*x+a*b*c; |
It first determines the characteristic equation, and then factorizes this equation, returning the roots of the characteristic equation Det(matrix-x*identity).
In> M:={{1,2},{2,1}} Out> {{1,2},{2,1}}; In> EigenValues(M) Out> {3,-1}; |
eigenvalues - list of eigenvalues as returned by EigenValues
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}}; |
In> IsHermitean({{0,I},{-I,0}}) Out> True; In> IsHermitean({{0,I},{2,0}}) Out> False; |
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).
In> IsUnitary({{0,I},{-I,0}}) Out> True; In> IsUnitary({{0,I},{2,0}}) Out> False; |
SylvesterMatrix(poly1,poly2,variable) |
poly2 - polynomial
variable - variable to express the matrix for
The Sylvester matrix is closely related to the resultant, which is defined as the determinant of the Sylvester matrix. Two polynomials share common roots only if the resultant is zero.
In> ex1:= x^2+2*x-a Out> x^2+2*x-a; In> ex2:= x^2+a*x-4 Out> x^2+a*x-4; In> SylvesterMatrix(ex1,ex2,x) Out> {{1,2,-a,0},{0,1,2,-a},{1,a,-4,0},{0,1,a,-4}}; In> Determinant(%) Out> 16-a^2*a- -8*a-4*a+a^2- -2*a^2-16-4*a; In> Simplify(%) Out> 3*a^2-a^3; |
The above example shows that the two polynomials have common zeros if a=3.