# Calculating expectations values from density matrix in position basis

given I know the density matrix elements in position basis as a function of time.

$$\langle x | \rho(t) |x' \rangle$$

How do I calculate the expection values like $$\langle x^2(t) \rangle$$ or $$\langle p^2(t) \rangle$$ from this?

The expectation values are calculate with this formula

$$\langle \hat A \rangle = Tr(\hat A \rho) = Tr(\rho \hat A).$$

Since the trace is basis-independent you can evaluate the trace in an arbitrary basis $$\{ |n\rangle \}$$

$$Tr(\hat A \rho) = \sum_n \langle n | \hat A \rho | n \rangle = \sum_n \langle n | \hat A \sum_m | m \rangle \langle m |\rho | n \rangle = \sum_{n,m} \langle n | \hat A | m \rangle \langle m | \rho | n \rangle,$$

where we have used a completeness relation $$\sum_m |m \rangle \langle m|$$. Now you can simply use the position basis instead of the arbitrary basis $$\{ |n\rangle \}$$.

I think I got it myself:

$$\rho = \int dx dx' \langle x |\rho| x' \rangle |x \rangle \langle x' |$$

Then it follows:

$$\langle x^2 \rangle = \int dx \langle x |\rho| x \rangle x^2$$,

right?

• Yes, looks good!
– MST
Commented Nov 26, 2019 at 13:39