Download this notebook (.ipynb + data files)
9. Useful Snippets for Various Lattice Models#
This example collects short recipes for setting up common lattice model Hamiltonians and their free-electron trial wavefunctions.
Each snippet illustrates one aspect of the setup, but they can be combined: for example, a pinning field can be added to the three-band model in the same way as to the single-band one. The lattices are explained in Defining a Lattice, and the Hamiltonian terms in Building Lattice Model Hamiltonians.
9.1. Setup#
import numpy as np
from safiretools import Lattice, LatticeHamiltonian, PinningField, Wavefunction, vis
default_twist = (1/np.sqrt(592560607), 1/np.sqrt(47603))
9.2. Rectangular Hubbard Model#
A Hubbard model on a 2 × 3 square lattice with periodic boundary conditions.
params = dict(t=1.0, U=2.0)
lattice = Lattice.from_type(
"square", (2, 3), boundaries=("periodic", "periodic"), twists=(0.0, 0.0)
)
hamiltonian = LatticeHamiltonian.from_lattice(lattice, **params)
# The trial wavefunction needs its own Hamiltonian, built on a lattice
# carrying a small irrational twist.
# The AFQMC run itself uses the untwisted Hamiltonian above.
fe_lattice = Lattice(**dict(hamiltonian.lattice_params, twists=default_twist))
fe_hamiltonian = LatticeHamiltonian.from_lattice(fe_lattice, **params)
wavefunction = Wavefunction.from_free_electron(
source=fe_hamiltonian,
nelec=(2, 2),
)
Wavefunction.from_free_electron() uses the Hamiltonian exactly as given and applies no twist of its own, so the twist belongs on the lattice you build that Hamiltonian from.
For an open-shell filling, an untwisted lattice leads to an arbitrary choice of which degenerate orbitals are occupied, and from_free_electron() warns when that happens.
The following snippets use the same pattern.
9.3. Three-Band Hubbard Model#
nbands sets the number of orbitals per lattice site.
params = dict(nbands=3, U=2.0)
lattice = Lattice.from_type(
"square", (2, 3), boundaries=("periodic", "periodic"), twists=(0.0, 0.0)
)
hamiltonian = LatticeHamiltonian.from_lattice(lattice, **params)
fe_lattice = Lattice(**dict(hamiltonian.lattice_params, twists=default_twist))
fe_hamiltonian = LatticeHamiltonian.from_lattice(fe_lattice, **params)
wavefunction = Wavefunction.from_free_electron(
source=fe_hamiltonian,
nelec=(3, 3),
)
9.4. Hubbard-Kanamori Model#
A two-band Hubbard-Kanamori model on a 6 × 1 square lattice. The system is a one-dimensional chain, periodic along its length.
params = dict(nbands=2, U=2.0, U1=1.5, U2=1.0, J=0.5)
lattice = Lattice.from_type(
"square", (6, 1), boundaries=("periodic", "open"), twists=(0.0, 0.0)
)
hamiltonian = LatticeHamiltonian.from_lattice(lattice, **params)
fe_lattice = Lattice(**dict(hamiltonian.lattice_params, twists=default_twist))
fe_hamiltonian = LatticeHamiltonian.from_lattice(fe_lattice, **params)
wavefunction = Wavefunction.from_free_electron(
source=fe_hamiltonian,
nelec=(6, 6),
)
9.5. Hubbard Model with nth-Order Hopping#
A list t of length \(n\) gives hopping up to the \(n\)th-order neighbors.
Here, t=[1.0, 0.5] adds a next-nearest-neighbor hopping \(t' = 0.5\).
params = dict(t=[1.0, 0.5], U=2.0)
lattice = Lattice.from_type(
"square", (2, 3), boundaries=("periodic", "periodic"), twists=(0.0, 0.0)
)
hamiltonian = LatticeHamiltonian.from_lattice(lattice, **params)
fe_lattice = Lattice(**dict(hamiltonian.lattice_params, twists=default_twist))
fe_hamiltonian = LatticeHamiltonian.from_lattice(fe_lattice, **params)
wavefunction = Wavefunction.from_free_electron(
source=fe_hamiltonian,
nelec=(2, 2),
)
9.6. Pinning Fields#
A \(t\)-\(t'\) Hubbard model on an 8 × 4 square lattice with an antiferromagnetic pinning field on the two open edges at the ends of axis 0. The pinning field is a one-body term, so the trial wavefunction Hamiltonian has to carry it too.
params = dict(t=[1.0, 0.5], U=2.0, pinning=(PinningField.afm(0.5, staggered=True), None))
lattice = Lattice.from_type(
"square", (8, 4), boundaries=("open", "periodic"), twists=(0.0, 0.0)
)
hamiltonian = LatticeHamiltonian.from_lattice(lattice, **params)
fe_lattice = Lattice(**dict(hamiltonian.lattice_params, twists=default_twist))
fe_hamiltonian = LatticeHamiltonian.from_lattice(fe_lattice, **params)
wavefunction = Wavefunction.from_free_electron(
source=fe_hamiltonian,
nelec=(16, 16),
)
A charge pinning field \(\frac{h}{2} \hat{n}_i\), constant along the edge, is set up the same way.
params = dict(t=[1.0, 0.5], U=2.0, pinning=(PinningField.charge(0.5, staggered=False), None))
lattice = Lattice.from_type(
"square", (8, 4), boundaries=("open", "periodic"), twists=(0.0, 0.0)
)
hamiltonian = LatticeHamiltonian.from_lattice(lattice, **params)
fe_lattice = Lattice(**dict(hamiltonian.lattice_params, twists=default_twist))
fe_hamiltonian = LatticeHamiltonian.from_lattice(fe_lattice, **params)
wavefunction = Wavefunction.from_free_electron(
source=fe_hamiltonian,
nelec=(16, 16),
)
9.7. Twist Angles#
twists holds the twist angles \(\vec{\theta}=(\theta_1,\theta_2)\) in radians, with both components given even if one of them is 0.
Here, the lattice we want to simulate at the AFQMC level is already twisted, so one Hamiltonian serves both the trial wavefunction and the AFQMC run.
lattice = Lattice.from_type(
"square", (4, 8), boundaries=("periodic", "periodic"), twists=(0.0, 7 * np.pi / 8)
)
hamiltonian = LatticeHamiltonian.from_lattice(lattice, U=4.0)
wavefunction = Wavefunction.from_free_electron(
source=hamiltonian,
nelec=(24, 24),
)
9.8. Overriding the Hubbard-Stratonovich Transformation Type#
This functionality is for experts only. Use at your own risk.
By default, the Hamiltonian builder chooses a Hubbard-Stratonovich transformation (HST) type from the sign of each interaction.
For band-dependent interactions, it splits each interaction into two separate terms if there are both positive and negative interaction strengths and assigns an HST type to each.
hst_types forces a specific HST type for the interaction terms it names, regardless of the sign of the interaction strength.
The other terms keep their default.
The choices are "discrete_spin", "discrete_charge", "continuous_spin" and "continuous_charge".
params = dict(
nbands=2,
U=4.0, # defaults to "discrete_spin" for U > 0
U1=-1.5, # defaults to "discrete_charge" for U1 < 0
U2=1.0,
J=0.5,
hst_types={"U1": "discrete_spin"},
)
lattice = Lattice.from_type(
"square", (3, 3), boundaries=("periodic", "periodic"), twists=(0.0, 0.0)
)
hamiltonian = LatticeHamiltonian.from_lattice(lattice, **params)
fe_lattice = Lattice(**dict(hamiltonian.lattice_params, twists=default_twist))
fe_hamiltonian = LatticeHamiltonian.from_lattice(fe_lattice, **params)
wavefunction = Wavefunction.from_free_electron(
source=fe_hamiltonian,
nelec=(2, 2),
)
9.9. Triangular Lattice#
The first argument of Lattice.from_type() selects the unit cell: "square", "triangular", "honeycomb" or "kagome".
Below, a Hubbard model on a 3 × 3 triangular lattice.
params = dict(t=1.0, U=2.0)
lattice = Lattice.from_type(
"triangular", (3, 3), boundaries=("periodic", "periodic"), twists=(0.0, 0.0)
)
vis.plot_lattice(lattice)
hamiltonian = LatticeHamiltonian.from_lattice(lattice, **params)
fe_lattice = Lattice(**dict(hamiltonian.lattice_params, twists=default_twist))
fe_hamiltonian = LatticeHamiltonian.from_lattice(fe_lattice, **params)
wavefunction = Wavefunction.from_free_electron(
source=fe_hamiltonian,
nelec=(2, 2),
)
9.10. Rashba Spin-Orbit Coupling#
Rashba spin-orbit coupling mixes the spin sectors, so giving rashba_lambda builds the Hamiltonian in noncollinear form.
The coupling strength multiplies the hopping t of every neighbor order.
lattice = Lattice.from_type(
"square", (3, 3), boundaries=("periodic", "periodic"), twists=(0.0, 0.0)
)
hamiltonian = LatticeHamiltonian.from_lattice(lattice, t=[1.0, 0.5], U=8.0, rashba_lambda=0.3)
wavefunction = Wavefunction.from_free_electron(
source=hamiltonian,
nelec=(5, 5)
)