# Expectation values and trace math

1. Oct 27, 2007

### cscott

1. The problem statement, all variables and given/known data

How do I get the expectation value of operator $\sigma$ using density matrix $\rho$ in a trace: $Tr\left(\sigma\rho\right)$

I have $\sigma$ and $\rho$ in matrix form but how do I get a number out of the trace?

2. Oct 27, 2007

### nrqed

I am not sure I follow your question. Do you know what it means to take the trace of a matrix?

3. Oct 27, 2007

### cscott

I do if it involves just a bra and ket

i.e. $$Tr\left(|a><b|\right) = <b|a>$$

I've been shown $<\Lambda> = Tr\left(\Lambda\rho\right)$

But I have rho and lambda in matrix form and not as a product of bra's and ket's

4. Oct 27, 2007

### Hurkyl

Staff Emeritus

$$\mathrm{Tr}\left( \sum_i | a_i \rangle \langle b_i| \right) = \sum_i \mathrm{Tr}\left( | a_i \rangle \langle b_i| \right)$$

If you have a matrix, this greatly simplifies. It's just the sum of the diagonal entries.

Last edited: Oct 27, 2007
5. Oct 27, 2007

### cscott

Ahh I remember that now.

So I just take the matrix product $\Lambda\rho$ and then sum the diagonal entries to compute the trace?

6. Oct 27, 2007

### cscott

I got the correct answer. Thanks guys.