In [ ]:
import sys, os
from matplotlib import pyplot as plt
from pprint import pprint
import numpy as np
import time

filein = "../Benchmark/test0.out"
data = np.loadtxt(filein,skiprows=1)
t0=time.clock()
eig_vals = np.linalg.eigvals(data)
print time.clock() - t0, "seconds process time"
eig_vals_sorted = np.sort(eig_vals)
pprint(eig_vals_sorted)

In [ ]:
import sys,os
import numpy as np
from pprint import pprint

filein = "../Benchmark/test2_4.in"
mtx = np.loadtxt(filein)
print(np.matrix(mtx))
w,v = np.linalg.eig(mtx)
w,v

In [ ]:
import sys, os
from matplotlib import pyplot as plt
from pprint import pprint
import numpy as np


ffig = "omega1.pdf"
filein = "efnts.out"
data = np.loadtxt(filein)
y = data[:,4]

#n=len(y)
x = np.arange(0.01,1.01,0.01)
plot = plt.plot(x,y)
plt.show()
plt.savefig(ffig)
plt.clf()

In [1]:
########################################
## Plot number of iterations vs.      ##
## number of grid points (matrix dim) ##
########################################
import sys, os, math
from matplotlib import pyplot as plt
import numpy as np

x=[20,50,100,200,500]
##xl=[math.log10(t) for t in x]
y=[609,4047,16532,66618,421903]
f=np.polyfit(x,y,2)
ff=np.poly1d(f)
xf=np.linspace(10,550)
print(np.poly1d(f))
##yl=[math.log10(t) for t in y]
##plt.axis([0,5,0,7])
##plot = plt.plot(x,y,'b+',markersize=10)
##plt.show()
fig1, ax1=plt.subplots()
ax1.plot(x,y,'r+',markersize=10)
ax1.plot(xf,ff(xf),'b')
plt.xlabel('Dimensionality')
plt.ylabel('Number of Iterations')
ax1.set_xscale('log')
ax1.set_yscale('log')
plt.show()
#plt.savefig("dnit.pdf")
#plt.clf()


       2
1.703 x - 7.823 x + 160.4

In [ ]:
#####################################
## Plot first three wave functions ##
#####################################
import sys, os, math
from matplotlib import pyplot as plt
import numpy as np

x = np.linspace(0.1,5.1,50)

infile1 = "../Benchmark/wavefunction0.out"
infile2 = "../Benchmark/wavefunction1.out"
infile3 = "../Benchmark/wavefunction2.out"

y1 = np.loadtxt(infile1)
y2 = np.loadtxt(infile2)
y3 = np.loadtxt(infile3)

plt.axis([0.,5.,0.,0.1])
plot1 = plt.plot(x,y1,'b',label='gs')
plot2 = plt.plot(x,y2,'r',label='ex1')
plot3 = plt.plot(x,y3,'g',label='ex2')
plt.xlabel(r'$\rho$')
plt.ylabel(r'$|\psi|^2$')
plt.legend(loc=1)
plt.show()

In [37]:
########################################
## Plot wvfnts with different omega^2 ##
########################################
import sys, os, math
from matplotlib import pyplot as plt
import numpy as np

infile1 = "../Benchmark/GSwavefunction0.00.out"
infile2 = "../Benchmark/GSwavefunction0.25.out"
infile3 = "../Benchmark/GSwavefunction1.00.out"
infile4 = "../Benchmark/GSwavefunction25.00.out"

data1 = np.loadtxt(infile1)
x1 = data1[:,0]
y1 = data1[:,1]
print np.sum(y1)

data2 = np.loadtxt(infile2)
x2 = data2[:,0]
y2 = data2[:,1]
print np.sum(y2)

data3 = np.loadtxt(infile3)
x3 = data3[:,0]
y3 = data3[:,1]
print np.sum(y3)

data4 = np.loadtxt(infile4)
x4 = data4[:,0]
y4 = data4[:,1]
print np.sum(y4)

#max1 = np.amax(y1)
#max2 = np.amax(y2)
#max3 = np.amax(y3)
#max4 = np.amax(y4)
#ys1  = [t*(max4/max1) for t in y1]
#ys2  = [t*(max4/max2) for t in y2]
#ys3  = [t*(max4/max3) for t in y3]

fig1, ax1=plt.subplots()
##plt.axis([0.,16.,0.,0.05])
plot1 = plt.plot(x1,y1,'k',label=r'$\omega = 0.01$')
plot2 = plt.plot(x2,y2,'b',label=r'$\omega = 0.25$')
plot3 = plt.plot(x3,y3,'r',label=r'$\omega = 1.0$')
plot4 = plt.plot(x4,y4,'g',label=r'$\omega = 5.0$')
plt.xlabel(r'$\rho$')
plt.ylabel(r'$|\psi|^2$')
ax1.set_xscale('log')
ax1.set_yscale('log')
ax1.set_yticklabels([])
plt.legend(loc=1)
plt.show()


1.00000024876
0.999998583287
1.00000537554
0.999993607283

In [28]:
#################################
## Plot single gs wavefunction ##
#################################
import sys, os, math
from matplotlib import pyplot as plt
import numpy as np

infile = "../Benchmark/GSwavefunction0.25.out"

data = np.loadtxt(infile)

x = data[:,0]
y = data[:,1]
plot1 = plt.plot(x,y)
plt.show()

In [ ]: