Page 1 of 1

Finite Chain with different unit cell at the beginning

Posted: 04 Jul 2019, 14:56
by Umberto Borla
I am struggling with the following issue: I have a 1D lattice (chain) that consists of a repeated unit cell formed by two different sites (a spin-half site and a fermionic site). If I realize an open chain by repeating the unit cell L times, the first site will always be a spin site and the last one a fermion site. While this is not necessarily a problem, I would like the first and last sites to be fermions, so that in total there are L fermionic sites and only L-1 spin sites. Does anyone have suggestions on the best way to do so?

I'm sure that there are some workarounds, e.g. I could pin the first spin with some large external field so that it is always up no matter what the rest of the system does. Another possibility would be to work with a single unit cell of 2L-1 sites, but this sounds very inconvenient. Is there a clean way to do what I have in mind by physically removing the very first site? :)

Re: Finite Chain with different unit cell at the beginning

Posted: 04 Jul 2019, 16:14
by Johannes
Currently, there's nothing like that.
I started thinking about it (and even writing the code for the , but then became busy implementing other stuff.
First of all, the algorithms like DMRG don't care about the lattice, but only about the generated MPO and lat.mps_sites() defining the Hilbert space. So the only difficulty is how to write down the MPO for such a lattice.
I think the clearest strategy, which I started implementing with the tenpy.models.lattice.IrregularLattice before I came busy with other stuff, would be the following:

Define the Regular Lattice, and specify somehow that you want to add or remove a few sites (and which ones, probably best in the coordinates of the original lattice).
To remove one or multiple sites, we need to remove the corresponding row(s) from the _order array of the lattice.
Adjust the order setter to set the order for the original lattice, remove the rows from the sites to be deleted and put it as _order to self.
Check and adjust functions like lat2mps_idx, mps_idx_fix_u, mps_lat_idx_fix_u, mps2lat_values whether they work as they should.
E.g for mps_idx_fix_u, you need to adjust self._perm, which gets defined in the the order setter.
Finally, adjust the functions possible_couplings and possible_multi_couplings to exclude the cases where the coupling would hit the removed site(s). This will make the Model's add_coupling work as expected.

To add a site (which we can implement later), we might need to enlarge the unit cell by the additional site if it is of a different type. Otherwise, the same functions need to be adjusted. You can view it as taking a regular lattice with the unit cell enlarged by the extra site, and removing the extra site from all the lattice unit cells where you don't want it added - I'm not sure if this is the easiest way to implement it.

To summarize, you actually just need to adjust the Lattice. The model is using the functions of the lattice to figure out where to put couplings, so it should still work as expected once the Lattice is adjusted properly.

Re: Finite Chain with different unit cell at the beginning

Posted: 05 Jul 2019, 16:14
by Umberto Borla
Thanks a lot for the quick reply! I imagined that changing the lattice would be enough, but I was not sure how to do. I'll see if I can manage to carry out the steps that you suggested. :)

Re: Finite Chain with different unit cell at the beginning

Posted: 08 Jul 2019, 12:26
by Johannes
I've opened Issue #77 to keep track of this task, in case you or someone else wants to give it a try ;)

Re: Finite Chain with different unit cell at the beginning

Posted: 04 Jun 2020, 01:26
by Johannes