Analysis of density correlations

In [114]:
%clear
%pylab inline
%run 'utils.ipynb'
import scipy
import scipy.signal
from scipy import optimize
from IPython.core.display import HTML
Populating the interactive namespace from numpy and matplotlib
In [115]:
class power_law:
    def __init__(self, p, exponent):
        self.exponent = float(exponent)
        self.factor   = p[1] * p[0]**(-self.exponent)
    
    def __call__(self, x):
        return self.factor * x**self.exponent
In [116]:
import re
fit_pattern = re.compile(r'# (\w+)\s+= (.*)')
def load_info_data(fname):
    res = {}
    for line in open(fname):
        match = fit_pattern.search(line)
        if match:
            name = match.group(1)
            val  = match.group(2)
            res[name] = val
    return res

import json
def get_krho(t_perp, filling, M):
    fname = '../data_new/krho_chi={}.txt'.format(M)
    info = load_info_data(fname)
    
    all_tperp    = json.loads(info['tperp'])
    all_fillings = json.loads(info['filling'])
    # all_tperp    = [1.0, 1.2, 1.3, 1.4, 1.5]
    # all_fillings = [0.625, 0.75, 0.875, 0.9375, 0.96875]
    
    all_krho = np.atleast_2d(np.loadtxt(fname))
    fill_idx = all_fillings.index(filling)
    tper_idx = all_tperp.index(t_perp)
    
    return all_krho[tper_idx, fill_idx]
In [117]:
def load_densdens(li):
    extraps_raw = []
    for mi in ['extrap_variance', 'extrap_bonddim']:
        fname = '../data_new/dens_dens_avg_L={L:.0f}_n={fill}_tperp={tperp}_chi={M}_deg2_num6.txt'.format(type=t_perp, L=li, M=mi, fill=filling, tperp=t_perp)
        extraps_raw.append(np.loadtxt(fname))
    extraps = np.column_stack([extraps_raw[0][:,0], extraps_raw[0][:,1], extraps_raw[1][:,1]])
    d = np.empty((extraps.shape[0], 2))
    d[:,0] = extraps[:,0]
    d[:,1] = np.mean(extraps[:,1:], axis=1)
    return d
In [118]:
def plot_krho_decay(p):
    y = []
    for mi in ['extrap_variance_d2_n6', 'extrap_bonddim_d2_n6']:
        K_rho = get_krho(t_perp, filling, mi)
        y.append( power_law(p, -K_rho)(x) )
    y = np.transpose(y)
    
    plt.fill_between(x, np.min(y, axis=1), np.max(y, axis=1), edgecolor='none', facecolor=(.5,.5,.5, .4))
    plt.plot(x, np.mean(y, axis=1), ':k', lw=.6)

Raw data with InterpolatedUnivariateSpline

In [126]:
L = 128
filling = 0.875
t_perp = 1.0

d = load_densdens(L)

figure(figsize=(12,6))
plot(d[:,0], d[:,1], 'o')
    
spl = InterpolatedUnivariateSpline(d[:,0], d[:,1])
x = np.linspace(1,L, 1000)
y = spl(x)
plot(x, y)
    
allmin = scipy.signal.argrelmin(y)[0]
allmax = scipy.signal.argrelmax(y)[0]
plot(x[allmin], y[allmin], 'rx')
plot(x[allmax], y[allmax], 'r+')
    
for i, ii in enumerate(allmin):
    annotate(str(i), (x[ii], y[ii]), textcoords='offset points', xytext=(0,-15), ha='center')
for i, ii in enumerate(allmax):
    annotate(str(i), (x[ii], y[ii]), textcoords='offset points', xytext=(0,+5), ha='center')
    
ylim(-0.002,0.001)
grid()

Interpretation

Suppose a correlation function like: $$ \langle n(x) n(0) \rangle \propto A_0 x^{-2} + A_1 e^{-\alpha x} \cos(2k_F x) + A_2 r^{-K_\rho} \cos(4k_F x) $$ from http://dx.doi.org/10.1103/PhysRevB.76.195105.

Then we can build the following table relating the minima and maxima of the $\cos()$ terms:

$x=$ $\frac{\pi}{4 k_F}$ $\frac{2\pi}{4 k_F}$ $\frac{3\pi}{4 k_F}$ $\frac{4\pi}{4 k_F}$ $\frac{5\pi}{4 k_F}$ $\frac{6\pi}{4 k_F}$ $\frac{7\pi}{4 k_F}$
$\cos(4k_F x)$ -1 +1 -1 +1 -1 +1 -1
$\cos(2k_F x)$ 0 -1 0 +1 0 -1 0

