How to create a new operator as a combination of operators acting on different sites

How do I use this algorithm? What does that parameter do?
Post Reply
Michele
Posts: 3
Joined: 20 May 2023, 11:14

How to create a new operator as a combination of operators acting on different sites

Post by Michele »

Hi everyone! I'm a Master student and I'm learning to do DMRG and extract quantities of interest with Tenpy.
The first steps were quite straightforward, but now I'm stuck.

I'm trying to reproduce some results from this paper arXiv:2209.08815 (Bose-Hubbard chain with next nearest neighbors interaction) but I don't understand how to implement some correlators in the code. For example, I'm interested in computing the following:
\[\kappa_z^\Delta = \sum_{j=1}^{M-1-\left | \Delta \right |} \langle \kappa_j^z \kappa_{j+\Delta}^z \rangle \] where M in the size of the chain, with \(\kappa_j^z = \frac{1}{2i} \left ( b_j^{\dag}b_{j+1} - b_{j+1}^{\dag}b_j \right )\).

The problem is that I'm not able to create a new operator as combination of creation/annihilation operators acting on different sites. I'm able to write it using TermList, but I don't know how (and if it is possible) to convert it to an actual operator with an associated string name that is then recognized if I plug it in functions like expectation_value_term().
Maybe this is not even the right path, but it is what I came up with so far.

I looked into the forum but I didn't find an answer to this, maybe there is something very easy that I'm missing.
So if somebody has any suggestion, I will gladly accept it.

Thanks in advance!
User avatar
Johannes
Site Admin
Posts: 428
Joined: 21 Jul 2018, 12:52
Location: TU Munich

Re: How to create a new operator as a combination of operators acting on different sites

Post by Johannes »

Welcome!


Unfortunately, we don't support multi-site operator combinations in TeNPy very well at the moment. However, there's a very simple, general work-around: just write everything explicitly in terms of the single-site operators and sum it up afterwards.

In your case, just plugging in \(\kappa^z_j\) and multiply the factors out to get
\[k^\Delta_z = \sum_j k^{\Delta, j}_z = \sum_j -1/4 \langle b^\dagger_j b_{j+1} b^\dagger_{j+\Delta} b^\dagger_{j+\Delta+1} - b^\dagger_{j+1} b_{j} b^\dagger_{j+\Delta} b^\dagger_{j+\Delta+1} - b^\dagger_j b_{j+1} b^\dagger_{j+1\Delta} b^\dagger_{j+\Delta} + b^\dagger_j b_{j+1} b^\dagger_{j+\Delta} b^\dagger_{j+\Delta+1} \rangle \]
All of those 4 terms for given \Delta, j can in principle easily be measured with expectation_value_term.
If you're not interested in the individual values, you can also use expectation_value_term_sum.
The latter is more efficient in obtaining the sum over Delta, as it converts the sum of terms into an MPO and can hence re-use partial contractions of <psi|operators |psi>.

Alternatively, what you're looking for are the term_correlation_function_right and term_correlation_function_left functions and their generalization
term_list_correlation_function_right.
With the latter, you should easily be able to get the terms of \(k^{\Delta, j}_z\) for fixed j but all \(Delta > 1\) with a single function call.
Further, \(k^{-\Delta, j}_z = k^{\Delta, j-2\Delta}_z\), which leaves only a few terms missing where the onsite-operators overlap, which you can get with expectation_value_term. I leave it to you to figure that out ;-)
Michele
Posts: 3
Joined: 20 May 2023, 11:14

Re: How to create a new operator as a combination of operators acting on different sites

Post by Michele »

Hi Johannes, thank you very much for your answer!

I think I understood your suggestions and I figured out all the coding stuff. Just one thing: I tried to double check the identity \(k_z^{- \Delta ,j} = k_z^{\Delta ,j-2 \Delta}\) and it looks like it holds only sufficiently far from the boundaries of the system (in my case, the extrema of the chain).
I guess this should be expected since I am using finite boundary conditions, am I right? Or maybe I'm missing something?
Post Reply