qimpy.transport.geometry.Advect
- class Advect(*, transformation, grid_size_tot, grid_start, grid_stop, is_reflective, has_apertures, aperture_circles, contact_circles, contact_params, material)
Bases:
object
Real-space advection on a quad-patch with an arbitrary transformation.
- Parameters:
transformation (Callable[[torch.Tensor], torch.Tensor]) –
grid_size_tot (tuple[int, ...]) –
grid_start (tuple[int, ...]) –
grid_stop (tuple[int, ...]) –
is_reflective (np.ndarray) –
has_apertures (np.ndarray) –
aperture_circles (torch.Tensor) –
contact_circles (torch.Tensor) –
contact_params (list[dict]) –
material (Material) –
- __init__(*, transformation, grid_size_tot, grid_start, grid_stop, is_reflective, has_apertures, aperture_circles, contact_circles, contact_params, material)
- Parameters:
transformation (Callable[[Tensor], Tensor]) –
grid_size_tot (tuple[int, ...]) –
grid_start (tuple[int, ...]) –
grid_stop (tuple[int, ...]) –
is_reflective (ndarray) –
has_apertures (ndarray) –
aperture_circles (Tensor) –
contact_circles (Tensor) –
contact_params (list[dict]) –
material (Material) –
- Return type:
None
Methods
Compute rho_dot, given current rho.
Attributes
ghost indices on left/bottom
ghost indices on right/top side
NON_GHOST
currently a constant, but could depend on slope method later
Nx x Ny x 2 Cartesian coordinates
Nx x Ny x 1 sqrt(metric), with extra dimensipm for broadcasting
Nkbb x 2 Cartesian velocities (where Nkbb is flattened k, b, b')
Nx x Ny x Nkbb x 2 mesh coordinate velocities
Maximum stable time step
Integration weight for the flattened density matrix dimensions
Shape of density matrix on patch
Shape of density matrix with ghost padding
current density matrix on this patch
Underlying advection logic
material
Aperture indices for each edge
Material-dependent reflector for each edge that needs one
Contact calculators (multiple possibly) by edge
- rho_dot(rho)
Compute rho_dot, given current rho.
- Parameters:
rho (Tensor) –
- Return type:
Tensor
- GHOST_L = slice(0, 2, None)
ghost indices on left/bottom
- GHOST_R = slice(-2, None, None)
ghost indices on right/top side
- N_GHOST: int = 2
currently a constant, but could depend on slope method later
- V: Tensor
Nx x Ny x Nkbb x 2 mesh coordinate velocities
- aperture_selections: list[Tensor | None]
Aperture indices for each edge
- contactors: list[list[Contact]]
Contact calculators (multiple possibly) by edge
- dt_max: float
Maximum stable time step
- g: Tensor
Nx x Ny x 1 sqrt(metric), with extra dimensipm for broadcasting
- q: Tensor
Nx x Ny x 2 Cartesian coordinates
- reflectors: list[Callable[[Tensor], Tensor] | None]
Material-dependent reflector for each edge that needs one
- rho: Tensor
current density matrix on this patch
- rho_padded_shape: tuple[int, ...]
Shape of density matrix with ghost padding
- rho_shape: tuple[int, ...]
Shape of density matrix on patch
- v: tensor
Nkbb x 2 Cartesian velocities (where Nkbb is flattened k, b, b’)
- v_prime: ScriptModule
Underlying advection logic
- wk: float
Integration weight for the flattened density matrix dimensions