calculate four-point correlation function

How do I use this algorithm? What does that parameter do?
Post Reply
Posts: 1
Joined: 26 Apr 2022, 11:59

calculate four-point correlation function

Post by yuanjk »

Recently, I have calculated the four-point correlation function \(\braket{C^\dagger_{\downarrow,i} C^\dagger_{\uparrow,i+1} C_{\downarrow,j+1} C_{\uparrow,j}}\) by using the expectation_value_term().

Code: Select all

def correlation(psi,a,b,c,d):
        L = psi.L  
        f = np.zeros((L-1,L-1),dtype=complex)
        for i in range(L-1):
            for j in range(L-1):
                f[i,j] = psi.expectation_value_term([(a,i),(b,i+1),
        return f
But it cost lots of time to get the result, is there any better way to calculate the four-point correlation function?
User avatar
Site Admin
Posts: 337
Joined: 21 Jul 2018, 12:52
Location: TU Munich

Re: calculate four-point correlation function

Post by Johannes »

Yes, you can do better.
The explicit loops you have make this scale as \(O(L^3 \chi^3)\), since each call to psi.expectation_value_term is \(O(|j+1 - i| \chi^3)\).
You can get this down to \(O(L^2 \chi^3)\) by using the term_correlation_function_right or ..._left, with
term_L = [('Cd', 0), ('Cd', 1)], term_R=[('C', 1), ('C', 0)].
It contains the loop over j > (i+1) inside the method. If you need the overlapping terms as well, you have some special cases to handle, but presumably you're really interested in the decay at large \(j \gg i\).
Post Reply