def laplacian_2D(psi, dx):
    """
    Calculate a discrete approximation to the laplacian on a
    two dimensional lattice `psi` with lattice constant `dx`.
    Has a stencil of one on each side so the result is a smaller lattice.
    """
    # Doing the laplacian like this avoids temporary arrays.
    result = (-4)*psi[1:-1, 1:-1]
    result += psi[2:, 1:-1]
    result += psi[:-2, 1:-1]
    result += psi[1:-1, 2:]
    result += psi[1:-1, :-2]
    return result / (dx*dx)