wavepacket.typing

Several aliases and definitions for type checking.

Attributes

AnyData

Generic helper for functions that return real/complex output on real/complex input, respectively.

ComplexData

Type for complex-valued input or output data.

RealData

Type for real-valued input or output data.

Generator

A callable that transforms an real-valued input into complex-valued output.

RealGenerator

Similar to Generator, but outputs real-value data.

Package Contents

wavepacket.typing.AnyData

Generic helper for functions that return real/complex output on real/complex input, respectively.

type wavepacket.typing.ComplexData = npt.NDArray[np.float64] | npt.NDArray[np.complex128]

Type for complex-valued input or output data.

Note that all client places should be able to consume real-valued data as well.

type wavepacket.typing.RealData = npt.NDArray[np.float64]

Type for real-valued input or output data.

type wavepacket.typing.Generator = Callable[[RealData], ComplexData]

A callable that transforms an real-valued input into complex-valued output.

Typical applications are transformations from grids or a time series, for example for creating initial wave functions or potentials.

type wavepacket.typing.RealGenerator = Callable[[RealData], RealData]

Similar to Generator, but outputs real-value data.

This is meant for cases where we deliberately want to constrain the values.