scqubits.core.oscillator.harm_osc_wavefunction#

scqubits.core.oscillator.harm_osc_wavefunction(n, x, l_osc)[source]#

For given quantum number n=0,1,2,… return the value of the harmonic oscillator wave function \(\psi_n(x) = N H_n(x/l_{osc}) \exp(-x^2/2l_\text{ osc})\), N being the proper normalization factor.

Directly uses scipy.special.pbdv (implementation of the parabolic cylinder function) to mitigate numerical stability issues with the more commonly used expression in terms of a Gaussian and a Hermite polynomial factor.

Parameters:
  • n (int) – index of wave function, n=0 is ground state

  • x (Union[float, ndarray]) – coordinate(s) where wave function is evaluated

  • l_osc (float) – oscillator length, defined via <0|x^2|0> = l_osc^2/2

Return type:

Union[float, ndarray]

Returns:

value of harmonic oscillator wave function