Tweak scripts for catalogue

This commit is contained in:
Jean-Sébastien 2021-12-14 09:24:47 +01:00
förälder 9d03fcdd66
incheckning 362d856e74
8 ändrade filer med 29 tillägg och 15 borttagningar

Visa fil

@ -78,7 +78,7 @@ basedir="$(pwd)"
for c in $clist
do
echo '** Starting run for c =' $c', N = '$N
dir='Lieb-Liniger/'$correlator'/T_'$kBT'/c_scan/k_fixed/k_'${(l:2::0:)nk}'kFo4/sr_'$target_sumrule'/N_'$N'/data/store/c_'$c
dir='Lieb-Liniger/'$correlator'/T_'$kBT'/c_scan/k_fixed/k_'${(l:2::0:)nk}'kFo4/sr_'$target_sumrule'/store/data/N_'$N'/c_'$c
mkdir -p $dir
cd $dir
LiebLin_DSF $whichDSF $c $N $N $iK $iK $kBT $Max_Secs $target_sumrule $refine

Visa fil

@ -84,7 +84,7 @@ basedir="$(pwd)"
for c in $clist
do
echo '** Starting computation of DSFs for c =' $c', N = '$N
dir='Lieb-Liniger/'$correlator'/T_'$kBT'/c_scan/k_fixed/k_'${(l:2::0:)nk}'kFo4/sr_'$target_sumrule'/N_'$N'/data/store/c_'$c
dir='Lieb-Liniger/'$correlator'/T_'$kBT'/c_scan/k_fixed/k_'${(l:2::0:)nk}'kFo4/sr_'$target_sumrule'/store/data/N_'$N'/c_'$c
cd $dir
Smoothen_LiebLin_DSF_Scaled $whichDSF $c $N $N $iK $iK $kBT 0 $ommin $ommax $Nom $width
cd $basedir

Visa fil

@ -82,9 +82,9 @@ done
basedir="$(pwd)"
echo '** Starting run for N = '$N
dir='Lieb-Liniger/'$correlator'/T_'$kBT'/c_scan/k_fixed/k_'${(l:2::0:)nk}'kFo4/sr_'$target_sumrule'/N_'$N'/data/plots'
dir='Lieb-Liniger/'$correlator'/T_'$kBT'/c_scan/k_fixed/k_'${(l:2::0:)nk}'kFo4/sr_'$target_sumrule'/store/plots'
mkdir -p $dir
cd $dir
plot_c_scan_k_fixed_dsfs.py $width
plot_c_scan_k_fixed_dsfs.py $N $width
cd $basedir
echo ' Successfully computed DSFs for N = '$N'.\n'

Visa fil

@ -63,7 +63,7 @@ do
for nk in {1..16}
do
echo '** Starting run for c =' $c', kfact = '$nk | tee -a $logfile
dir='Lieb-Liniger/'$correlator'/T_'$kBT'/c_'$c'/k_fixed/k_'${(l:2::0:)nk}'kFo4/sr_'$target_sumrule'/prelim'
dir='Lieb-Liniger/'$correlator'/T_'$kBT'/c_fixed/c_'$c'/k_fixed/k_'${(l:2::0:)nk}'kFo4/sr_'$target_sumrule'/prelim'
mkdir -p $dir
cd $dir
LiebLin_Catalogue_Fixed_c_k_Nscaling $whichDSF $c $nk $kBT $target_sumrule 0 $nr_minutes | tee -a $basedir/$logfile

Visa fil

@ -61,7 +61,7 @@ do
# Number of points:
Nom=1000
echo 'Starting computation of DSFs for c =' $c', kfact = '$nk
dir='Lieb-Liniger/'$correlator'/T_'$kBT'/c_'$c'/k_fixed/k_'${(l:2::0:)nk}'kFo4/sr_'$target_sumrule'/store/data'
dir='Lieb-Liniger/'$correlator'/T_'$kBT'/c_fixed/c_'$c'/k_fixed/k_'${(l:2::0:)nk}'kFo4/sr_'$target_sumrule'/store/data'
cd $dir
for datadir in *
do

Visa fil

