Skip to content

Spectral Methods

Spectral methods approximate a function by a global expansion in basis functions. In favorable smooth problems, the error can decrease much faster than any fixed-order finite-difference method as the number of modes increases.

The word “spectral” here means a numerical approximation by global modes, such as Fourier or Chebyshev modes. It is not the same topic as the Hilbert-space spectral theorem, although both use expansions in functions or vectors.

Spectral methods are useful when wavefunctions and potentials are smooth enough that a global basis captures the solution efficiently. They appear in:

  • Fourier-grid methods for periodic or large-box wave packets;
  • pseudospectral differentiation in time-dependent Schrödinger equations;
  • harmonic-oscillator basis truncations;
  • Chebyshev approximations on finite intervals;
  • smooth bound-state eigenvalue problems;
  • split-operator and kinetic-energy calculations in momentum space;
  • benchmark calculations where high accuracy is desired.

They are powerful, but not magic. A discontinuity, cusp, sharp boundary, or unresolved phase oscillation can destroy fast convergence.

A spectral approximation writes

ψN(x)=∑n=0N−1cnϕn(x),\psi_N(x) = \sum_{n=0}^{N-1} c_n\phi_n(x),

where the basis functions ϕn\phi_n are chosen to match the domain and boundary behavior.

Common choices include:

  • Fourier modes for periodic intervals;
  • Chebyshev polynomials for finite nonperiodic intervals;
  • Hermite functions for oscillator-like problems on the line;
  • spherical harmonics for angular variables;
  • problem-specific eigenfunctions when a solvable part of the Hamiltonian is known.

The approximation is global: changing one coefficient changes the function across the whole domain.

On a periodic interval, expand

ψ(x)=∑kψ^keikx.\psi(x) = \sum_k \widehat\psi_k e^{ikx}.

Differentiation becomes multiplication in Fourier space:

