Pseudospectral methods in quantum and statistical mechanics