I am having difficulty getting the operators: $$\hat{x}, \hat{p}, \hat{x} ^{2}$$ in matrix form for the Infinite Square Well problem.

Any help on this?

  • 3
    $\begingroup$ You haven’t shown what you have tried. Have you tried to calculate the matrix elements of these operators using the energy eigenfunctions in the position basis? $\endgroup$
    – Ghoster
    Commented Oct 11, 2022 at 3:40
  • $\begingroup$ @Ghoster All I know is how to get that for the harmonic oscillator. but couldn't figure out how to do it for infinite well. For hours trying and searching, but no luck. $\endgroup$ Commented Oct 11, 2022 at 3:56
  • $\begingroup$ $x_{mn}=\langle m|x|n\rangle=\int \psi_m(x)^*\,x\,\psi_n(x)\,dx$. Do the integral. $\endgroup$
    – Ghoster
    Commented Oct 11, 2022 at 4:24

1 Answer 1


Actually the "infinite well" problem, one of the most frequently used examples for an introductory QM course, is in some sense a very hard example because the Hilbert space dimension is infinite.

Intuitively, this corresponds to the fact that the ideal projective measurement $\hat{x}$ can take infinitely many values. This is in sharp contrast to the qubit (two-level) system where you only have two (finite!) possibilities as the measurement outcome. That is basically the reason why you can have a (finite dimension) matrix representation of the operators for qubit systems.

Here, because of the infinite possibility you have, the matrix representation (if you insist) would need to have infinite dimension as well. That is not really a well-defined concept unless you use more sophisticated mathematics like $C^*$-algebra. You would need to deal with commutation relations ($[\hat{x},\hat{p}]=i\hbar$) that cannot be achieved with finite-dimensional matrices.

  • $\begingroup$ Can you please show the steps on how to get the matrix? $\endgroup$ Commented Oct 11, 2022 at 3:57
  • $\begingroup$ My point was that you can't get a normal matrix. It would be infinitely large if you try to make it at all. People may still refer to the "matrix representation", but that is now an abstract object where all the matrix entries M_(i,j) are not labeled with integers (i,j) but real numbers. $\endgroup$
    – Gitef
    Commented Oct 11, 2022 at 18:21

Not the answer you're looking for? Browse other questions tagged or ask your own question.