contact#
Includes the contact classes.
Modules:
-
base–Includes the base contact class.
-
discovery–Contact discovery module for identifying contacts in the device.
-
qtbm–Includes the QTBM contact class.
-
scba–Includes the SCBA contact class.
Classes:
-
BaseContact–Class representing a contact for QTBM calculations.
-
QTBMContact–Class representing a contact for QTBM calculations.
-
SCBAContact–Class representing a contact for SCBA calculations.
BaseContact
#
Bases: ABC
Class representing a contact for QTBM calculations.
Parameters:
-
device(BaseDevice) –The device object to which this contact is attached. Contains the Hamiltonian, overlap matrices, and atomic structure information.
-
contact_config(ContactConfig) –The configuration object containing the contact settings such as lattice vectors, origin, transport direction, and Fermi level information.
-
sparsity_pattern(spmatrix) –The sparsity pattern of the device Hamiltonian, used to identify the contact orbitals and their connectivity.
Attributes:
-
device(BaseDevice) –The device object to which this contact is attached.
-
name(str) –The contact identifier.
-
transport_direction(int) –Transport direction index (0, 1, or 2).
-
unit_cell_orbital_indices(dict) –Dict of orbital indices for each contact cell indexed by (i, j, k) tuples.
-
origin_key(tuple[int, int, int]) –The key corresponding to the origin cell in the unit_cell_orbital_indices.
-
transverse_repetition_grid(NDArray) –Number of periodic repetitions in the two transverse directions.
-
transport_repetitions(int) –Number of repetitions needed in transport direction for convergence.
-
orbital_indices(NDArray) –Flattened array of orbital indices for the contact, sorted first in transport direction, then in transverse directions.
-
orbital_indices_per_layer(list[NDArray]) –List of orbital indices for each layer in the transport direction, sorted first in transverse directions, then in transport direction.
-
transverse_to_transport_indices(NDArray) –Indices to reorder the coupling matrix from transverse-first to transport-first ordering.
-
fermi_level(float) –Fermi level of the contact in eV.
-
mid_gap_energy(float) –Mid-gap energy of the contact in eV.
-
conduction_band_edge(float) –Energy of the conduction band edge in eV.
-
voltage(float) –Voltage applied to the contact in V.
-
temperature(float) –Temperature of the contact in K.
Methods:
-
compute_contact_bandstructure–Computes the band structure for the contact along the
-
compute_contact_band_properties–Computes the Fermi level for the contact from the Hamiltonian and
compute_contact_bandstructure
abstractmethod
#
Computes the band structure for the contact along the transport direction.
Parameters:
-
kpoints_transport(NDArray) –The k-points along the transport direction.
Returns:
-
e_k(NDArray) –The eigenvalues for the contact band structure.
compute_contact_band_properties
#
Computes the Fermi level for the contact from the Hamiltonian and overlap matrices.
Returns:
QTBMContact
#
Bases: BaseContact
Class representing a contact for QTBM calculations.
Parameters:
-
device(BaseDevice) –The device object to which this contact is attached. Contains the Hamiltonian, overlap matrices, and atomic structure information.
-
contact_config(ContactConfig) –The configuration object containing the contact settings such as lattice vectors, origin, transport direction, and Fermi level information.
-
sparsity_pattern(spmatrix) –The sparsity pattern of the device Hamiltonian, used to identify the contact orbitals and their connectivity.
Attributes:
-
device(BaseDevice) –The device object to which this contact is attached.
-
name(str) –The contact identifier.
-
transport_direction(int) –Transport direction index (0, 1, or 2).
-
unit_cell_orbital_indices(dict) –Dict of orbital indices for each contact cell indexed by (i, j, k) tuples.
-
origin_key(tuple[int, int, int]) –The key corresponding to the origin cell in the unit_cell_orbital_indices.
-
transverse_repetition_grid(NDArray) –Number of periodic repetitions in the two transverse directions.
-
transport_repetitions(int) –Number of repetitions needed in transport direction for convergence.
-
orbital_indices(NDArray) –Flattened array of orbital indices for the contact, sorted first in transport direction, then in transverse directions.
-
orbital_indices_per_layer(list[NDArray]) –List of orbital indices for each layer in the transport direction, sorted first in transverse directions, then in transport direction.
-
transverse_to_transport_indices(NDArray) –Indices to reorder the coupling matrix from transverse-first to transport-first ordering.
-
fermi_level(float) –Fermi level of the contact in eV.
-
mid_gap_energy(float) –Mid-gap energy of the contact in eV.
-
conduction_band_edge(float) –Energy of the conduction band edge in eV.
-
voltage(float) –Voltage applied to the contact in V.
-
temperature(float) –Temperature of the contact in K.
-
obc_solver(Spectral) –Configured open boundary condition solver.
Methods:
-
get_coupling_matrix–Extracts coupling matrix between device and contact.
-
compute_boundary–Computes OBC for the contact at given k-points and energies.
-
compute_contact_bandstructure–Computes the band structure for the contact along the
get_coupling_matrix
#
get_coupling_matrix(M: spmatrix, transpose: bool = False) -> NDArray
Extracts coupling matrix between device and contact.
This method constructs the matrix that couples the device region to the contact.
Example: Given a contact layers |0 1 2 3|, the resulting coupling matrix is |3 2 1| |0 3 2| |0 0 3|
Parameters:
-
M(spmatrix) –The matrix (Hamiltonian or overlap) from which to extract coupling elements. Should have dimensions (n_device_orbitals, n_device_orbitals).
-
transpose(bool, default:False) –If True, the method extracts the transpose of the coupling matrix, by default False.
Returns:
-
NDArray–Dense matrix representing the coupling between device and contact. The matrix has the block structure needed for QTBM boundary conditions, with dimensions determined by the contact's transverse repetitions.
compute_boundary
#
compute_boundary(M: spmatrix, upper_M: bool, k_outer: tuple[float, float, float], return_modes_only: bool = False) -> OBCResult
Computes OBC for the contact at given k-points and energies.
Parameters:
-
M(spmatrix) –The system matrix from which to extract coupling elements. It should have dimensions (n_device_orbitals, n_device_orbitals).
-
upper_M(bool) –Whether to use the upper triangle of the system matrix.
-
k_outer(tuple[float, float, float]) –The k-point in the transport direction.
-
return_modes_only(bool, default:False) –Whether to return only the injection and surface modes without computing the full self-energy and Bloch matrices.
Returns:
-
ContactOBCResult–An object containing the computed OBC results, including injection modes, self-energy, and Bloch modes as applicable.
compute_contact_bandstructure
#
Computes the band structure for the contact along the transport direction.
Parameters:
-
kpoints_transport(NDArray) –The k-points along the transport direction.
Returns:
-
e_k(NDArray) –The eigenvalues for the contact band structure.
SCBAContact
#
Bases: BaseContact
Class representing a contact for SCBA calculations.
Parameters:
-
device(BaseDevice) –The device object to which this contact is attached. Contains the Hamiltonian, overlap matrices, and atomic structure information.
-
contact_config(ContactConfig) –The configuration object containing the contact settings such as lattice vectors, origin, transport direction, and Fermi level information.
-
sparsity_pattern(spmatrix) –The sparsity pattern of the device Hamiltonian, used to identify the contact orbitals and their connectivity.
Attributes:
-
device(BaseDevice) –The device object to which this contact is attached.
-
name(str) –The contact identifier.
-
transport_direction(int) –Transport direction index (0, 1, or 2).
-
unit_cell_orbital_indices(dict) –Dict of orbital indices for each contact cell indexed by (i, j, k) tuples.
-
origin_key(tuple[int, int, int]) –The key corresponding to the origin cell in the unit_cell_orbital_indices.
-
transverse_repetition_grid(NDArray) –Number of periodic repetitions in the two transverse directions.
-
transport_repetitions(int) –Number of repetitions needed in transport direction for convergence.
-
orbital_indices(NDArray) –Flattened array of orbital indices for the contact, sorted first in transport direction, then in transverse directions.
-
orbital_indices_per_layer(list[NDArray]) –List of orbital indices for each layer in the transport direction, sorted first in transverse directions, then in transport direction.
-
transverse_to_transport_indices(NDArray) –Indices to reorder the coupling matrix from transverse-first to transport-first ordering.
-
fermi_level(float) –Fermi level of the contact in eV.
-
mid_gap_energy(float) –Mid-gap energy of the contact in eV.
-
conduction_band_edge(float) –Energy of the conduction band edge in eV.
-
voltage(float) –Voltage applied to the contact in V.
-
temperature(float) –Temperature of the contact in K.
-
diagonal_inds(tuple[int, int]) –Tuple of indices corresponding to the diagonal block of the contact in the Hamiltonian.
-
upper_inds(tuple[int, int]) –Tuple of indices corresponding to the upper block of the contact in the Hamiltonian.
-
order(str | None) –Order of the contact indices, either None or "reverse" for ascending or descending order, respectively.
-
owning_rank(int) –The rank of the block comm process that owns the contact indices.
-
obc_solvers(dict[str, OBCSystem]) –Dictionary of OBC solvers for different subsystems (e.g., electron, phonon, photon, etc.).
-
lyapunov_solvers(dict[str, LyapunovSystem]) –Dictionary of Lyapunov solvers for different subsystems (e.g., phonon, photon, etc.).
Methods:
-
compute_contact_bandstructure–Computes the band structure for the contact along the
compute_contact_bandstructure
#
Computes the band structure for the contact along the transport direction.
Parameters:
-
kpoints_transport(NDArray) –The k-points along the transport direction.
Returns:
-
e_k(NDArray) –The eigenvalues for the contact band structure.