qimpy.transport.material.AbInitio

class AbInitio(*, fname, mu=0.0, eph_scatt=True, rotation=((1.0, 0.0, 0.0), (0.0, 1.0, 0.0), (0.0, 0.0, 1.0)), process_grid, checkpoint_in=(None, ''))

Bases: Material

Ab initio material specification.

Parameters:
  • fname (str) –

  • mu (float) –

  • eph_scatt (bool) –

  • rotation (Sequence[Sequence[float]]) –

  • process_grid (ProcessGrid) –

  • checkpoint_in (CheckpointPath) –

__init__(*, fname, mu=0.0, eph_scatt=True, rotation=((1.0, 0.0, 0.0), (0.0, 1.0, 0.0), (0.0, 0.0, 1.0)), process_grid, checkpoint_in=(None, ''))

Initialize ab initio material.

Parameters:
  • fname (str) – [Input file] File name to load materials data from.

  • rotation (Sequence[Sequence[float]]) – [Input file] 3 x 3 rotation matrix from material to simulation frame.

  • mu (float) –

  • eph_scatt (bool) –

  • process_grid (ProcessGrid) –

  • checkpoint_in (CheckpointPath) –

Methods

__init__

Initialize ab initio material.

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.

collectT

Collect rho from all MPI processes and transpose batch dimension.

constructP

get_contactor

Return a function (or callable object) to calculate the distribution function at a contact with orientation n and specified keyword arguments.

get_observable_names

Return string of observables, comma seperated, specific to each material.

get_observables

Return tensor of complex conjugates of all observables specific to each material.

get_reflector

Return a function (or callable object) to calculate reflections for a sequence of surface points with unit normals (Nsurf x 2).

measure_observables

Retrun density and flux of observables, (Nx x Ny x No) for density and (Nx x Ny x No x 2) for flux.

rho_dot

Overall drho/dt in interaction picture.

rho_dot_scatter

drho/dt due to scattering in Schrodinger picture.

rho_fermi

Compute the equilibrium density matrix corresponding to H.

save_checkpoint

Save self and all children in hierarchy to cp_path.

schrodingerV

Compute unitary rotations from interaction to Schrodinger picture.

zeemanH

Get Zeeman Hamiltonian due to specified external magnetic fields.

Attributes

transport_velocity

Effective velocity for each density-matrix component.

T

mu

nk

S

L

P

rho0

nk x n_bands x n_bands initial density matrix

rho

comm

Communicator for reciprocal-space split over k

k_division

Division of k-points over MPI

k_mine

slice of k on current process

n_bands

number of bands at each k

n_dim

dimensionality of material (2 or 3)

wk

Brillouin zone integration weight

k

nk x n_dim wave vectors

E

nk x n_bands energies

v

nk x n_bands x n_dim velocities in plane

child_names

Names of attributes with child objects.

collectT(rho)

Collect rho from all MPI processes and transpose batch dimension. Batch dimension is put at end for efficient matrix multiplication.

Parameters:

rho (Tensor) –

Return type:

Tensor

get_contactor(n, **kwargs)

Return a function (or callable object) to calculate the distribution function at a contact with orientation n and specified keyword arguments. For an Nsurf x 2 tensor n, the function should take time t as an input and return the corresponding Nsurf x Nkbb_mine distribution function.

Parameters:

n (Tensor) –

Return type:

Callable[[float], Tensor]

get_observable_names()

Return string of observables, comma seperated, specific to each material.

Return type:

list[str]

get_observables(Nkbb, t)

Return tensor of complex conjugates of all observables specific to each material. (No x Nkbb_mine) where No is number of observables.

Parameters:
  • Nkbb (int) –

  • t (float) –

Return type:

Tensor

get_reflector(n)

Return a function (or callable object) to calculate reflections for a sequence of surface points with unit normals (Nsurf x 2). This function will be called with a Nghost x Nsurf x Nkbb_mine tensor, and the reflection should be calculated pointwise in real-space with output of the same dimensions.

Parameters:

n (Tensor) –

Return type:

Callable[[Tensor], Tensor]

rho_dot(rho, t)

Overall drho/dt in interaction picture. Input and output rho are in packed (real) form.

Parameters:
  • rho (Tensor) –

  • t (float) –

Return type:

Tensor

rho_dot_scatter(rho)

drho/dt due to scattering in Schrodinger picture. Input and output rho are in unpacked (complex Hermitian) form.

Parameters:

rho (Tensor) –

Return type:

Tensor

rho_fermi(H, mu)

Compute the equilibrium density matrix corresponding to H. Also return the energies and eigenvectors of H.

Parameters:
  • H (Tensor) –

  • mu (float) –

Return type:

tuple[Tensor, Tensor, Tensor]

schrodingerV(t)

Compute unitary rotations from interaction to Schrodinger picture.

Parameters:

t (float) –

Return type:

Tensor

zeemanH(B)

Get Zeeman Hamiltonian due to specified external magnetic fields.

Parameters:

B (Tensor) –

Return type:

Tensor

rho0: torch.Tensor

nk x n_bands x n_bands initial density matrix