Core API

torusgrid.FloatLike

alias of Union[floating, float64, float]

torusgrid.ComplexLike

alias of Union[complexfloating, complex128, complex]

torusgrid.PrecisionLike

alias of Union[FloatingPointPrecision, Literal[‘SINGLE’, ‘DOUBLE’, ‘LONGDOUBLE’, ‘single’, ‘double’, ‘longdouble’]]

torusgrid.generate_xk(L: Union[floating, float64, float], N: int, *, center: bool = False, real: bool = False, precision: Union[FloatingPointPrecision, Literal['SINGLE', 'DOUBLE', 'LONGDOUBLE', 'single', 'double', 'longdouble']] = 'double') Tuple[ndarray[Any, dtype[floating]], ndarray[Any, dtype[floating]], floating, floating]

Generate x and k for Fourier transform given system size (L) and number of samples (N)

Parameters
  • L – system size

  • N – number of sample points

  • center – whether to sample from \((-L/2, L/2)\) instead of \((0, L)\)

  • real – if True, the resulting k-space samples be \((0, \Delta k, \dotsb, (N/2+1)\Delta k)\)

  • precision – precision of the generated arrays

Returns

\(x\), \(k\), \(dx\), \(dk\)