Physics with Mathematica

Sixth Class

Start working on your “homework” problems! Come to me if you want to discuss them.

Today: Vectors and Matrices

Mathematica does not have objects identified as vectors or matrices, but it can treat (some) lists as if they were.

Remove["Global`*"]

First let’s define a few lists

v1={x1,y1,z1};
v2={x2,y2,z2};
u={a,b,c,d,e};

Lists are still lists

2v1

1/u

Some lists can be treated as vectors

Dot[v1,v2]

Dot[v1,v2]==v1.v2

Cross[v1,v2]

Norm[u]

Dot[v1,u]

Matrices are lists of lists.

Define a couple of lists to be used as matrices. Note, we will only be making use of square matrices.

a={{a11,a12,a13},{a21,a22,a23},{a31,a32,a33}};
b={{b11,b12,b13},{b21,b22,b23},{b31,b32,b33}};
sigy={{0,-I},{I,0}};

All the standard matrix operations are available

a.b

a.v1

Transpose[a]

ConjugateTranspose[sigy]==sigy

Det[b]

So-called “output forms” can be useful for displaying matrices and vectors.

MatrixForm[a]

MatrixForm[v1]

Eigenvalue problems

There are many applications in physics problems!

Eigenvalues[sigy]

Eigenvectors[sigy]

eigsys=Eigensystem[sigy]

sigy.eigsys[[2]][[1]]==eigsys[[1]][[1]]eigsys[[2]][[1]]

sigy.eigsys[[2]][[2]]==eigsys[[1]][[2]]eigsys[[2]][[2]]

Conjugate[eigsys[[2]][[1]]].eigsys[[2]][[1]]

Conjugate[eigsys[[2]][[1]]].eigsys[[2]][[2]]