Skip to content

qtbm#

Includes the QTBM contact class.

Classes:

  • OBCResult –

    Data class to hold the results of the contact's OBC calculation.

  • QTBMContact –

    Class representing a contact for QTBM calculations.

OBCResult dataclass #

OBCResult(injection: NDArray, b_injected: NDArray, sigma_obc_k: dict[str, NDArray] | None = None, bloch_k: dict[str, NDArray] | None = None, reflection: NDArray | None = None, phi_reflected: NDArray | None = None, eig_reflected: NDArray | None = None, phi_inv_reflected: NDArray | None = None)

Data class to hold the results of the contact's OBC calculation.

Attributes:

  • injection (NDArray) –

    The injection vectors for the contact at the given k-points and energies.

  • b_injected (NDArray) –

    The injection vectors before applying the contact coupling.

  • sigma_obc_k (dict) –

    A dictionary containing the computed self-energy for each transverse k-point, indexed by (ky, kz) tuples. Only returned if return_modes_only is False.

  • bloch_k (dict) –

    A dictionary containing the computed Bloch injection matrices for each transverse k-point, indexed by (ky, kz) tuples. Only returned if return_modes_only is False.

  • reflection (NDArray) –

    The reflection vectors for the contact at the given k-points and energies. Only returned if return_modes_only is True.

  • phi_reflected (NDArray) –

    The reflected modes for the contact at the given k-points and energies. Only returned if return_modes_only is True.

  • eig_reflected (NDArray) –

    The reflected eigenvalues for the contact at the given k-points and energies. Only returned if return_modes_only is True.

  • phi_inv_reflected (NDArray) –

    The pseudoinverse of the reflected modes for the contact at the given k-points and energies. Only returned if return_modes_only is True.

Methods:

  • __getitem__ –

    Allows accessing a single energy index from the OBCResult.

__getitem__ #

__getitem__(key: int) -> OBCResult

Allows accessing a single energy index from the OBCResult.

QTBMContact #

QTBMContact(device, contact_config: ContactConfig, sparsity_pattern: spmatrix)

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 #

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 #

compute_contact_bandstructure(kpoints_transport: NDArray) -> NDArray

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.