qimpy.transport.geometry.ParameterGrid

class ParameterGrid(*, material, shape, dimension1=None, dimension2=None, save_rho=False, process_grid, checkpoint_in=(None, ''))

Bases: Geometry

Geometry specification.

Parameters:
  • material (Material)

  • shape (tuple[int, int])

  • dimension1 (Optional[dict[str, dict[str, TensorCompatible]]])

  • dimension2 (Optional[dict[str, dict[str, TensorCompatible]]])

  • save_rho (bool)

  • process_grid (ProcessGrid)

  • checkpoint_in (CheckpointPath)

__init__(*, material, shape, dimension1=None, dimension2=None, save_rho=False, process_grid, checkpoint_in=(None, ''))

Initialize parameter grid parameters.

Parameters:
  • shape (Sequence[int]) – [Input file] Dimensions of parameter grid (always 2D).

  • dimension1 (dict[str, dict[str, Tensor | ndarray | float | Sequence[float]]] | None) – [Input file] Parameter names and values to sweep along dimension 1. The values can be specified with “loop” over explicit values, or “sweep” linearly from the initial to the final value.

  • dimension2 (dict[str, dict[str, Tensor | ndarray | float | Sequence[float]]] | None) – [Input file] Parameter names and values to sweep along dimension 2. Specification is the same as for dimension1.

  • save_rho (bool) – [Input file] Whether to write the full density matrices to the checkpoint file. If not (default), only observables are written to the checkpoint file.

  • material (Material)

  • process_grid (ProcessGrid)

  • checkpoint_in (CheckpointPath)

Return type:

None

Methods

__init__

Initialize parameter grid parameters.

add_child

Construct child object self.`attr_name` of type cls.

add_child_one_of

Invoke add_child on one of several child options in args.

create_values

rho_dot

Return list of drho/dt corresponding to each rho at time t.

save_checkpoint

Save self and all children in hierarchy to cp_path.

update_stash

Stash results for current step for a future save_checkpoint call.

Attributes

rho

Get current values of density matrices.

shape

Dimensions of parameter grid

parameters

Parameters broadcastable with grid

comm

Communicator for real-space split over patches

material

Corresponding material

grid_spacing

Grid spacing used for discretization

contacts

Mapping from SVG contact names to material parameters

quad_set

Original geometry specification from SVG

sub_quad_set

Division into smaller quads for tuning parallelization

patches

Advection for each quad patch local to this process

patch_division

Division of patches over comm

stash

Saved results for collating into fewer checkpoints

dt_max

Maximum stable time step

save_rho

whether to write rho to checkpoint file

child_names

Names of attributes with child objects.

variant_name

Version of children having variants (if any)

rho_dot(rho, t)

Return list of drho/dt corresponding to each rho at time t.

Parameters:
Return type:

TensorList

parameters: dict[str, torch.Tensor]

Parameters broadcastable with grid

shape: tuple[int, int]

Dimensions of parameter grid