gpe.gpu.bases#
Updated bases with GPU support.
Classes#
dim-dimensional periodic bases. |
|
1-dimensional basis for radial problems. |
|
2D basis for Cylindrical coordinates via a DVR basis. |
Module Contents#
- class PeriodicBasisGPU(Nxyz, Lxyz, symmetric_lattice=False, axes=None, smoothing_cutoff=0.8, memoization_GB=0.5, _test=False, **_kw)[source]#
Bases:
mmfutils.math.bases.PeriodicBasisdim-dimensional periodic bases.
- Parameters:
Nxyz ((Nx, Ny, ...)) – Number of lattice points in basis.
Lxyz ((Lx, Ly, ...)) – Size of each dimension (length of box and radius)
symmetric_lattice (bool) – If True, then shift the lattice so that it is symmetric about the origin. The default is to ensure that there is a lattice point at the origin which will make the lattice asymmetric for even Nxyz.
axes ((int, int, ...)) – Axes in array y which correspond to the x, y, … axes here. This is required for cases where y has additional dimensions. The default is the last dim axes (best for performance).
smoothing_cutoff (float) – Fraction of maximum momentum used in the function smooth(). The current implementation is a spherically symmetric truncation in momentum space. A smoothing_cutoff of 0.5 is suitable for the TGPE as is 2/3 if the density is additionally truncated at each step. (For details, see https://doi.org/10.1103%2Fphysreve.83.066311)
memoization_GB (float) – Memoization threshold. If memoizing factors like the momentum and smoothing factor would exceed this threshold, then memoization is disabled.
- class SphericalBasis(N, R)[source]#
Bases:
mmfutils.math.bases.SphericalBasis1-dimensional basis for radial problems.
We represent exactly N positive abscissa, excluding the origin and use the discrete sine transform. We represent the square-root of the wavefunctions here so that a factor of r is required to convert these into the radial functions. Unlike the DVR techniques, this approach allows us to compute the Coulomb interaction for example.
- laplacian(y, factor=None, factors=None, exp=False)[source]#
Return the laplacian of y times factor or the exponential of this.
- Parameters:
factor (float | None) – Additional factor(s) (mostly used with exp=True). The implementation must be careful to allow the factor to broadcast across the components.
factors ([float] | None) – Tuple of scale factors for each dimension. Allows for independent scaling of each direction (used in expanding reference frames).
exp (bool) – If True, then compute the exponential of the laplacian. This is used for split evolvers.
- class CylindricalBasis(Nxr, Lxr, axes=(-2, -1), symmetric_x=True, **_kw)[source]#
Bases:
mmfutils.math.bases.CylindricalBasis2D basis for Cylindrical coordinates via a DVR basis.
This represents 3-dimensional problems with axial symmetry, but only has two dimensions (x, r).
- Parameters:
- apply_exp_K(y, factor, factors=None, kx2=None, **_kw)[source]#
Return exp(K*factor)*y or return precomputed data if K_data is None.
- integrate2(n, y=None, Nz=100)[source]#
Return the integral of n over z (line-of-sight integral) at y.
This is an Abel transform, and is used to compute the 1D line-of-sight integral as would be seen by a photographic image through an axial cloud.
- Parameters:
n (array) – (Nx, Nr) array of the function to be integrated tabulated on the abscissa. Note: the extrapolation assumes that n = abs(psi)**2 where psi is well represented in the basis.
y (array, None) – Ny points at which the resulting integral should be returned. If not provided, then the function will be tabulated at the radial abscissa.
Nz (int) – Number of points to use in z integral.