Browse Source

Rework catalogue building

master
Jean-Sébastien 2 years ago
parent
commit
9c759b3f04

+ 40
- 29
include/ABACUS_Scan.h View File

@@ -101,35 +101,6 @@ namespace ABACUS {
101 101
   Vect<std::string> Descendent_States_with_iK_Stepped_Down_rightIx2only
102 102
     (std::string ScanIx2_label, const Heis_Bethe_State& OriginState, bool disperse_only_current_exc, bool preserve_nexc);
103 103
 
104
-  // Functions in src/SCAN/General_Scan.cc:
105
-  void Scan_LiebLin (char whichDSF, DP c_int, DP L, int N, int iKmin, int iKmax, DP kBT,
106
-		     int Max_Secs, DP target_sumrule, bool refine, int paralevel, Vect<int> rank, Vect<int> nr_processors);
107
-  void Scan_LiebLin (char whichDSF, DP c_int, DP L, int N, int iKmin, int iKmax, DP kBT,
108
-		     int Max_Secs, DP target_sumrule, bool refine);
109
-  void Scan_LiebLin (char whichDSF, LiebLin_Bethe_State AveragingState, std::string defaultScanStatename, int iKmin, int iKmax,
110
-		     int Max_Secs, DP target_sumrule, bool refine, int paralevel, Vect<int> rank, Vect<int> nr_processors);
111
-  void Scan_LiebLin (char whichDSF, LiebLin_Bethe_State AveragingState, std::string defaultname, int iKmin, int iKmax,
112
-		     int Max_Secs, DP target_sumrule, bool refine);
113
-  void Scan_LiebLin_Geometric_Quench (DP c_int, DP L_1, int type_id_1, long long int id_1, DP L_2, int N,
114
-				      int iK_UL, int Max_Secs, DP target_sumrule, bool refine);
115
-
116
-  void Scan_Heis (char whichDSF, DP Delta, int N, int M, int iKmin, int iKmax,
117
-		  int Max_Secs, DP target_sumrule, bool refine, int paralevel, Vect<int> rank, Vect<int> nr_processors);
118
-  void Scan_Heis (char whichDSF, DP Delta, int N, int M, int iKmin, int iKmax,
119
-		  int Max_Secs, DP target_sumrule, bool refine);
120
-  void Scan_Heis (char whichDSF, XXZ_Bethe_State& AveragingState, std::string defaultScanStatename, int iKmin, int iKmax,
121
-		  int Max_Secs, DP target_sumrule, bool refine, int paralevel, Vect<int> rank, Vect<int> nr_processors);
122
-  void Scan_Heis (char whichDSF, XXX_Bethe_State& AveragingState, std::string defaultScanStatename, int iKmin, int iKmax,
123
-		  int Max_Secs, DP target_sumrule, bool refine, int paralevel, Vect<int> rank, Vect<int> nr_processors);
124
-  void Scan_Heis (char whichDSF, XXZ_gpd_Bethe_State& AveragingState, std::string defaultScanStatename, int iKmin, int iKmax,
125
-		  int Max_Secs, DP target_sumrule, bool refine, int paralevel, Vect<int> rank, Vect<int> nr_processors);
126
-
127
-  void Scan_ODSLF (char whichDSF, DP Delta, int N, int M, int iKmin, int iKmax,
128
-		   int Max_Secs, DP target_sumrule, bool refine, int rank, int nr_processors);
129
-  void Scan_ODSLF (char whichDSF, DP Delta, int N, int M, int iKmin, int iKmax, int Max_Secs, bool refine);
130
-  void Scan_ODSLF (char whichDSF, DP Delta, int N, int M, int iKneeded, int Max_Secs, bool refine);
131
-  void Scan_ODSLF (char whichDSF, DP Delta, int N, int M, int Max_Secs, bool refine);
132
-
133 104
   // Functions to prepare and wrapup parallel scans:
134 105
   void Prepare_Parallel_Scan_LiebLin (char whichDSF, DP c_int, DP L, int N, int iKmin, int iKmax, DP kBT,
135 106
 				      std::string defaultname, int paralevel, Vect<int> rank_lower_paralevels,
@@ -228,10 +199,50 @@ namespace ABACUS {
228 199
 
229 200
   std::ostream& operator<< (std::ostream& s, const Scan_Info& info);
230 201
 
202
+  // Functions in src/SCAN/General_Scan.cc:
231 203
   template<class Tstate>
232 204
     Scan_Info General_Scan (char whichDSF, int iKmin, int iKmax, int iKmod, DP kBT, Tstate& AveragingState, Tstate& SeedScanState,
233 205
 			    std::string defaultScanStatename, int Max_Secs, DP target_sumrule, bool refine, int paralevel, Vect<int> rank, Vect<int> nr_processors);
234 206
 
207
+  Scan_Info Scan_LiebLin (char whichDSF, DP c_int, DP L, int N, int iKmin, int iKmax, DP kBT,
208
+			  int Max_Secs, DP target_sumrule, bool refine,
209
+			  int paralevel, Vect<int> rank, Vect<int> nr_processors);
210
+  Scan_Info Scan_LiebLin (char whichDSF, DP c_int, DP L, int N, int iKmin, int iKmax, DP kBT,
211
+			  int Max_Secs, DP target_sumrule, bool refine);
212
+  Scan_Info Scan_LiebLin (char whichDSF, LiebLin_Bethe_State AveragingState, std::string defaultScanStatename,
213
+			  int iKmin, int iKmax,
214
+			  int Max_Secs, DP target_sumrule, bool refine,
215
+			  int paralevel, Vect<int> rank, Vect<int> nr_processors);
216
+  Scan_Info Scan_LiebLin (char whichDSF, LiebLin_Bethe_State AveragingState, std::string defaultname,
217
+			  int iKmin, int iKmax,
218
+			  int Max_Secs, DP target_sumrule, bool refine);
219
+  Scan_Info Scan_LiebLin_Geometric_Quench (DP c_int, DP L_1, int type_id_1, long long int id_1, DP L_2, int N,
220
+					   int iK_UL, int Max_Secs, DP target_sumrule, bool refine);
221
+
222
+  Scan_Info Scan_Heis (char whichDSF, DP Delta, int N, int M, int iKmin, int iKmax,
223
+		       int Max_Secs, DP target_sumrule, bool refine,
224
+		       int paralevel, Vect<int> rank, Vect<int> nr_processors);
225
+  Scan_Info Scan_Heis (char whichDSF, DP Delta, int N, int M, int iKmin, int iKmax,
226
+		       int Max_Secs, DP target_sumrule, bool refine);
227
+  Scan_Info Scan_Heis (char whichDSF, XXZ_Bethe_State& AveragingState, std::string defaultScanStatename,
228
+		       int iKmin, int iKmax,
229
+		       int Max_Secs, DP target_sumrule, bool refine,
230
+		       int paralevel, Vect<int> rank, Vect<int> nr_processors);
231
+  Scan_Info Scan_Heis (char whichDSF, XXX_Bethe_State& AveragingState, std::string defaultScanStatename,
232
+		       int iKmin, int iKmax,
233
+		       int Max_Secs, DP target_sumrule, bool refine,
234
+		       int paralevel, Vect<int> rank, Vect<int> nr_processors);
235
+  Scan_Info Scan_Heis (char whichDSF, XXZ_gpd_Bethe_State& AveragingState, std::string defaultScanStatename,
236
+		       int iKmin, int iKmax,
237
+		       int Max_Secs, DP target_sumrule, bool refine,
238
+		       int paralevel, Vect<int> rank, Vect<int> nr_processors);
239
+
240
+  Scan_Info Scan_ODSLF (char whichDSF, DP Delta, int N, int M, int iKmin, int iKmax,
241
+			int Max_Secs, DP target_sumrule, bool refine, int rank, int nr_processors);
242
+  Scan_Info Scan_ODSLF (char whichDSF, DP Delta, int N, int M, int iKmin, int iKmax, int Max_Secs, bool refine);
243
+  Scan_Info Scan_ODSLF (char whichDSF, DP Delta, int N, int M, int iKneeded, int Max_Secs, bool refine);
244
+  Scan_Info Scan_ODSLF (char whichDSF, DP Delta, int N, int M, int Max_Secs, bool refine);
245
+
235 246
 
236 247
   //****************************************************************************
237 248
 

+ 11
- 3
scripts/build_LiebLin_catalogue_k_fixed.sh View File

@@ -42,7 +42,15 @@ kBT=$2
42 42
 target_sumrule=$3
43 43
 nr_minutes=$4
44 44
 
45
-logfile='run_'$whichDSF'_kBT_'$kBT'_sr_'$target_sumrule'_'$(date '+%Y-%m-%d-%Hh%M')'.log'
45
+correlator='rho-rho'
46
+if [[ $whichDSF == 'o' ]]; then
47
+    correlator='psidag-psi'
48
+elif [[ $whichDSF == 'g' ]]; then
49
+    correlator='psi-psidag'
50
+fi
51
+
52
+mkdir -p logs
53
+logfile='logs/run_'$whichDSF'_kBT_'$kBT'_sr_'$target_sumrule'_'$(date '+%Y-%m-%d-%Hh%M')'.log'
46 54
 touch $logfile
47 55
 
48 56
 clist=(1024 512 256 128 64 32 16 8 4 2 1 0.5 0.25 0.125 0.0625 0.03125 0.015625)
@@ -55,11 +63,11 @@ do
55 63
     for nk in {1..16}
56 64
     do
57 65
 	echo 'Starting run for c =' $c', kfact = '$nk | tee -a $logfile
58
-	dir='c_'$c'/kBT_'$kBT'/k_fixed/k_'${(l:2::0:)nk}'kFo4/sr_'$target_sumrule
66
+	dir='Lieb-Liniger/'$correlator'/T_'$kBT'/c_'$c'/k_fixed/k_'${(l:2::0:)nk}'kFo4/sr_'$target_sumrule'/prelim'
59 67
 	mkdir -p $dir
60 68
 	cd $dir
61 69
 	LiebLin_Catalogue_Fixed_c_k_Nscaling $whichDSF $c $nk $kBT $target_sumrule 0 $nr_minutes | tee -a $basedir/$logfile
62 70
 	cd $basedir
63
-	echo ' Successfully completed run for c =' $c', kfact = '$nk'\n' | tee -a $logfile
71
+	echo 'Successfully completed run for c =' $c', kfact = '$nk'\n' | tee -a $logfile
64 72
     done
65 73
 done

scripts/build_LiebLin_catalogue_k_fixed_dsf.sh → scripts/build_LiebLin_catalogue_k_fixed_dsfs.sh View File

@@ -35,6 +35,13 @@ kBT=$2
35 35
 target_sumrule=$3
36 36
 width=$4
37 37
 
38
+correlator='rho-rho'
39
+if [[ $whichDSF == 'o' ]]; then
40
+    correlator='psidag-psi'
41
+elif [[ $whichDSF == 'g' ]]; then
42
+    correlator='psi-psidag'
43
+fi
44
+
38 45
 clist=(1024 512 256 128 64 32 16 8 4 2 1 0.5 0.25 0.125 0.0625 0.03125 0.015625)
39 46
 
40 47
 basedir="$(pwd)"
@@ -53,16 +60,18 @@ do
53 60
 	ommax=$(($nk*($nk + 8)))
54 61
 	# Number of points:
55 62
 	Nom=1000
56
-	echo 'Starting computation of DSFs for c =' $c', kfact = '$nk | tee -a $logfile
57
-	dir='c_'$c'/kBT_'$kBT'/k_fixed/k_'${(l:2::0:)nk}'kFo4/sr_'$target_sumrule
63
+	echo 'Starting computation of DSFs for c =' $c', kfact = '$nk
64
+	dir='Lieb-Liniger/'$correlator'/T_'$kBT'/c_'$c'/k_fixed/k_'${(l:2::0:)nk}'kFo4/sr_'$target_sumrule'/store/data'
58 65
 	cd $dir
59
-	echo $dir
60
-	mkdir -p plots/
61
-	LiebLin_Catalogue_Fixed_c_k_Nscaling_Smoothen_DSF $whichDSF $c $nk $kBT $target_sumrule $ommin $ommax $Nom $width
62
-	mv *dsfs plots/
63
-	mv K_* plots/
64
-	mv Omega_* plots/
66
+	for datadir in *
67
+	do
68
+	    cd $datadir
69
+	    N=${datadir#"N_"}
70
+	    iK=$(($nk * $N/8))
71
+	    Smoothen_LiebLin_DSF_Scaled $whichDSF $c $N $N $iK $iK $kBT 0 $ommin $ommax $Nom $width
72
+	    cd ..
73
+	done
65 74
 	cd $basedir
66
-	echo ' Successfully computed DSFs for c =' $c', kfact = '$nk'\n' | tee -a $logfile
75
+	echo ' Successfully computed DSFs for c =' $c', kfact = '$nk'\n'
67 76
     done
68 77
 done

scripts/build_LiebLin_catalogue_k_fixed_plot_dsf.sh → scripts/build_LiebLin_catalogue_k_fixed_dsfs_plots.sh View File

@@ -32,6 +32,13 @@ kBT=$2
32 32
 target_sumrule=$3
33 33
 width=$4
34 34
 
35
+correlator='rho-rho'
36
+if [[ $whichDSF == 'o' ]]; then
37
+    correlator='psidag-psi'
38
+elif [[ $whichDSF == 'g' ]]; then
39
+    correlator='psi-psidag'
40
+fi
41
+
35 42
 clist=(1024 512 256 128 64 32 16 8 4 2 1 0.5 0.25 0.125 0.0625 0.03125 0.015625)
36 43
 
37 44
 basedir="$(pwd)"
@@ -41,9 +48,14 @@ for c in $clist
41 48
 do
42 49
     for nk in {1..16}
43 50
     do
44
-	echo 'Starting plotting of DSFs for c =' $c', kfact = '$nk | tee -a $logfile
45
-	dir='c_'$c'/kBT_'$kBT'/k_fixed/k_'${(l:2::0:)nk}'kFo4/sr_'$target_sumrule'/plots'
51
+	echo 'Starting plotting of DSFs for c =' $c', kfact = '$nk
52
+	dir='Lieb-Liniger/'$correlator'/T_'$kBT'/c_'$c'/k_fixed/k_'${(l:2::0:)nk}'kFo4/sr_'$target_sumrule'/store/plots'
53
+	mkdir -p $dir
46 54
 	cd $dir
55
+	# Move all K_, Omega_ and .dsfs files to the plots directory
56
+	mv ../data/*/K_* .
57
+	mv ../data/*/Omega_* .
58
+	mv ../data/*/*dsfs .
47 59
 	dirlist="$(ls)"
48 60
 	# Find the Omega file
49 61
 	for file in *
@@ -54,16 +66,14 @@ do
54 66
 	done
55 67
 	echo 'Omega file: ' $omegafile
56 68
 	# For each .dsfs file, plot
57
-	for file in *
69
+	for file in *.dsfs
58 70
 	do
59
-	    if [[ $file = LiebLin*dsfs ]]; then
60
-		echo 'Found file ' $file
61
-		# invoke the python script
62
-		plot_dsf_k_fixed.py $omegafile $file
63
-	    fi
71
+	    echo 'Found file ' $file
72
+	    # invoke the python script
73
+	    plot_dsf_k_fixed.py $omegafile $file
64 74
 	done
65 75
 
66 76
 	cd $basedir
67
-	echo ' Successfully plotted DSFs for c =' $c', kfact = '$nk'\n' | tee -a $logfile
77
+	echo ' Successfully plotted DSFs for c =' $c', kfact = '$nk'\n'
68 78
     done
69 79
 done

+ 5
- 5
scripts/plot_dsf_k_fixed.py View File

@@ -23,11 +23,11 @@ plt.ylabel('$S (k, \omega)$')
23 23
 
24 24
 elements = dsffile.split('_')
25 25
 
26
-c_int = elements[4]
27
-L = elements[6]
28
-N = elements[8]
29
-iK = elements[13]
30
-width = elements[23].partition('.')[0]
26
+c_int = elements[3]
27
+L = elements[5]
28
+N = elements[7]
29
+iK = elements[12]
30
+width = elements[20].partition('.')[0]
31 31
 
32 32
 rho = int(N)/int(L)
33 33
 kokF = int(iK)*0.5/int(L)

+ 21
- 3
src/EXECS/LiebLin_Catalogue_Fixed_c_k_Nscaling.cc View File

@@ -92,17 +92,35 @@ int main(int argc, char* argv[])
92 92
       ActualTime = omp_get_wtime();
93 93
       Secs_left = int(Max_Secs - (ActualTime - StartTime));
94 94
 
95
+      Scan_Info resulting_info;
95 96
       if (srsat < target_sumrule && Secs_left > Max_Secs/2)
96 97
 	// Improve the icmin calculation by one chunk:
97
-	Scan_LiebLin (whichDSF, c_int, L, N, iKmin, iKmax, kBT, Secs_left, target_sumrule, refine);
98
+	resulting_info = Scan_LiebLin (whichDSF, c_int, L, N, iKmin, iKmax, kBT,
99
+				       Secs_left, target_sumrule, refine);
100
+
101
+      if (resulting_info.sumrule_obtained > target_sumrule) {
102
+	// Move files to storage, keeping a copy of the .src file in the current directory
103
+	string command1 = "mkdir -p ../store/data/N_" + to_string(N);
104
+	system(command1.c_str());
105
+	string command2 = "mv *_N_" + to_string(N) + "* ../store/data/N_" + to_string(N) + "/";
106
+	system(command2.c_str());
107
+	string command3 = "cp ../store/data/N_" + to_string(N) + "/*src .";
108
+	system(command3.c_str());
109
+      }
98 110
 
99 111
       ActualTime = omp_get_wtime();
100 112
 
101 113
       Secs_left = int(Max_Secs - (ActualTime - StartTime));
102
-      cout << "Done with N = " << N << ". Time left = " << Secs_left << " seconds." << endl;
114
+      cout << "Done with N = " << N << ". Sumrule obtained: " << resulting_info.sumrule_obtained
115
+	   << "\tTime left = " << Secs_left << " seconds." << endl;
103 116
 
104 117
       if (Secs_left < 60) {
105
-	cout << "Breaking out after N = " << N << " since time left = " << Secs_left << endl;
118
+	if (resulting_info.sumrule_obtained > target_sumrule) {
119
+	  cout << "Breaking out after completing N = " << N << " since time left = " << Secs_left << endl;
120
+	}
121
+	else {
122
+	  cout << "Breaking out while working on N = " << N << " since allocated time is exhausted." << endl;
123
+	}
106 124
 	break;
107 125
       }
108 126
 

+ 0
- 109
src/EXECS/LiebLin_Catalogue_Fixed_c_k_Nscaling_Smoothen_DSF.cc View File

@@ -1,109 +0,0 @@
1
-/**********************************************************
2
-
3
-This software is part of J.-S. Caux's ABACUS library.
4
-
5
-Copyright (c) J.-S. Caux.
6
-
7
------------------------------------------------------------
8
-
9
-File:  LiebLin_Catalogue_Fixed_c_k_Nscaling_Smoothen_DSF.cc
10
-
11
-Purpose:  Produces smoothened DSF for output from LiebLin_Catalogue_Fixed_c_k_Nscaling.cc
12
-
13
-***********************************************************/
14
-
15
-#include <omp.h>
16
-#include "ABACUS.h"
17
-
18
-using namespace std;
19
-using namespace ABACUS;
20
-
21
-
22
-int main(int argc, char* argv[])
23
-{
24
-
25
-  if (argc != 10) { // provide some info
26
-
27
-    cout << endl << "Welcome to ABACUS\t(copyright J.-S. Caux)." << endl;
28
-    cout << endl << "Usage of LiebLin_Catalogue_Fixed_c_k_Nscaling_Smoothen_DSF executable: " << endl;
29
-    cout << endl << "Provide the following arguments:" << endl << endl;
30
-    cout << "char whichDSF \t\t Which structure factor should be calculated ?  Options are:  "
31
-      "d for rho rho, g for psi psi{dagger}, o for psi{dagger} psi" << endl;
32
-    cout << "DP c_int \t\t Value of the interaction parameter:  use positive real values only" << endl;
33
-    cout << "int kfact \t\t momentum factor: momemntum will be set to kfact * kF/4" << endl;
34
-    cout << "DP kBT \t\t Temperature (positive only of course)" << endl;
35
-    cout << "DP target_sumrule \t sumrule saturation you're satisfied with" << endl;
36
-    cout << "DP ommin" << endl << "DP ommax \t\t Min and max frequencies to cover in smoothened DSF" << endl;
37
-    cout << "Nom \t\t\t Number of frequency points used for discretization" << endl;
38
-    cout << "DP width \t\t Gaussian width used in smoothing, in units of two-particle level spacing" << endl;
39
-  }
40
-
41
-  else { // correct nr of arguments
42
-    int ia = 1;
43
-    char whichDSF = *argv[ia++];
44
-    DP c_int = atof(argv[ia++]);
45
-    int kfact = atoi(argv[ia++]);
46
-    DP kBT = atof(argv[ia++]);
47
-    DP target_sumrule = atof(argv[ia++]);
48
-    int DiK = 1; // only do fixed momentum
49
-    DP ommin = atof(argv[ia++]);
50
-    DP ommax = atof(argv[ia++]);
51
-    int Nom = atoi(argv[ia++]);
52
-    DP width = atof(argv[ia++]);
53
-
54
-    int iN = 0;
55
-
56
-    int nN = 16;
57
-    Vect<int> Nv(nN);
58
-    // Multiples of 32 up to 256
59
-    for (int i = 1; i <= 8; ++i) Nv[i-1] = 32*i;
60
-    // Then steps of 64 up to 512
61
-    for (int i = 1; i <= 4; ++i) Nv[7+i] = 256 + 64*i;
62
-    // Then steps of 128 up to 1024
63
-    for (int i = 1; i <= 4; ++i) Nv[11+i] = 512 + 128*i;
64
-
65
-    for (int iN = 0; iN < nN; ++iN) {
66
-
67
-      int N = Nv[iN];
68
-      DP L = N;
69
-      int iKmin = (kfact * N)/8;
70
-      int iKmax = iKmin;
71
-      DP srsat = 0.0;
72
-
73
-      stringstream SRC_stringstream;  string SRC_string;
74
-      Data_File_Name (SRC_stringstream, whichDSF, c_int, L, N, iKmin, iKmax, kBT, 0.0, "");
75
-      SRC_stringstream << ".src";
76
-      SRC_string = SRC_stringstream.str();    const char* SRC_Cstr = SRC_string.c_str();
77
-
78
-      fstream srcfile;
79
-      srcfile.open(SRC_Cstr, fstream::in);
80
-      if (srcfile.fail()) {
81
-	srsat = 0.0;
82
-      }
83
-      else {
84
-	srcfile >> srsat;
85
-      }
86
-      srcfile.close();
87
-
88
-      if (srsat > target_sumrule) {
89
-	// Compute the DSF
90
-	stringstream filenameprefix;
91
-	Data_File_Name (filenameprefix, whichDSF, c_int, L, N, iKmin, iKmax, kBT, 0.0, "");
92
-	string prefix = filenameprefix.str();
93
-
94
-	DP normalization = twoPI * L;
95
-
96
-	Write_K_File (L, iKmin, iKmax);
97
-	Write_Omega_File (Nom, ommin, ommax);
98
-
99
-	// We use the scaled width function as default:
100
-	DP sumcheck;
101
-	sumcheck = Smoothen_RAW_into_SF_LiebLin_Scaled (prefix, L, N, iKmin, iKmax, DiK, ommin, ommax, Nom, width, normalization);
102
-      }
103
-
104
-    } // for N
105
-
106
-  } // else if arguments given OK
107
-
108
-  return(0);
109
-}

+ 45
- 47
src/SCAN/General_Scan.cc View File

@@ -853,9 +853,9 @@ namespace ABACUS {
853 853
 
854 854
   // General version for equilibrium correlators at generic (possibly finite) temperature:
855 855
 
856
-  void Scan_LiebLin (char whichDSF, DP c_int, DP L, int N, int iKmin, int iKmax, DP kBT,
857
-		     int Max_Secs, DP target_sumrule, bool refine,
858
-		     int paralevel, Vect<int> rank, Vect<int> nr_processors)
856
+  Scan_Info Scan_LiebLin (char whichDSF, DP c_int, DP L, int N, int iKmin, int iKmax, DP kBT,
857
+			  int Max_Secs, DP target_sumrule, bool refine,
858
+			  int paralevel, Vect<int> rank, Vect<int> nr_processors)
859 859
   {
860 860
 
861 861
     // This function scans the Hilbert space of the LiebLin gas,
@@ -960,30 +960,26 @@ namespace ABACUS {
960 960
     spsfile.close();
961 961
 
962 962
     // Perform the scan:
963
-    General_Scan (whichDSF, iKmin, iKmax, 100000000, kBT, spstate, SeedScanState, "",
964
-		  Max_Secs, target_sumrule, refine, paralevel, rank, nr_processors);
965
-
966
-    return;
963
+    return General_Scan (whichDSF, iKmin, iKmax, 100000000, kBT, spstate, SeedScanState, "",
964
+			 Max_Secs, target_sumrule, refine, paralevel, rank, nr_processors);
967 965
   }
968 966
 
969
-  void Scan_LiebLin (char whichDSF, DP c_int, DP L, int N, int iKmin, int iKmax, DP kBT,
970
-		     int Max_Secs, DP target_sumrule, bool refine)
967
+  Scan_Info Scan_LiebLin (char whichDSF, DP c_int, DP L, int N, int iKmin, int iKmax, DP kBT,
968
+			  int Max_Secs, DP target_sumrule, bool refine)
971 969
   {
972 970
     int paralevel = 0;
973 971
     Vect<int> rank(0,1);
974 972
     Vect<int> nr_processors(0,1);
975 973
 
976
-    Scan_LiebLin (whichDSF, c_int, L, N, iKmin, iKmax, kBT, Max_Secs, target_sumrule,
977
-		  refine, paralevel, rank, nr_processors);
978
-
979
-    return;
974
+    return Scan_LiebLin (whichDSF, c_int, L, N, iKmin, iKmax, kBT, Max_Secs, target_sumrule,
975
+			 refine, paralevel, rank, nr_processors);
980 976
   }
981 977
 
982 978
 
983 979
   // Scanning on an excited state defined by a set of Ix2:
984
-  void Scan_LiebLin (char whichDSF, LiebLin_Bethe_State AveragingState, string defaultScanStatename,
985
-		     int iKmin, int iKmax, int Max_Secs, DP target_sumrule, bool refine,
986
-		     int paralevel, Vect<int> rank, Vect<int> nr_processors)
980
+  Scan_Info Scan_LiebLin (char whichDSF, LiebLin_Bethe_State AveragingState, string defaultScanStatename,
981
+			  int iKmin, int iKmax, int Max_Secs, DP target_sumrule, bool refine,
982
+			  int paralevel, Vect<int> rank, Vect<int> nr_processors)
987 983
   {
988 984
     // This function is as Scan_LiebLin for generic T defined above, except that the
989 985
     // averaging is now done on a state defined by AveragingStateIx2
@@ -1024,30 +1020,28 @@ namespace ABACUS {
1024 1020
     DP kBT = 0.0;
1025 1021
 
1026 1022
     // Perform the scan:
1027
-    General_Scan (whichDSF, iKmin, iKmax, 100000000, kBT, AveragingState, SeedScanState, defaultScanStatename,
1028
-		  Max_Secs, target_sumrule, refine, paralevel, rank, nr_processors);
1029
-
1030
-    return;
1031
-
1023
+    return General_Scan (whichDSF, iKmin, iKmax, 100000000, kBT,
1024
+			 AveragingState, SeedScanState, defaultScanStatename,
1025
+			 Max_Secs, target_sumrule, refine, paralevel, rank, nr_processors);
1032 1026
   }
1033 1027
 
1034 1028
   // Simplified function call of the above:
1035
-  void Scan_LiebLin (char whichDSF, LiebLin_Bethe_State AveragingState, string defaultScanStatename,
1036
-		     int iKmin, int iKmax, int Max_Secs, DP target_sumrule, bool refine)
1029
+  Scan_Info Scan_LiebLin (char whichDSF, LiebLin_Bethe_State AveragingState, string defaultScanStatename,
1030
+			  int iKmin, int iKmax, int Max_Secs, DP target_sumrule, bool refine)
1037 1031
   {
1038 1032
     int paralevel = 0;
1039 1033
     Vect<int> rank(0,1);
1040 1034
     Vect<int> nr_processors(0,1);
1041 1035
 
1042
-    Scan_LiebLin (whichDSF, AveragingState, defaultScanStatename, iKmin, iKmax, Max_Secs,
1043
-		  target_sumrule, refine, paralevel, rank, nr_processors);
1044
-
1045
-    return;
1036
+    return Scan_LiebLin (whichDSF, AveragingState, defaultScanStatename, iKmin, iKmax, Max_Secs,
1037
+			 target_sumrule, refine, paralevel, rank, nr_processors);
1046 1038
   }
1047 1039
 
1048 1040
   // Scanning on a previously-defined AveragingState
1049
-  void Scan_Heis (char whichDSF, XXZ_Bethe_State& AveragingState, string defaultScanStatename, int iKmin, int iKmax,
1050
-		  int Max_Secs, DP target_sumrule, bool refine, int paralevel, Vect<int> rank, Vect<int> nr_processors)
1041
+  Scan_Info Scan_Heis (char whichDSF, XXZ_Bethe_State& AveragingState, string defaultScanStatename,
1042
+		       int iKmin, int iKmax,
1043
+		       int Max_Secs, DP target_sumrule, bool refine,
1044
+		       int paralevel, Vect<int> rank, Vect<int> nr_processors)
1051 1045
   {
1052 1046
     // General state scanning for Heisenberg chains
1053 1047
 
@@ -1070,8 +1064,10 @@ namespace ABACUS {
1070 1064
   }
1071 1065
 
1072 1066
   // Scanning on a previously-defined AveragingState
1073
-  void Scan_Heis (char whichDSF, XXX_Bethe_State& AveragingState, string defaultScanStatename, int iKmin, int iKmax,
1074
-		  int Max_Secs, DP target_sumrule, bool refine, int paralevel, Vect<int> rank, Vect<int> nr_processors)
1067
+  Scan_Info Scan_Heis (char whichDSF, XXX_Bethe_State& AveragingState, string defaultScanStatename,
1068
+		       int iKmin, int iKmax,
1069
+		       int Max_Secs, DP target_sumrule, bool refine,
1070
+		       int paralevel, Vect<int> rank, Vect<int> nr_processors)
1075 1071
   {
1076 1072
     // General state scanning for Heisenberg chains
1077 1073
 
@@ -1088,14 +1084,16 @@ namespace ABACUS {
1088 1084
     else ABACUSerror("Unknown whichDSF in Scan_Heis.");
1089 1085
 
1090 1086
     // Now the scan itself
1091
-    General_Scan (whichDSF, iKmin, iKmax, AveragingState.chain.Nsites, 0.0, AveragingState, SeedScanState,
1092
-		  defaultScanStatename, Max_Secs, target_sumrule, refine, paralevel, rank, nr_processors);
1087
+    return General_Scan (whichDSF, iKmin, iKmax, AveragingState.chain.Nsites, 0.0, AveragingState, SeedScanState,
1088
+			 defaultScanStatename, Max_Secs, target_sumrule, refine, paralevel, rank, nr_processors);
1093 1089
 
1094 1090
   }
1095 1091
 
1096 1092
   // Scanning on a previously-defined AveragingState
1097
-  void Scan_Heis (char whichDSF, XXZ_gpd_Bethe_State& AveragingState, string defaultScanStatename, int iKmin, int iKmax,
1098
-		  int Max_Secs, DP target_sumrule, bool refine, int paralevel, Vect<int> rank, Vect<int> nr_processors)
1093
+  Scan_Info Scan_Heis (char whichDSF, XXZ_gpd_Bethe_State& AveragingState, string defaultScanStatename,
1094
+		       int iKmin, int iKmax,
1095
+		       int Max_Secs, DP target_sumrule, bool refine,
1096
+		       int paralevel, Vect<int> rank, Vect<int> nr_processors)
1099 1097
   {
1100 1098
     // General state scanning for Heisenberg chains
1101 1099
 
@@ -1112,14 +1110,15 @@ namespace ABACUS {
1112 1110
     else ABACUSerror("Unknown whichDSF in Scan_Heis.");
1113 1111
 
1114 1112
     // Now the scan itself
1115
-    General_Scan (whichDSF, iKmin, iKmax, AveragingState.chain.Nsites, 0.0, AveragingState, SeedScanState,
1116
-		  defaultScanStatename, Max_Secs, target_sumrule, refine, paralevel, rank, nr_processors);
1113
+    return General_Scan (whichDSF, iKmin, iKmax, AveragingState.chain.Nsites, 0.0, AveragingState, SeedScanState,
1114
+			 defaultScanStatename, Max_Secs, target_sumrule, refine, paralevel, rank, nr_processors);
1117 1115
 
1118 1116
   }
1119 1117
 
1120 1118
 
1121
-  void Scan_Heis (char whichDSF, DP Delta, int N, int M, int iKmin, int iKmax,
1122
-		  int Max_Secs, DP target_sumrule, bool refine, int paralevel, Vect<int> rank, Vect<int> nr_processors)
1119
+  Scan_Info Scan_Heis (char whichDSF, DP Delta, int N, int M, int iKmin, int iKmax,
1120
+		       int Max_Secs, DP target_sumrule, bool refine,
1121
+		       int paralevel, Vect<int> rank, Vect<int> nr_processors)
1123 1122
   {
1124 1123
     // This function scans the Hilbert space of the Heisenberg spin-1/2 chain
1125 1124
     // for the function identified by whichDSF.
@@ -1190,25 +1189,24 @@ namespace ABACUS {
1190 1189
       else ABACUSerror("Unknown whichDSF in Scan_Heis.");
1191 1190
 
1192 1191
       // Now the scan itself
1193
-      General_Scan (whichDSF, iKmin, iKmax, N, 0.0, GroundState, SeedScanState, "",
1194
-		    Max_Secs, target_sumrule, refine, paralevel, rank, nr_processors);
1192
+      return General_Scan (whichDSF, iKmin, iKmax, N, 0.0, GroundState, SeedScanState, "",
1193
+			   Max_Secs, target_sumrule, refine, paralevel, rank, nr_processors);
1195 1194
     }
1196 1195
 
1197 1196
     else ABACUSerror("Delta out of range in Heis_Structure_Factor");
1198 1197
 
1199
-    return;
1198
+    return Scan_Info();
1200 1199
   }
1201 1200
 
1202
-  void Scan_Heis (char whichDSF, DP Delta, int N, int M, int iKmin, int iKmax,
1203
-		  int Max_Secs, DP target_sumrule, bool refine)
1201
+  Scan_Info Scan_Heis (char whichDSF, DP Delta, int N, int M, int iKmin, int iKmax,
1202
+		       int Max_Secs, DP target_sumrule, bool refine)
1204 1203
   {
1205 1204
     int paralevel = 0;
1206 1205
     Vect<int> rank(0,1);
1207 1206
     Vect<int> nr_processors(0,1);
1208 1207
 
1209
-    Scan_Heis (whichDSF, Delta, N, M, iKmin, iKmax, Max_Secs, target_sumrule, refine, paralevel, rank, nr_processors);
1210
-
1211
-    return;
1208
+    return Scan_Heis (whichDSF, Delta, N, M, iKmin, iKmax,
1209
+		      Max_Secs, target_sumrule, refine, paralevel, rank, nr_processors);
1212 1210
   }
1213 1211
 
1214 1212
 

+ 6
- 6
src/UTILS/Data_File_Name.cc View File

@@ -33,9 +33,9 @@ namespace ABACUS {
33 33
   {
34 34
     name << "LiebLin_";
35 35
     if (whichDSF == 'Z') name << "Z";
36
-    else if (whichDSF == 'd') name << "Rho_Rho";
37
-    else if (whichDSF == 'g') name << "Psi_Psidag";
38
-    else if (whichDSF == 'o') name << "Psidag_Psi";
36
+    else if (whichDSF == 'd') name << "rho-rho";
37
+    else if (whichDSF == 'g') name << "psi-psidag";
38
+    else if (whichDSF == 'o') name << "psidag-psi";
39 39
     else if (whichDSF == 'q') name << "GeomQuench";
40 40
     else if (whichDSF == '1') name << "Type_I_Exp_Data";
41 41
     else if (whichDSF == 'B') name << "BECg2";
@@ -58,9 +58,9 @@ namespace ABACUS {
58 58
   {
59 59
     name << "LiebLin_";
60 60
     if (whichDSF == 'Z') name << "Z";
61
-    else if (whichDSF == 'd') name << "Rho_Rho";
62
-    else if (whichDSF == 'g') name << "Psi_Psidag";
63
-    else if (whichDSF == 'o') name << "Psidag_Psi";
61
+    else if (whichDSF == 'd') name << "rho-rho";
62
+    else if (whichDSF == 'g') name << "psi-psidag";
63
+    else if (whichDSF == 'o') name << "psidag-psi";
64 64
     else if (whichDSF == 'q') name << "GeomQuench";
65 65
     else if (whichDSF == '1') name << "Type_I_Exp_Data";
66 66
     else if (whichDSF == 'B') name << "BECg2";

Loading…
Cancel
Save