# Expectation value of Hamiltonian on number state [closed]

Hamiltonian is defined by $H_I = \hbar \omega (\hat{a}^+ \hat{a} + 1/2)$

What is the expectation value of the energy on the number state

$$\vert \psi \rangle = \frac{1}{\sqrt{2}} ( \vert 1 \rangle + \vert 2 \rangle )$$

So I think that its

$$\langle E \rangle = \langle \psi \vert H_I \vert \psi \rangle$$

$$= \hbar \omega (\langle \psi \vert \hat{a}^+ \hat{a} \vert \psi \rangle + 1/2)$$

$$= \hbar \omega ((\langle 2 \vert + \langle 1 \vert) \hat{a}^+ \hat{a} (\vert 1 \rangle + \vert 2 \rangle) + 1/2)$$

Now we use that $\hat{n} = \hat{a}^+ \hat{a}$, and then I get confused...does the last expresion become

$$= \hbar \omega (\langle 1 \vert \hat n \vert 1 \rangle + \langle 2 \vert \hat n \vert 2 \rangle + 1/2)$$

or

$$= \hbar \omega (\langle 1 \vert \hat n \vert 1 \rangle +\langle 2 \vert \hat n \vert 2 \rangle +\langle 1 \vert \hat n \vert 2 \rangle + \langle 2 \vert \hat n \vert 1 \rangle + 1/2)$$

EDIT I think I have the answer

E = $$= \hbar \omega (\langle 1 \vert \hat n \vert 1 \rangle +\langle 2 \vert \hat n \vert 2 \rangle +\langle 1 \vert \hat n \vert 2 \rangle + \langle 2 \vert \hat n \vert 1 \rangle + 1/2)$$

Where

$$\langle i \vert \hat n \vert j \rangle = j \langle i \vert j \rangle = j \delta_{ij}$$

So $\langle E \rangle = \hbar \omega (3 + 1/2) = \frac{7 \hbar \omega}{2}$

-

## closed as off-topic by jinawee, Kyle Kanos, Brandon Enright, Jim the Enchanter, BMSApr 13 '14 at 3:13

This question appears to be off-topic. The users who voted to close gave this specific reason:

• "Homework-like questions should ask about a specific physics concept and show some effort to work through the problem. We want our questions to be useful to the broader community, and to future users. See our meta site for more guidance on how to edit your question to make it better" – jinawee, Kyle Kanos, Brandon Enright, Jim the Enchanter, BMS
If this question can be reworded to fit the rules in the help center, please edit the question.

Yep, perfect, that it's exactly! –  Flint72 Apr 12 '14 at 16:23

Well, I guess the answer is it becomes both! You're almost there!

But then the third and fourth terms in your equation will vanish.

So, since $\hat{n}$ is the number operator, a number state, such as $\vert m \rangle$ say will be an 'eigenfunction' or the $\hat{n}$ operator with 'eigenvalue' m.

It seems that you probably already know this judging by how far you've already gotten.

So then we will get

$$\langle E \rangle = \hbar \omega (\langle 1 \vert \hat n \vert 1 \rangle +\langle 2 \vert \hat n \vert 2 \rangle +\langle 1 \vert \hat n \vert 2 \rangle + \langle 2 \vert \hat n \vert 1 \rangle + 1/2)$$

$$= \hbar \omega (\langle 1 \vert (1) \vert 1 \rangle +\langle 2 \vert \hat (2) \vert 2 \rangle +\langle 1 \vert (2) \vert 2 \rangle + \langle 2 \vert (1) \vert 1 \rangle + 1/2)$$

$$= \hbar \omega ( 1 \langle 1 \vert 1 \rangle + 2 \langle 2 \vert 2 \rangle + 2 \langle 1 \vert 2 \rangle + 1 \langle 2 \vert 1 \rangle + 1/2)$$

$$= \hbar \omega ( 1 (1) + 2 (1) + 2 (0) + 1 (0) + 1/2)$$

$$= \hbar \omega ( 3 + 1/2)$$ $$= \frac{7}{2}\hbar \omega$$

This is because the states $\vert n \rangle$ and $\vert m \rangle$ are orthogonal, so their amplitude vanishes.

-