1d lattice with arbitrary distribution of sites

How do I use this algorithm? What does that parameter do?
Post Reply
Umberto Borla
Posts: 18
Joined: 23 Jul 2018, 09:23
Location: Technical University Munich

1d lattice with arbitrary distribution of sites

Post by Umberto Borla »

Hi! I have a question concerning how to build a simple 1d lattice where sites of two types alternate in an arbitrary fashion: let's say for concreteness that I have two types of sites labeled "s_1" and "s_2", and I want to create a finite chain of length 5 so that the sites alternate as ["s_1","s_1","s_2","s_1","s_2"]. I can think of two approaches to get the job done, but both seem more like a workaround rather that what one would logically do.

1) The chain consists of a single large unit cell. Then we can inizialize the lattice implementing

Code: Select all

    def __init__(self, n, site_list,**kwargs):
        site_1=site_1()
        site_2=site_2()
        sites = [site_1 if s == "s_1" else site_2 for s in site_list]
        super(supersite_chain_arbitrary, self).__init__([n], sites, **kwargs)
where site_list is the list

Code: Select all

["s_1","s_1","s_2","s_1","s_2"]
used to specify the arbitrary alternation of sites and n is just the number of times the unit cell is repeated (which has nothing to do with the length of the chain, in this case n=1 if we want L=5). This approach seems somewhat unnatural, since this is not how one would normally think of unit cells and it also makes the definition of couplings/observables awkward.

2) I define a regular lattice consisting of "s_1" only and then I use the IrregularLattice class to insert the "s_2" sites in the appropriate positions. This second approach seems more reasonable and it is what I would go for, but I am wondering if there is something even simpler that I am missing. For instance, I thought there would be a way to initialize the whole lattice (and not just the unit cell) by directly imputing the list of sites, but I did not find anything like that in the documentation. Do you know if such a feature exists and I am just missing it?
User avatar
Johannes
Site Admin
Posts: 337
Joined: 21 Jul 2018, 12:52
Location: TU Munich

Re: 1d lattice with arbitrary distribution of sites

Post by Johannes »

Hi Umberto,

there is a tenpy.models.lattice.TrivialLattice, which is exactly the approach 1) you described - it just takes a list of sites, and defines them as a single, big unit cell. Internally in TeNPy, this is used if you group sites together, since you then no longer have the original lattice geometry afterwards (at least in generic cases).
As you said, this approach makes defining the couplings a bit awkward, since the u index just runs from 1 to L: it is probably best to explicitly loop over the sites you need, and add terms with the add*_term functions like add_coupling_term instead of add_coupling.

Depending on your use case, the tenpy.models.lattice.IrregularLattice might make more sense, if you can think of the s_2 sites as "impurities" in the background of s_1 sites (particularly, if the s_1 sites are really a 2D lattice...)
This would allow to e.g. uniformly add couplings between the s_1 sites, and then just have some extra couplings to the s_2 sites.
Depending on what kind of couplings you want, you can build your 5-site example as
  • a 5-site s_1 chain, remove s_1 in the center and add s_2, or
  • use a 4-site s_1 and just add the extra s_2 site.
Post Reply