View source on GitHub |
Base class for a Hubbard model lattice.
Subclasses must define the following properties: n_dofs (int): The number of degrees of freedom per site (and spin if applicable). n_sites (int): The number of sites in the lattice. spinless (bool): Whether or not the fermion has spin (False if so). edge_types (Tuple[Hashable, ...]): The types of edges that a term could correspond to. Examples include 'onsite', 'neighbor', 'diagonal_neighbor', etc. onsite_edge_types (Sequence[Hashable]): The edge types that connect sites to themselves.
And the following methods:
site_pairs_iter(edge_type: Hashable)
-> Iterable[Tuple[int, int]]: Iterable
over pairs of sites corresponding to the given edge type.
For 'spinful' lattices, the spin_indices
0
and 1
correspond to
'up' and 'down', respectively.
Methods
dof_index_offset
dof_index_offset(
dof_index
)
dof_pairs_iter
dof_pairs_iter(
exclude_same=False
)
from_spin_orbital_index
from_spin_orbital_index(
spin_orbital_index
)
site_index_offset
site_index_offset(
site_index
)
site_pairs_iter
@abc.abstractmethod
site_pairs_iter( edge_type, ordered=True )
Iterable over pairs of sites corresponding to the given edge type.
spin_pairs_iter
spin_pairs_iter(
spin_pairs=openfermion.utils.SpinPairs.ALL
,
ordered=True
)
to_spin_orbital_index
to_spin_orbital_index(
site_index, dof_index, spin_index
)
The index of the spin orbital.
validate_dof
validate_dof(
dof, length=None
)
validate_dofs
validate_dofs(
dofs, length=None
)
validate_edge_type
validate_edge_type(
edge_type
)