Core¶
Generated from the docstrings in the source code.
grid
¶
wavefunction
¶
WaveFunction3D(grid: Grid3D, psi: np.ndarray = None)
¶
Source code in quantumlab/core/wavefunction.py
slice_xy(z_idx: int = None) -> np.ndarray
¶
Return the probability density slice |ψ|² in the XY plane at z index z_idx.
slice_xz(y_idx: int = None) -> np.ndarray
¶
Return the probability density slice |ψ|² in the XZ plane at y index y_idx.
slice_yz(x_idx: int = None) -> np.ndarray
¶
Return the probability density slice |ψ|² in the YZ plane at x index x_idx.
absorbing_boundary
¶
AbsorbingBoundaryLayer(grid, boundary_width: float, order: int = 3)
¶
Polynomial absorbing boundary layer (ABL) for split-step Fourier simulations.
Applies a smooth mask to the wavefunction near the grid edges to prevent FFT wraparound artifacts from unphysical periodic boundary conditions.
The mask is 1.0 in the interior and transitions to 0.0 over a boundary
region of width boundary_width using a polynomial profile of order order.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
grid
|
Grid1D, Grid2D, or Grid3D
|
The spatial grid. |
required |
boundary_width
|
float
|
Physical width of the absorbing layer at each edge. |
required |
order
|
int
|
Polynomial order of the mask transition. Use 3 (smoothstep) for well-behaved transitions; higher orders give sharper roll-offs but may introduce reflections. Minimum effective order is 3. |
3
|
Source code in quantumlab/core/absorbing_boundary.py
spectral
¶
Dimension-agnostic helpers for spectral (FFT-based) operations on Grid1D / Grid2D / Grid3D. Used by the generic split-operator solver, the eigensolvers and the current/angular-momentum observables.