Measuring position and momentum at the same time?

In a non-relativistic quantum mechanical system in an infinite potential well. I try to measure the energy and the position of the system simultaneously. Since, the respective operators do commute according to Heisenberg's uncertainty relation I should be able to measure them both with infinite precision. Now, since I know that there is no potential energy in the well I can use $E=\frac{p^2}{2m}$ since the potential energy is 0 and determine it's momentum provided I know it's mass. But I shouldn't be able know the momentum and position simultaneously with infinite precision! So where am I going wrong?

• What do you mean "There is no energy in the well"?! That the well has it's base at an arbitrary $V_0$ does not mean that the particle in it has to have that $V_0$ as its energy! – ACuriousMind Aug 15 '14 at 14:50
• By no energy in the well I mean the potential energy is V=0 ... Yes the particle can have kinetic energy T and T=V. – drewdles Aug 15 '14 at 14:55
• The notion of "measure A and B simutaneously" where A and B do not commute, is ill defined. – zzz Aug 15 '14 at 16:48
• As clarified in the comments to an answer, the question is based from the wrong understanding that the Energy operator is $E=i\frac{\partial}{\partial t}$, which is not even an operator on the Hilbert space of the particle. – fqq Aug 15 '14 at 18:30

If you are considering a system of a single particle in a potential well with infinitely high walls and with finite width, the energy operator is $H = \frac{p^2}{2m} + V(x)$ where $V(x)$ is the potential energy operator, vanishing inside the well and infinite outside it. Being that $\frac{p^2}{2m}$ does not commute with $x$, how are you saying that the energy and position operators commute? Besides, if that were true than we could place a particle in any point inside the well and the particle would stay there forever.
• $E = i \hbar \frac{d}{dt}$ and $p = -i \hbar \frac{d}{dx}$ where these are partial derivatives hence they do commute – drewdles Aug 15 '14 at 15:22