Page 1 of 1

add_multi_coupling vs. GroupedSite

Posted: 23 May 2022, 04:37
by dorf
Hello,
I have a unit cell with 2 FermionSite and I would like to implement a term like
\(c^\dagger_{0, n+1}c^\dagger_{1, n+1}c_{1, n}c_{0, n}\),
where 0 and 1 are the sublattice indices and n runs over the unit cells.
So something like a two-body hopping term (or can be thought of as a nearest neighbor Coulomb interaction as well, I guess.
I probably can't use CouplingModel.add_coupling to do this, because there I can only provide two local operators, whereas I need four.
There's also the CouplingModel.add_multi_coupling method, however I wonder whether I should rather just build a GroupedSite instead.
What are the pros and cons of the two approaches and are both suitable for my Hamiltonian?
Thank you very much.

Re: add_multi_coupling vs. GroupedSite

Posted: 10 Jun 2022, 16:16
by Johannes
Of course, both approaches can work and should give similar results eventually; but I'd usually recommend not grouping sites if you can manage to write the model without grouping.
Let me elaborate:

When using the tenpy.networks.site.GroupedSite, you will double your local Hilbert space dimension d from 2 to 4. Formally, this leads to a worse scaling of e.g. DMRG, which is O(chi^3 d^3 W L). If you send d -> 2d and L-> L/2, you get a factor of 4 which the grouped site it is potentially slower, or if you consider infinite MPS with the same L, even more.

On the other hand, certain things are easier to implement with the GroupedSites, because you often just need two-"Site" terms instead of four-site terms. As you said, if you don't group, you can use the add_multi_coupling instead of the add_coupling method for defining the Hamiltonian. Similarly, the add_
Similarly, you might need to use expectation_value_multi_sites,term_correlation_function_right or even term_list_correlation_function_right for what might be simpler expectation_value or correlation_function calls in the GroupedSite case.

Finally, let me mention that grouping sites during DMRG can sometimes help to converge better, especially if the mixer doesn't work as well as it should, because you have a larger local, variational space. Similarly, the MPS tangent space is slightly larger for the grouped variant, which might make TDVP/VUMPS work better.
If you suspect that might be the case, you can however just set the group_sites simulation parameter defined in group_sites_for_algorithm: This will group sites only while running DMRG (or whatever algorithm you use), and split the sites again for the measurements. For the user, this means you just write your code (model definition and measurements) as if you wouldn't group, and just set the group_sites parameter in the end.

Re: add_multi_coupling vs. GroupedSite

Posted: 16 Jun 2022, 05:27
by dorf
Thank you very much for the answer. I implemented both and the results match. The difference in computation time was not so significant (for now), so I might stick to grouped sites because, as you said, they are kind of 'prettier' and easier to handle when extracting correlation functions etc.
Again, thank you very much!

Re: add_multi_coupling vs. GroupedSite

Posted: 17 Jun 2022, 12:02
by Johannes
What bond dimensions did you try for the timing benchmarks? I'd expect it to become relevant only around chi >~500 or so, maybe even just with chi on the order of a thousands.

Re: add_multi_coupling vs. GroupedSite

Posted: 27 Jun 2022, 03:05
by dorf
You are right. I only benchmarked up to ~256 where it wasn't so significant.
Thanks again, for the input!