ψ′^k=ik ψ^k,ψ′′^k=−k2ψ^k.\widehat{\psi'}_k = ik\,\widehat\psi_k, \qquad \widehat{\psi''}_k = -k^2\widehat\psi_k.

Thus the kinetic-energy operator for a free particle is especially simple in momentum representation:

Tψ^k=ℏ2k22mψ^k.\widehat{T\psi}_k = \frac{\hbar^2k^2}{2m} \widehat\psi_k.

This is the numerical version of the position-momentum duality explained in Fourier Transform and Position and Momentum Representations.

In a pseudospectral method, one stores values on a grid but uses global basis information to compute derivatives. For a Fourier pseudospectral method, the transform is usually computed with a Fast Fourier Transform:

  1. Transform grid values ψj\psi_j to Fourier coefficients ψ^k\widehat\psi_k.
  2. Multiply by ikik or −k2-k^2 to differentiate.
  3. Transform back to grid values.

Potential multiplication is usually done in position space:

(Vψ)j=V(xj)ψj.(V\psi)_j=V(x_j)\psi_j.

Kinetic evolution is often easiest in Fourier space. This is why Fourier pseudospectral methods sit naturally behind FFT-based split-operator time evolution. For the full PDE workflow that combines spatial discretization, boundary conditions, time stepping, and convergence tests, see PDE Solvers.

Fourier modes are natural for periodic functions. On a finite interval with nonperiodic boundary behavior, Chebyshev polynomials are often better.

After mapping the physical interval to [−1,1][-1,1], one expands in polynomials Tn(x)T_n(x):

ψN(x)=∑n=0N−1anTn(x).\psi_N(x) = \sum_{n=0}^{N-1} a_n T_n(x).

Chebyshev collocation commonly uses clustered points near the endpoints. This clustering helps resolve boundary layers and endpoint behavior better than an equally spaced polynomial grid.

Boundary conditions are imposed by modifying the coefficient equations, replacing boundary rows, or choosing basis functions that already satisfy the boundary condition.

For analytic periodic functions, Fourier coefficients often decay exponentially:

∣ψ^k∣≲Ce−α∣k∣.\lvert \widehat\psi_k\rvert \lesssim Ce^{-\alpha\lvert k\rvert}.

Truncating after NN modes can then give extremely fast convergence. For functions with only finitely many derivatives, coefficients decay algebraically instead. For discontinuities, the Gibbs phenomenon appears and convergence is much slower near the jump.

This is the central diagnostic: spectral methods are excellent when the expansion coefficients decay rapidly. They are less attractive when coefficients decay slowly.

Many quantum calculations use a finite basis rather than a coordinate grid:

Hmn=⟨ϕm,Hϕn⟩,m,n=0,…,N−1.H_{mn} = \langle \phi_m,H\phi_n\rangle, \qquad m,n=0,\dots,N-1.

When these matrix elements are not analytic, they must be assembled with a quadrature rule accurate enough for the chosen basis; Numerical Quadrature owns those integration-error checks.

The matrix diagonalization then produces approximate eigenstates inside the span of the first NN basis functions.

If the basis is orthonormal and the Hamiltonian is self-adjoint on the relevant domain, the finite matrix is Hermitian. For bound states in a variational basis, low-lying energies can often be monitored as NN increases. If the basis is not orthonormal, the overlap matrix must be included as in Discretization.

Spectral methods care about global regularity. A function that is smooth in the interior but has a kink at the boundary is not spectrally smooth on the whole computational domain.

Examples:

  • a periodic Fourier method expects periodic matching of values and derivatives at the endpoints;
  • a square-well wavefunction with derivative jumps is not a good target for global smooth spectral convergence across the discontinuity;
  • a cusp from a singular potential may require special coordinates or basis functions;
  • a wavefunction with a rapidly oscillatory phase needs enough modes to resolve the local wavenumber.

Choose the basis to match the physics. A poor basis can make a smooth problem look hard.

On a finite grid, products can create modes above the represented cutoff. For example, multiplying V(x)ψ(x)V(x)\psi(x) can mix Fourier modes of VV and ψ\psi. If the resulting high modes are not represented, they can fold back into lower modes. This is aliasing.

Aliasing is especially important for nonlinear equations, but it also matters in linear quantum problems when the potential is rough or under-resolved. Diagnostics include increasing the number of grid points, filtering high modes cautiously, or comparing with a different discretization.

FeatureFinite differencesSpectral methods
approximationlocal stencilsglobal modes
matricesoften sparseoften dense unless using transforms
smooth periodic functionsalgebraic convergenceoften exponential convergence
discontinuitieslocal errorsGibbs oscillations and slow convergence
boundary handlingdirect but row-sensitivebasis- or collocation-sensitive

Finite differences are robust and local. Spectral methods can be dramatically more accurate for smooth problems, but they demand more from smoothness, boundary matching, and global resolution.

Before using a spectral method, ask:

  • Is the target function smooth in the chosen coordinate and basis?
  • Do the boundary conditions match the basis?
  • Do expansion coefficients decay rapidly?
  • Is the grid fine enough to avoid aliasing?
  • Is the potential smooth enough in the same representation?
  • Are low-energy and high-energy states converging differently?
  • Does another discretization give the same physical result?

The safest spectral calculations report coefficient decay or refinement behavior, not only final eigenvalues.

For grid, basis, and observable-level refinement workflows, see Convergence Tests.

  • Confusing numerical spectral methods with the spectral theorem.
  • Using Fourier modes on a nonperiodic function without handling endpoint mismatch.
  • Expecting exponential convergence for discontinuous potentials or wavefunctions with cusps.
  • Trusting high-frequency modes near the grid cutoff.
  • Forgetting that multiplication in position space can generate unresolved Fourier modes.
  • Comparing spectral and finite-difference results at different physical resolutions.
  • Ignoring boundary conditions because the interior approximation looks accurate.
  • Treating a basis truncation error as an eigensolver error.
  • L. N. Trefethen, Spectral Methods in MATLAB, SIAM, 2000.
  • J. P. Boyd, Chebyshev and Fourier Spectral Methods, 2nd ed., Dover, 2001.
  • B. Fornberg, A Practical Guide to Pseudospectral Methods, Cambridge University Press, 1996.
  • C. Canuto, M. Y. Hussaini, A. Quarteroni, and T. A. Zang, Spectral Methods: Fundamentals in Single Domains, Springer, 2006.
  • J. M. Thijssen, Computational Physics, 2nd ed., Cambridge University Press, 2007.
  1. Show that the Fourier mode eikxe^{ikx} is an eigenfunction of the second derivative and identify the eigenvalue.
Solution

Differentiate twice:

ddxeikx=ikeikx,d2dx2eikx=−k2eikx.\frac{d}{dx}e^{ikx} = ik e^{ikx}, \qquad \frac{d^2}{dx^2}e^{ikx} = -k^2e^{ikx}.

Thus eikxe^{ikx} is an eigenfunction of d2/dx2d^2/dx^2 with eigenvalue −k2-k^2.

  1. Why does a Fourier spectral method converge slowly for a function with a jump discontinuity?
Solution

A jump discontinuity makes the Fourier coefficients decay only algebraically rather than exponentially. Truncating the series then leaves visible oscillations near the jump, known as the Gibbs phenomenon. Adding more modes narrows the oscillatory region but does not give the rapid spectral convergence seen for analytic periodic functions.

  1. In a periodic Fourier method, why must endpoint values and derivatives match?
Solution

Fourier modes represent periodic functions. If the values or derivatives do not match at the endpoints of the computational interval, the periodic extension has a jump or kink. That destroys smooth coefficient decay and introduces spurious high-frequency content. The method then approximates the periodic extension, not the original nonperiodic function.

  1. A wavefunction has Fourier coefficients satisfying ∣ψ^k∣∼k−3\lvert\widehat\psi_k\rvert\sim k^{-3}. Should one expect exponential spectral convergence?
Solution

No. Exponential convergence is associated with exponentially decaying coefficients, often for analytic functions. Algebraic coefficient decay such as k−3k^{-3} indicates limited smoothness, so truncation error decreases algebraically with the number of modes.

  1. Why can multiplying by a rough potential cause aliasing in a Fourier pseudospectral calculation?
Solution

Multiplication in position space corresponds to convolution of Fourier coefficients. If the potential has high Fourier components, the product VψV\psi can contain modes above the numerical cutoff. A finite grid cannot represent those modes, so they can fold back into lower modes and contaminate the result. Increasing resolution or changing representation can test the effect.