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

__init__

rho_dot

Compute rho_dot, given current rho.

Attributes

GHOST_L

ghost indices on left/bottom

GHOST_R

ghost indices on right/top side

NON_GHOST

N_GHOST

currently a constant, but could depend on slope method later

q

Nx x Ny x 2 Cartesian coordinates

g

Nx x Ny x 1 sqrt(metric), with extra dimensipm for broadcasting

v

Nkbb x 2 Cartesian velocities (where Nkbb is flattened k, b, b')

V

Nx x Ny x Nkbb x 2 mesh coordinate velocities

dt_max

Maximum stable time step

wk

Integration weight for the flattened density matrix dimensions

rho_shape

Shape of density matrix on patch

rho_padded_shape

Shape of density matrix with ghost padding

rho

current density matrix on this patch

v_prime

Underlying advection logic

material

aperture_selections

Aperture indices for each edge

reflectors

Material-dependent reflector for each edge that needs one

contactors

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