What is the best way to implement interpenetrating lattices in TeNPy?
Simple example: a square lattice with alternating one-orbital GroupedSite and three-orbital GroupedSite (like a checkerboard).
Or, alternatively, a honeycomb lattice with a triangular lattice on top (where the triangular lattice is at the centers of the hexagons).
If there is a simple work-around that I have missed, or if you have any hints or tips, it would be greatly appreciated!
Interpenetrating Lattices
Re: Interpenetrating Lattices
Currently, there is nothing to directly support this in TeNPy.
What you need to do is implement your own lattice (as a subclass of tenpy.models.lattice.Lattice).
Example:
You can than use the
What you need to do is implement your own lattice (as a subclass of tenpy.models.lattice.Lattice).
Example:
Code: Select all
import numpy as np
from tenpy.models import lattice
from tenpy.networks import site
class MyLattice(lattice.Lattice):
def __init__(self, Lx, Ly, siteA, siteB, **kwargs):
pos = np.array([[0., 0.], # center
[1., 0.], # triangle right
[-0.5, 0.5*np.sqrt(3)], # triangle top left
[-0.5, -0.5*np.sqrt(3)]]) # triangle bottom left
pos *= 0.3 # scale triangle smaller
site.multi_sites_combine_charges([siteA, siteB]) # independently conserved charges
super().__init__([Lx, Ly], [siteA, siteB, siteB, siteB], positions=pos, **kwargs)
self.BB_bonds = [(1, 2, np.array([0, 0])),
(2, 3, np.array([0, 0])),
(3, 1, np.array([0, 0]))]
self.AB_bonds = [(1, 2, np.array([0, 0])),
(2, 3, np.array([0, 0])),
(3, 1, np.array([0, 0]))]
self.AA_NN = [(0, 0, np.array([1, 0])),
(0, 0, np.array([0, 1])),
]
def plot_lattice():
import matplotlib.pyplot as plt
ax = plt.gca()
siteA = site.SpinHalfSite()
siteB = site.FermionSite()
lat = MyLattice(3, 3, siteA, siteB)
lat.plot_sites(ax)
lat.plot_coupling(ax, lat.BB_bonds, linestyle='--', color='red')
lat.plot_coupling(ax, lat.AB_bonds, linestyle='-', color='green')
lat.plot_coupling(ax, lat.AA_NN, linestyle='-', color='blue')
plt.show()
if __name__ == "__main__":
plot_lattice()
BB_bonds, AB_bonds, AA_NN
with add_coupling, e.g. inside the init_terms:Code: Select all
def init_terms(self):
# exemplary (stupid) terms
for u1, u2, dx in self.lat.AA_NN:
self.add_coupling(0.1, u1, "Sp", u2, "Sm", dx)
self.add_coupling(0.1, u2, "Sm", u1, "Sp", -dx)
for u1, u2, dx in self.lat.AB_bonds:
self.add_coupling(0.1, u1, "Sz", u2, "N", dx)
for u1, u2, dx in self.lat.BB_bonds:
self.add_coupling(0.1, u1, "Cd", u2, "C", dx)
self.add_coupling(0.1, u2, "Cd", u1, "C", -dx)
Re: Interpenetrating Lattices
Thank you for the quick reply, and the example with plot is much appreciated!