@ -49,7 +49,7 @@ do
for nk in {1..16}
do
echo '** Starting plotting of DSFs for c =' $c', k = '$nk' kFo4.'
dir='Lieb-Liniger/'$correlator'/T_'$kBT'/c_'$c'/k_fixed/k_'${(l:2::0:)nk}'kFo4/sr_'$target_sumrule'/store/plots'
dir='Lieb-Liniger/'$correlator'/T_'$kBT'/c_fixed/c_'$c'/k_fixed/k_'${(l:2::0:)nk}'kFo4/sr_'$target_sumrule'/store/plots'
mkdir -p $dir
cd $dir
# Move all K_, Omega_ and .dsfs files to the plots directory

Visa fil

@ -13,15 +13,16 @@ import numpy as np
import os
import sys
width = str(sys.argv[1])
N = str(sys.argv[1])
width = str(sys.argv[2])
# Get the list of interactions which have been computed
dirlist = os.listdir('../store/')
dirlist = os.listdir('../data/N_%s' % N)
clist = sorted([float(c.lstrip('c_')) for c in dirlist])
# Get the Omega file
omegafile = glob.glob('../store/c_%s*/Omega*' % str(clist[0]).rstrip('.0')[:12])[0]
omegafile = glob.glob('../data/N_%s/c_%s*/Omega*' % (N, str(clist[0]).rstrip('.0')[:12]))[0]
omega = np.loadtxt(omegafile)
# Load all the available dsfs from the data store
@ -31,11 +32,22 @@ for c in clist:
# first try for exact match, stripping '.0' to treat integer values, e.g. 4.0 into 4
# and then (if it doesn't work) use only the first 12 characters, plus wildcard, to cover rounding errors
try:
dsffile = glob.glob('../store/c_%s/*_w_%s.dsfs' % (str(c).rstrip('.0'), width))[0]
dsffile = glob.glob('../data/N_%s/c_%s/*_w_%s.dsfs' % (N, str(c).rstrip('.0'), width))[0]
except IndexError:
dsffile = glob.glob('../store/c_%s*/*_w_%s.dsfs' % (str(c).rstrip('.0')[:12], width))[0]
dsffile = glob.glob('../data/N_%s/c_%s*/*_w_%s.dsfs' % (N, str(c).rstrip('.0')[:12], width))[0]
dsfs[str(c)] = np.loadtxt(dsffile)
# Read some useful parameters from (last) file name:
elements = dsffile.rpartition('/')[2].split('_')
L = elements[5]
#N = elements[7]
iK = elements[12]
width = elements[20].rpartition('.')[0]
# which leads to
rho = int(N)/int(L)
kokF = int(iK)*0.5/int(L)
fig, ax = plt.subplots()
ax.set_xlim(omega[0], omega[-1])
@ -43,9 +55,10 @@ ax.set_xlim(omega[0], omega[-1])
dsfsmax = max(dsfs[str(clist[0])])
print('dsfsmax = ', dsfsmax)
ymax = 1.2 * dsfsmax
ymax = 1.01 * dsfsmax
ymax=4
xtext = 0.6 * omega[-1]
ytext = 1.1 * dsfsmax
ytext = 0.9 * ymax
ax.set_ylim([0, ymax])
ax.text(xtext, ytext, f'c = {clist[0]}')
@ -54,6 +67,7 @@ def animate(i):
ax.clear()
ax.set_xlim(omega[0], omega[-1])
ax.set_ylim([0, ymax])
ax.set_title(f'c scan, rho={rho} (N={N}), k={kokF}k_F, w={width}')
ax.text(xtext, ytext, f'c = {clist[i]:10.6f}')
ax.plot(omega, dsfs[str(clist[i])])

Visa fil

@ -30,7 +30,7 @@ int main(int argc, char* argv[])
cout << "char whichDSF \t\t Which structure factor should be calculated ? Options are: "
"d for rho rho, g for psi psi{dagger}, o for psi{dagger} psi" << endl;
cout << "DP c_int \t\t Value of the interaction parameter: use positive real values only" << endl;
cout << "int kfact \t\t momentum factor: momemntum will be set to kfact * kF/4" << endl;
cout << "int kfact \t\t momentum factor: momentum will be set to kfact * kF/4" << endl;
cout << "DP kBT \t\t Temperature (positive only of course)" << endl;
cout << "DP target_sumrule \t sumrule saturation you're satisfied with" << endl;
cout << "int Hrs \t\t Allowed computational time (hours)" << endl;