# Harmonic oscillator in matrix form

1. Jan 28, 2010

### intervoxel

I know that the HO hamiltonian in matrix form using the known eigenvalues is
<i|H|j> = E^j * delta_ij = (j+1/2)hbar*omega*delta_ij, a diagonalized matrix.

How do I set up the non-diagonalized matrix from the potential V=1/2kx^2?

2. Jan 28, 2010

### peteratcam

$$\langle x'|H|x\rangle = \delta(x-x')\left[ -\frac{\hbar^2}{2m}\frac{\partial^2}{\partial x^2} + \frac{1}{2}kx^2\right]$$

Not very interesting, it's what you might think of as the Hamiltonian anyway.

3. Jan 28, 2010

### intervoxel

Nice, peter@cam,

Can you cite a reference for further study?

4. Jan 28, 2010

### peteratcam

Well I can't think of a book reference, although I'm sure some people on this board can.

The hilbert space for a 1-d quantum particle is infinite dimensional. In the energy basis, it is a discretely infinite thing, whereas in the position basis it is continuously infinite.

You just need to get into a habit of thinking about functions as infinite dimensional vectors, and operators as matrices.
It might help you visualise it if you do a discretised case writing out differentiation as a finite difference matrix (eg using Matlab). The hamiltonian above is non-diagonal because differential operators aren't diagonal in the position basis. (even though paradoxically they come attached with a delta function).

Its important to remember that *all* operators should come with two indices. Just as a matrix has two subscripts, an operator on a function can always be thought of as a matrix multiplication by representing it with a kernel:
$$(\mathsf A \mathbf{f})(x) = \int dx' A(x,x')f(x')$$
c.f
$$(\mathsf A v)_i = \sum_j A_{ij}v_j$$

Once you realise that the differential operator is really
$$D(x,x')=\delta(x-x')\frac{d}{dx'}$$
and that the position operator is really
$$X(x,x')=\delta(x-x')x'$$
then the analogy with finite-d linear algebra becomes very clear, and constructing matrix elements doesn't feel as unnatural.

5. Jan 28, 2010

### intervoxel

Thanks for your valuable help. It's clear now.