Looking at the data above it seems that:

  • Somehow the points are shifted by 4, because the table would indicate that the maxima whould have even/odd effect, not the minima.
  • $A_2$ seems to be negative, since approaching zero it is shooting to $-\infty$ (not very strong argument...)
  • $A_1$ also seems to be nagative, since the oscillations are shifted below zero

Differences between minima and maxima

We consider now

  • max+min : $\langle n(x_{max}) n(0) \rangle + \langle n(x_{min}) n(0) \rangle$,
    if the decaying part doesn't change too much in the step $\Delta x = \pi / 4 k_F$, then $\cos(4k_F)$ component vanishes.
    Expected: exponential decay ($\cos(2k_F)$ component)
  • max-min : $\langle n(x_{max}) n(0) \rangle - \langle n(x_{min}) n(0) \rangle$,
    here there is no component eliminated.
  • max+max : $\langle n(x_{max}^{(i)}) n(0) \rangle + \langle n(x_{max}^{(i+1)}) n(0) \rangle$,
    this could eliminate the $\cos(2k_F)$ component, but the distance between two maxima is too large for considering the equal amplitudes.
    Expected: power-law
  • min+min : $\langle n(x_{min}^{(i)}) n(0) \rangle + \langle n(x_{min}^{(i+1)}) n(0) \rangle$,
    this could eliminate the $\cos(2k_F)$ component, but the distance between two maxima is too large for considering the equal amplitudes.
    Expected: power-law
In [120]:
figure(figsize=(12,6))
    
x1 = np.mean((x[allmax],x[allmin]), axis=0)
y1 = y[allmax] - y[allmin]
plot(x1, y1, 'o-', label='max-min')

x2 = np.mean((x[allmax],x[allmin]), axis=0)
y2 = y[allmax] + y[allmin]
plot(x2, abs(y2), '^-', label='abs(max+min)')

x3 = np.mean((x[allmax[:-1]],x[allmax[1:]]), axis=0)
y3 = y[allmax[:-1]] + y[allmax[1:]]
plot(x3, abs(y3), '>-', label='abs(max+max)')

x4 = np.mean((x[allmin[:-1]],x[allmin[1:]]), axis=0)
y4 = y[allmin[:-1]] + y[allmin[1:]]
plot(x4, abs(y4), 's-', label='abs(min+min)')


legend(loc='best')
Out[120]:
<matplotlib.legend.Legend at 0x114458a50>
In [121]:
figure(figsize=(12,6))
    
x1 = np.mean((x[allmax],x[allmin]), axis=0)
y1 = y[allmax] - y[allmin]
plot(x1, y1, 'o-', label='max-min')

x2 = np.mean((x[allmax],x[allmin]), axis=0)
y2 = y[allmax] + y[allmin]
plot(x2, abs(y2), '^-', label='abs(max+min)')

x3 = np.mean((x[allmax[:-1]],x[allmax[1:]]), axis=0)
y3 = y[allmax[:-1]] + y[allmax[1:]]
plot(x3, abs(y3), '>-', label='abs(max+max)')

x4 = np.mean((x[allmin[:-1]],x[allmin[1:]]), axis=0)
y4 = y[allmin[:-1]] + y[allmin[1:]]
plot(x4, abs(y4), 's-', label='abs(min+min)')
    
plot_krho_decay(p=(30, 0.001))
    
xscale('log')
yscale('log')
    
legend(loc='best')
Out[121]:
<matplotlib.legend.Legend at 0x1144d1a90>

Select only extrema

Select only maxima

In [122]:
figure(figsize=(12,6))

plot(x[allmax], abs(y[allmax]), 'o')
plot_krho_decay(p=(26, 0.0003))

xscale('log')
yscale('log')

xlim(10,L)
ylim(ymax=1e-2)
Out[122]:
(9.9999999999999995e-08, 0.01)

Select only minima

In [123]:
figure(figsize=(12,6))

plot(x[allmin], abs(y[allmin]), 'o')
plot_krho_decay(p=(18, 0.001))

xscale('log')
yscale('log')

xlim(10,L)
ylim(ymax=1e-2)
Out[123]:
(1.0000000000000001e-05, 0.01)

Scratch

In [124]:
print x[allmin]
print x[allmax]
[  11.80580581   19.56056056   27.44244244   35.32432432   43.20620621
   50.96096096   58.84284284   66.72472472   74.47947948   82.48848849
   90.24324324   98.12512513  106.00700701  113.63463463]
[   8.24624625   15.74674675   23.75575576   31.25625626   39.39239239
   46.89289289   55.15615616   62.52952953   70.91991992   78.16616617
   86.68368368   93.92992993  102.44744745  109.56656657]
In [125]:
arange(8.)*(128-2) / 16 / 2.
Out[125]:
array([  0.    ,   3.9375,   7.875 ,  11.8125,  15.75  ,  19.6875,
        23.625 ,  27.5625])
In [ ]: