# Trace in statistical mechanics

## Main Question or Discussion Point

Hi, im just starting a 3rd year course in Statistical Mechanics, and am a bit confused about the operator trace, Tr. I know there is a trace for quantum operators, as well as one in classical physics, but i am not sure how to calculate either, or their physical meaning. Any help would be great, thanks.

Ray

Related Quantum Physics News on Phys.org
Hello rayveldkamp,

The trace of an operator $$\hat{B}$$ is defined as:

$$Tr(\hat{B}) = \sum_{i=1}^{N} <\Psi_{i}| \hat{B} |\Psi_{i}>$$

where the $$|\Psi_{i} >$$ are a complete basis.
You so to say take the sum of the diagonal matrix elements.

Traces are used for example in context with density operators.
You have for example many particles that are in different states.
Take for example an ensemble of electrons (ensemble = many particles)
or atoms in a hot oven.

This ensemble can be described by the density operator:

$$\hat{\rho} = \sum_{i=1}^{N} p_{i} |\Psi_{i}> <\Psi_{i}|$$

where $$p_{i}$$ is the probability (classical probability) of having a particle in the state $$|\Psi_{i}>$$.

Example:
Ensemble of electrons, $$p_{1} =3/4$$ with spin up and $$p_{2}=1/4$$ spin down:

$$\hat{\rho}} = \frac{3}{4} |\uparrow\rangle \langle\uparrow| + \frac{1}{4} |\downarrow \rangle \langle\downarrow|$$

Suppose you want to know what's the mean value of the ensemble for a certain operator $$\hat{A}$$ (for example spin, momentum etc).

This can be done by calculating the trace:

$$<\hat{A}> = Tr(\rho \hat{A}) = \sum_{i=1}^{N} < \Psi_{i}| \hat{\rho} \hat{A} |\Psi_{i}>$$.

Thankyou for that, that clears up a lot of my misunderstanding. In lectures it's been mentioned that trace is the same as summing the diagonal elements of a matrix, however what matrix are we referring to here? So the density operater describes the probabilities of certain states, how is this related to the density matrix, and what is it exactly?
Thanks

Ray

rayveldkamp said:
what matrix are we referring to here?
Let's take for example a matrix $$M$$

$$M = \left( \begin{array}{cc} a & b \\ c & d \\ \end{array} \right)$$

Often the matrix is just denoted as $$M_{lm}$$,
with $$M_{11} = a$$, $$M_{12} = b$$, $$M_{21} = c$$ and $$M_{22} = d$$.
(l=1 or 2, m=1 or 2)

Now what's a matrix of an operator in QM?
The matrix is just defined as

$$A_{lm} = \langle \Phi_{l}|\hat{A}|\Phi_{m} \rangle$$

So if someone asks you to write down the matrix representation
of the operator $$\hat{A}$$, you just have to calculate the matrix elements $$A_{lm}$$ from above and then write them in a matrix form,
for example:

$$A_{lm} = \left( \begin{array}{cc} \langle \Phi_{1}|\hat{A}|\Phi_{1} \rangle & \langle \Phi_{1}|\hat{A}|\Phi_{2} \rangle \\ \langle \Phi_{2}|\hat{A}|\Phi_{1} \rangle & \langle \Phi_{2}|\hat{A}|\Phi_{2} \rangle \\ \end{array} \right)$$

EXAMPLE:
An example is the matrix form of the $$\hat{S}_{z}$$ operator, which describes a spin easurement along the z-axis. You surely have heard of the Pauli spin matrices. (Try to calculate the matrix representation for$$S_{z}$$ or look it up in the Quantum Mechanics book by Cohen Tannoudji, where I found it well described).

rayveldkamp said:
So the density operater describes the probabilities of certain states, how is this related to the density matrix, and what is it exactly?
The density matrix is the matrix form of the density operator, namely

$$\rho_{lm} = \langle \Phi_{l}|\hat{\rho}|\Phi_{m} \rangle$$

rayveldkamp said:
In lectures it's been mentioned that trace is the same as summing the diagonal elements of a matrix
We know that

$$B_{lm} = \langle \Psi_{l}| \hat{B} |\Psi_{m} \rangle$$

What's $$B_{ii}$$?
Answer: $$B_{ii} = \langle \Psi_{i}| \hat{B} |\Psi_{i} \rangle$$

Next step:
The definition of the trace of an operator $$\hat{B}$$
is:

$$Tr(\hat{B}) = \sum_{i=1}^{N} \langle \Psi_{i}| \hat{B} |\Psi_{i} \rangle$$

From this it follows:

$$Tr(\hat{B}) = \sum_{i=1}^{N} B_{ii}$$

What's $$\sum_{i=1}^{N} B_{ii}$$ ?

Well, it's the the sum of the diagonal elements, namely $$B_{11} + B_{22} + B_{33} ...$$

Therefore taking the trace means summing up the diagonal elements.

Thanks, i fully understand now, using the derivation of Pauli spin matrices from last semester i can see how trace works, its just that our lecturer this semester has not really written anything out in matrix form, he's just mentioned it in passing.
Cheers

Ray

hi
this explanation helped me too. but understand that the rule: tr(AB)=tr(BA) works for operators as well and I can't see why

thanks

Ramy

Fredrik
Staff Emeritus
Gold Member
hi
this explanation helped me too. but understand that the rule: tr(AB)=tr(BA) works for operators as well and I can't see why

thanks

Ramy
$$Tr(XY)=\sum_{a'}\langle a'|XY|a'\rangle=\sum_{a'}\sum_{a''}\langle a'|X|a''\rangle\langle a''|Y|a'\rangle =\sum_{a''}\sum_{a'}\langle a''|Y|a'\rangle\langle a'|X|a''\rangle$$

$$=\sum_{a''}\langle a''|YX|a''\rangle=Tr(YX)$$

thanks