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)

param pc_bra:

'bra' primitive cell from which the hopping terms exist

add_hopping(rn, orb_i, orb_j, energy)

Add a new hopping term or update existing term.

add_subscriber(sub_name, sub_obj)

Add a new subscriber.

check_lock()

Check the lock state of the object.

get_hopping(rn, orb_i, orb_j)

Get an existing hopping term.

lock(sub_name)

Lock the object.

purge()

Remove empty cell indices.

remove_hopping(rn, orb_i, orb_j)

Remove an existing hopping term.

remove_orbital(orb_i)

Wrapper over 'remove_orbitals' to remove a single orbital.

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.

sync_array(**kwargs)

Abstract interface for 'sync_array' method of derived classes.

to_array([use_int64])

Convert hopping terms to array of 'hop_ind' and 'hop_eng', for constructing attributes of 'PrimitiveCell' or 'Sample'.

to_list()

Flatten all hopping terms into a list.

unlock()

Unlock the object.

update()

Update all subscribers.

Attributes

cell_indices

Get the list of cell indices.

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 the hash of this instance.

__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: Union[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.

Parameters:
  • rn – (r_a, r_b, r_c), cell index

  • orb_i – orbital index or bra

  • orb_j – orbital index of ket

  • energy – hopping energy

Returns:

None

Raises:

LockError – is the object is locked

add_subscriber(sub_name: str, sub_obj: Any) None

Add a new subscriber.

Parameters:
  • sub_name – subscriber name

  • sub_obj – subscriber object

Returns:

None

check_lock() None

Check the lock state of the object.

Returns:

None

Raises:

LockError – if the object is locked

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

Get an existing hopping term.

Parameters:
  • rn – (r_a, r_b, r_c), cell index

  • orb_i – orbital index or bra

  • orb_j – orbital index of ket

Returns:

(energy, status) where energy is the hopping energy and status is the flag whether the term has been found

lock(sub_name: str) None

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

Parameters:

sub_name – identifier of the subscriber

Returns:

None

Raises:

ValueError – if sub_name is not in subscribers

purge() None

Remove empty cell indices.

Returns:

None

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

Remove an existing hopping term.

Parameters:
  • rn – (r_a, r_b, r_c), cell index

  • orb_i – orbital index or bra

  • orb_j – orbital index of ket

Returns:

where the hopping term is removed, False if not found

remove_orbital(orb_i: int) None

Wrapper over ‘remove_orbitals’ to remove a single orbital.

Parameters:

orb_i – orbital index to remove

Returns:

None

Raises:

LockError – if the object is locked

remove_orbitals(indices: Union[Iterable[int], ndarray]) None

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

Parameters:

indices – indices of orbitals to remove

Returns:

None

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

Remove all the hopping terms of given cell index.

Parameters:

rn – (r_a, r_b, r_c), cell index

Returns:

where the hopping terms are removed, False if not found

sync_array(**kwargs) None

Abstract interface for ‘sync_array’ method of derived classes.

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’.

Parameters:

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.

Returns:

list of hopping terms (rb, rb, rc, orb_i, orb_j, energy)

unlock() None

Unlock the object. Modifications are allowed then.

Returns:

None

update() None

Update all subscribers.

Returns:

None

__weakref__

list of weak references to the object (if defined)

property cell_indices: List[Tuple[int, int, int]]

Get the list of cell indices.

Returns:

list of cell indices

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.

Returns:

number of hopping terms

property pc_bra: PrimitiveCell

Interface for the ‘_pc_bra’ attribute.

property pc_ket: PrimitiveCell

Interface for the ‘_pc_ket’ attribute.