tbplas.PCInterHopping

class tbplas.PCInterHopping(pc_bra: PrimitiveCell, pc_ket: PrimitiveCell)

Class for holding hopping terms between different primitive cells in hetero-structure.

_pc_bra

the ‘bra’ primitive cell from which the hopping terms exist

Type:

‘PrimitiveCell’ instance

_pc_ket

the ‘ket’ primitive cell from which the hopping terms exist

Type:

‘PrimitiveCell’ instance

Notes

We assume hopping terms to be from (0, 0, 0) cell of pc_bra to any cell of pc_ket. The counterparts can be restored via the conjugate relation:

<pc_bra, R0, i|H|pc_ket, Rn, j> = <pc_ket, R0, j|H|pc_bra, -Rn, i>*

__init__(pc_bra: PrimitiveCell, pc_ket: PrimitiveCell) None
Parameters:
  • pc_bra – ‘bra’ primitive cell from which the hopping terms exist

  • pc_ket – ‘ket’ primitive cell from which the hopping terms exist

Methods

__init__(pc_bra, pc_ket)

add_hopping(rn, orb_i, orb_j, energy)

Add a new hopping term or update existing term.

add_subscriber(sub)

Add a subscriber :param sub: the new subscriber :return: None

check_editable()

Check if the object is unlocked for modification.

count_pairs()

Count how many times each orbital pair emerges.

get_hopping(rn, orb_i, orb_j)

Get an existing hopping term. :param rn: (r_a, r_b, r_c), cell index :param orb_i: orbital index or bra :param orb_j: orbital index of ket :return: (energy, status) where energy is the hopping energy and status is whether the term has been found.

lock()

Lock the object.

purge()

Remove empty cell indices.

remove_hopping(rn, orb_i, orb_j)

Remove an existing hopping term.

remove_orbitals(indices)

Remove the hopping terms corresponding to a list of orbitals and update remaining hopping terms.

remove_rn(rn)

Remove all the hopping terms of given cell index.

to_array([use_int64])

Convert hopping terms to array of 'hop_ind' and 'hop_eng', for constructing attributes of 'PrimitiveCell' or 'Sample'. :param use_int64: whether to use 64-bit integer for hop_ind, should be enabled for 'SuperCell' and 'SCInterHopping' classes :return: (hop_ind, hop_eng) hop_ind: (num_hop, 5) int32/int64 array, hopping indices hop_eng: (num_hop,) complex128 array, hopping energies.

to_list()

Flatten all hopping terms into a list.

unlock()

Unlock the object.

update()

Call subscribers to update their data.

Attributes

hoppings

Interface for the '_hoppings' attribute.

num_hop

Count the number of hopping terms.

pc_bra

Interface for the '_pc_bra' attribute.

pc_ket

Interface for the '_pc_ket' attribute.

__hash__() int

Return hash(self).

__init__(pc_bra: PrimitiveCell, pc_ket: PrimitiveCell) None
Parameters:
  • pc_bra – ‘bra’ primitive cell from which the hopping terms exist

  • pc_ket – ‘ket’ primitive cell from which the hopping terms exist

add_hopping(rn: Tuple[int, int] | Tuple[int, int, int], orb_i: int, orb_j: int, energy: complex) None

Add a new hopping term or update existing term. :param rn: (r_a, r_b, r_c), cell index :param orb_i: orbital index or bra :param orb_j: orbital index of ket :param energy: hopping energy :return: None

add_subscriber(sub: Any) None

Add a subscriber :param sub: the new subscriber :return: None

check_editable() None

Check if the object is unlocked for modification. :return: None

count_pairs() Dict[Tuple[int, int], int]

Count how many times each orbital pair emerges. :return: numbers of emergence of orbital pairs

get_hopping(rn: Tuple[int, int] | Tuple[int, int, int], orb_i: int, orb_j: int) Tuple[complex, bool]

Get an existing hopping term. :param rn: (r_a, r_b, r_c), cell index :param orb_i: orbital index or bra :param orb_j: orbital index of ket :return: (energy, status)

where energy is the hopping energy and status is whether the term has been found

lock() None

Lock the object. Modifications are not allowed then unless the ‘unlock’ method is called. :return: None

purge() None

Remove empty cell indices. :return: None

remove_hopping(rn: Tuple[int, int] | Tuple[int, int, int], orb_i: int, orb_j: int) bool

Remove an existing hopping term. :param rn: (r_a, r_b, r_c), cell index :param orb_i: orbital index or bra :param orb_j: orbital index of ket :return: where the hopping term is removed, False if not found

remove_orbitals(indices: Iterable[int] | ndarray) None

Remove the hopping terms corresponding to a list of orbitals and update remaining hopping terms. :param indices: indices of orbitals to remove :return: None

remove_rn(rn: Tuple[int, int] | Tuple[int, int, int]) bool

Remove all the hopping terms of given cell index. :param rn: (r_a, r_b, r_c), cell index :return: where the hopping terms are removed, False if not found

to_array(use_int64: bool = False) Tuple[ndarray, ndarray]

Convert hopping terms to array of ‘hop_ind’ and ‘hop_eng’, for constructing attributes of ‘PrimitiveCell’ or ‘Sample’. :param use_int64: whether to use 64-bit integer for hop_ind, should be

enabled for ‘SuperCell’ and ‘SCInterHopping’ classes

Returns:

(hop_ind, hop_eng) hop_ind: (num_hop, 5) int32/int64 array, hopping indices hop_eng: (num_hop,) complex128 array, hopping energies

to_list() List[Tuple[int, int, int, int, int, complex]]

Flatten all hopping terms into a list. :return: list of hopping terms (rb, rb, rc, orb_i, orb_j, energy)

unlock() None

Unlock the object. Modifications are allowed then. :return: None

update() None

Call subscribers to update their data. :return: None

__weakref__

list of weak references to the object

property hoppings: Dict[Tuple[int, int, int], Dict[Tuple[int, int], complex]]

Interface for the ‘_hoppings’ attribute.

property num_hop: int

Count the number of hopping terms. :return: number of hopping terms

property pc_bra: PrimitiveCell

Interface for the ‘_pc_bra’ attribute.

property pc_ket: PrimitiveCell

Interface for the ‘_pc_ket’ attribute.