How to interpret $\langle x|\hat Q|x'\rangle$ for a quantum mechanical operator $\hat Q$?

I stumbled on this question while answering the following question:

Given a general wavefunction $\psi(x)$ and an operator $\hat Q$, with eigenvalue spectrum $\{q_r\}$ and corresponding eigenfunctions $\{u_r\left(x\right)\}$, show that the expectation value of $\hat Q$ is given by $$\langle\hat Q\rangle = \int_{-\infty}^\infty{\psi^*\hat Q \psi \,dx}$$

I started of with the ususal definition of the expected value and inserted the identity operator in position representation: $$\langle\hat Q\rangle = \langle \psi|\hat Q|\psi\rangle = \langle \psi|\left(\int dx|x\rangle\langle x|\right) \hat Q\left(\int {dx}'|x'\rangle\langle x'|\right)|\psi\rangle$$

Taking $\langle\psi|$ and $|\psi\rangle$ into the integral gives: $$\left(\int dx\langle \psi|x\rangle\langle x|\right) \hat Q\left(\int {dx}'|x'\rangle\langle x'|\psi\rangle\right)$$

Pulling the 2nd integral into the first:$$\int dx\int {dx}'\langle \psi|x\rangle\langle x'|\psi\rangle\langle x| \hat Q|x'\rangle$$

This is the point where I'm stuck. If $\langle x|\hat Q|x'\rangle = \hat Q \delta(x-x')$, then the last expression would evaluate to the answer. However I don't know why this should be true and even if it is true I wouldn't know how to prove this equality.

• It should be $\langle x|\hat Q|x'\rangle=Q(x)\delta(x-x')$ where now $Q(x)$ is a function. – Jon Jan 15 '18 at 13:12
• @ Jon This assumes that $Q$ is diagonal in $x$, which is not true in general – By Symmetry Jan 15 '18 at 13:14
• Ah, thanks. But I was trying to fix the last formula that does not seem correct. – Jon Jan 15 '18 at 13:19

It is not true in general that $\langle x|\hat{Q}|x'\rangle = \hat{Q}\delta(x-x')$. What is happening here is that you are using the symbol $\hat{Q}$ to mean 2 slightly different objects.

What is the relationship between $\hat{p}$ and $-\imath\hbar\frac{\partial}{\partial x}$? We generally say that $$\hat{p} = -\imath\hbar\frac{\partial}{\partial x}$$ however this lead to writing things like $-\imath\hbar\frac{\partial}{\partial x}|\psi\rangle$. The problem with this expression is that $|\psi\rangle$ is not a function of $x$, so we can't talk about its $x$ dependence, let alone differentiate it. The problem here is that $\hat{p}$ operates on the space of states while $-\imath\hbar\frac{\partial}{\partial x}$ operates on the space of wavefunctions. The correct relation between them is $$\langle x|\hat{p}|\psi\rangle = -\imath\hbar\frac{\partial}{\partial x}\langle x|\psi\rangle\;.$$Now there is a very natural relationship between these space \begin{align} \psi(x) &= \langle x|\psi\rangle \\ |\psi\rangle &= \int\mathrm{d}x\;\psi(x)|x\rangle \end{align} so generally identifying operators on the 2 spaces does not cause much confusion.

Now in your case in the problem is that you are using the same symbol $\hat{Q}$ to refer to the operator on both that space of states, eg $\langle x|\hat{Q}|x'\rangle$ and the operator in the space of wavefunctions, eg. $\psi^*\hat{Q}\psi$. The solution is that you must use equivalent of the relation we used for the momentum operator above. This has the slightly confusing form $$\langle x|\hat{Q}|\psi\rangle = \hat{Q}\psi(x)$$ where $\hat{Q}$ operates on kets on the left hand side and on wavefunctions on the right hand side.

Alternatively we can do the equivalent of applying the momentum operator by fourier transforming and then multiplying by $p$. In this case you insert the identity into the above expression to obtain $$\int \mathrm{d}x'\; \langle x|\hat{Q}|x'\rangle\langle x'|\psi\rangle = \hat{Q}\psi(x)$$ where, again, $\hat{Q}$ on the left hand side operates on the space of states and $\hat{Q}$ on the right hand side operates on the space wavefunctions.

• So if I understand this correctly the equation $\langle x|\hat{Q}|\psi\rangle = \hat{Q}\psi(x)$ is basically saying: apply the operator $\hat Q$ to the ket $|\psi \rangle$ and then project this into position space by left multiplying by $\langle x|$. And then this is how the Operator in position representation is defined. And by then inserting the identity we get the last integral, another (equivalent) way of expressing $\hat Q$ in position representation. – 1MegaMan1 Jan 15 '18 at 14:13
• That sounds about right. yes – By Symmetry Jan 15 '18 at 14:22
• Is there any interpretation to what $\langle x|\hat Q|x\rangle$ actually represents? Similar to how $\langle u_r | \hat Q | u_s \rangle$ is the $r,s$ entry of the matrix corresponding to $\hat Q$ in the basis of the $u_r$ eigenvectors of $\hat Q$. – 1MegaMan1 Jan 15 '18 at 14:32
• It is the matrix element of $\hat{Q}$ is the position basis – By Symmetry Jan 15 '18 at 14:37
• So the integral has replaced the usual summation when multiplying a matrix by a vector, because the position space is no longer discrete but continuous? – 1MegaMan1 Jan 15 '18 at 14:49

The question that you were trying to answer is incorrect. If a system is in a state $|\Psi \rangle$ then the expectation values is indeed

$$\langle Q \rangle = \langle \Psi | Q |\Psi \rangle$$

by definition and this is precisely

$$\int dx \int dx' \Psi(x) \Psi^*(x') \langle x |Q | x' \rangle$$

and unless $Q$ commutes with $x$ you in general do not have $\langle x |Q | x' \rangle= Q(x) \delta(x-x')$.

In fact perhaps the trivialest example of an operator that does not commute with position is momentum (Uncertainty principle). Since momementum is a generator of translation we immediate see that the the following translation opearator

$$Q(a) = \int dx~ |x+a \rangle \langle x|$$

is an example of the above for $a \ne 0$.

Further to By Symmetry's answer, from $\int dx' \langle x|\hat{Q}| x'\rangle\psi(x') = \hat{Q}\psi(x)$ we obtain the functional derivative $\langle x|\hat{Q}| x'\rangle=\dfrac{\delta \hat{Q}\psi(x)}{\delta \psi(x')}$. As a sanity check we consider the special case where $\hat{Q}$ is a c-number valued function of $x$. Since $\dfrac{\delta \psi(x)}{\delta \psi(x')}:=\delta(x-x')$, this special case gives the expected $\langle x|\hat{Q}| x'\rangle=Q(x)\delta(x-x')$ since $\dfrac{\delta Q(x)}{\delta \psi(x')}=0$. (If you prefer, you can see this argument as motivating that last equation.)