symmray.hamiltonians ==================== .. py:module:: symmray.hamiltonians .. autoapi-nested-parse:: Abelian symmetric and fermionic Hamiltonians in terms of local operators. Functions --------- .. autoapisummary:: symmray.hamiltonians.make_edge_factory symmray.hamiltonians.make_node_factory symmray.hamiltonians.tfim_local_array symmray.hamiltonians.ham_tfim_from_edges symmray.hamiltonians.ham_heisenberg_from_edges symmray.hamiltonians.ham_fermi_hubbard_from_edges symmray.hamiltonians.ham_fermi_hubbard_spinless_from_edges Module Contents --------------- .. py:function:: make_edge_factory(coeff) Ensure `coeff` is a function that takes two sites and returns an edge coeff. .. py:function:: make_node_factory(coeff) Ensure `coeff` is a function that takes a site and returns a node coeff. .. py:function:: tfim_local_array(symmetry, jx=-1.0, hz=-3.0, coordinations=(1, 1), flat=False) Build an abelian symmetric local operator for the transverse field Ising model:: H = jx * sum_ij X_i X_j + hz * sum_i Z_i Note that its rotated into the x-basis so that the Z2 symmetry is manifest. :param symmetry: The symmetry of the model. Should be "Z2". :type symmetry: str :param jx: The coupling strength for the X-X interactions, by default -1.0. :type jx: float :param hz: The coupling strength for the Z interactions, by default -3.0. If a tuple is given it should contain the fields for the two sites. :type hz: float or tuple[float, float] :param coordinations: The coordinations of the two sites, by default (1, 1). The fields are divided by these values to account for double counting. :type coordinations: tuple[int, int], optional :param flat: Whether to return a flat array, by default False. :type flat: bool, optional :returns: The local Hamiltonian term. :rtype: Z2Array or Z2ArrayFlat .. py:function:: ham_tfim_from_edges(symmetry, edges, jx=-1.0, hz=-3.0, flat=False) Return a dict of local 2-body Hamiltonian abelian symmetric terms for the transverse field Ising model on the given lattice defined by `edges`:: H = jx * sum_ij X_i X_j + hz * sum_i Z_i Note that its rotated into the x-basis so that the Z2 symmetry is manifest. :param symmetry: The symmetry of the model. Should be "Z2". :type symmetry: str :param edges: A list of edges representing the lattice, each edge is a tuple of two nodes, each node is some hashable label. :type edges: Sequence[tuple[Hashable, Hashable]] :param jx: The coupling strength for the X-X interactions, by default -1.0. If a dict is given it should map edges to values, if a callable it should take the two sites as input. :type jx: float, dict, or callable, optional :param hz: The coupling strength for the Z interactions, by default -3.0. If a dict is given it should map sites to values, if a callable it should take the site as input. :type hz: float, dict or callable, optional :param flat: Whether to return flat arrays, by default False. :type flat: bool, optional :returns: A dictionary mapping edges to local Hamiltonian terms. :rtype: dict[tuple[Hashable, Hashable], AbelianArray | AbelianArrayFlat] .. py:function:: ham_heisenberg_from_edges(symmetry, edges, flat=False, **kwargs) Return a dict of local 2-body Hamiltonian abelian symmetric terms for the Heisenberg model on the given lattice defined by `edges`. :param symmetry: The symmetry of the model. Either "Z2" or "U1". :type symmetry: str :param edges: A list of edges representing the lattice, each edge is a tuple of two nodes, each node is some hashable label. :type edges: Sequence[tuple[Hashable, Hashable]] :param flat: Whether to return flat arrays, by default False. :type flat: bool, optional :returns: A dictionary mapping edges to local Hamiltonian terms. :rtype: dict[tuple[Hashable, Hashable], AbelianArray | AbelianArrayFlat] .. py:function:: ham_fermi_hubbard_from_edges(symmetry, edges, t=1.0, U=8.0, mu=0.0, like='numpy', flat=False) Return a dict of local 2-body Hamiltonian terms for the Fermi-Hubbard model on the given lattice defined by `edges`. The indices are ordered as (a, b, a', b'), with the local basis like (|00>, ad+|00>, au+|00>, au+ad+|00>) for site a with up (au) and down (ad) spin respectively and similar for site b. :param symmetry: The symmetry of the model. Either "Z2", "U1", "Z2Z2", or "U1U1". :type symmetry: str :param edges: A list of edges representing the lattice, each edge is a tuple of two nodes, each node is some hashable label. :type edges: Sequence[tuple[Hashable, Hashable]] :param t: The hopping parameter, by default 1.0. If a dict is given it should map edges to values, if a callable it should take the two sites as input. :type t: float, dict or callable, optional :param U: The interaction parameter, by default 8.0. If a dict is given it should map sites to values, if a callable it should take the site as input. :type U: float dict or callable, optional :param mu: The chemical potential, by default 0.0. :type mu: float, optional :param like: The backend to use, by default "numpy". :type like: str, optional :param flat: Whether to return flat arrays, by default False. :type flat: bool, optional :returns: A dictionary mapping edges to local Hamiltonian terms. :rtype: dict[tuple[Hashable, Hashable], FermionicArray | FermionicArrayFlat] .. py:function:: ham_fermi_hubbard_spinless_from_edges(symmetry, edges, t=1.0, V=0.0, mu=0.0, delta=0.0, like='numpy', flat=False) Return a dict of local 2-body Hamiltonian terms for the 'spinless Fermi-Hubbard' or ('t-V') model on the given lattice defined by `edges`. model on the given lattice defined by `edges`. :param symmetry: The symmetry of the model. Either "Z2" or "U1". :type symmetry: str :param edges: A list of edges representing the lattice, each edge is a tuple of two nodes, each node is some hashable label. :type edges: Sequence[tuple[Hashable, Hashable]] :param t: The hopping parameter, by default 1.0. :type t: float, optional :param V: The nearest neighbor interaction parameter, by default 0.0. :type V: float, optional :param mu: The chemical potential, by default 0.0. :type mu: float, optional :param delta: The nearest neighbor superconducting pairing parameter, by default 0.0. :type delta: float, optional :param like: The backend to use, by default "numpy". :type like: str, optional :param flat: Whether to return flat arrays, by default False. :type flat: bool, optional :returns: A dictionary mapping edges to local Hamiltonian terms. :rtype: dict[tuple[Hashable, Hashable], FermionicArray | FermionicArrayFlat]