Porovnat revize
2 Commity
08c85cf590
...
28f3db1979
Autor | SHA1 | Datum |
---|---|---|
Jean-Sébastien Caux | 28f3db1979 | |
Jean-Sébastien Caux | 6ea82da104 |
4
Makefile
4
Makefile
|
@ -26,7 +26,7 @@ BIN_DIR = $(BASE_DIR)/bin
|
|||
SRC_EXT = cc
|
||||
|
||||
# Compiler choice
|
||||
CXX = g++-11.2
|
||||
CXX = g++
|
||||
CXXFLAGS = -fopenmp
|
||||
LDFLAGS = -O3 -w -fopenmp
|
||||
# Compilation command
|
||||
|
@ -85,7 +85,7 @@ $(LIB_DIR)/lib$(VERSION).a : $(OBJECTS)
|
|||
###########################################
|
||||
# Parallel version
|
||||
|
||||
.PHONE: parallel
|
||||
.PHONY: parallel
|
||||
parallel : $(EXECUTABLES_PAR)
|
||||
|
||||
$(EXECUTABLES_PAR): $(BIN_DIR)/%: $(SRC_DIR)/EXECS/%.$(SRC_EXT) $(LIB_DIR)/lib$(VERSION).a
|
||||
|
|
|
@ -25,12 +25,20 @@ namespace ABACUS {
|
|||
// Functions in src/UTILS/Data_File_Name.cc:
|
||||
void Data_File_Name (std::stringstream& name, char whichDSF, DP c_int, DP L, int N,
|
||||
int iKmin, int iKmax, DP kBT, DP L2, std::string defaultname);
|
||||
std::string Data_Filename (char whichDSF, DP c_int, DP L, int N,
|
||||
int iKmin, int iKmax, DP kBT, DP L2, std::string defaultname);
|
||||
void Data_File_Name (std::stringstream& name, char whichDSF, int iKmin, int iKmax, DP kBT,
|
||||
LiebLin_Bethe_State& State, LiebLin_Bethe_State& RefScanState, std::string defaultname);
|
||||
std::string Data_Filename (char whichDSF, int iKmin, int iKmax, DP kBT,
|
||||
LiebLin_Bethe_State& State, LiebLin_Bethe_State& RefScanState, std::string defaultname);
|
||||
void Data_File_Name (std::stringstream& name, char whichDSF, DP Delta, int N, int M, int iKmin, int iKmax,
|
||||
DP kBT, int N2, std::string defaultname);
|
||||
std::string Data_Filename (char whichDSF, DP Delta, int N, int M, int iKmin, int iKmax,
|
||||
DP kBT, int N2, std::string defaultname);
|
||||
void Data_File_Name (std::stringstream& name, char whichDSF, int iKmin, int iKmax, DP kBT,
|
||||
Heis_Bethe_State& State, Heis_Bethe_State& RefScanState, std::string defaultname);
|
||||
std::string Data_Filename (char whichDSF, int iKmin, int iKmax, DP kBT,
|
||||
Heis_Bethe_State& State, Heis_Bethe_State& RefScanState, std::string defaultname);
|
||||
void ODSLF_Data_File_Name (std::stringstream& name, char whichDSF, DP Delta, int N, int M,
|
||||
int iKmin, int iKmax, DP kBT, int N2, std::string defaultname);
|
||||
void Data_File_Name (std::stringstream& name, char whichDSF, int iKmin, int iKmax, DP kBT,
|
||||
|
@ -149,8 +157,10 @@ namespace ABACUS {
|
|||
Scan_Info(); // constructor, puts everything to zero
|
||||
Scan_Info (DP sr, DP Nf, long long int Ni, long long int Nd, long long int Ndc, long long int Ndc0, double t);
|
||||
|
||||
void Save (const char* outfile_Cstr);
|
||||
void Load (const char* infile_Cstr);
|
||||
// void Save (const char* outfile_Cstr);
|
||||
// void Load (const char* infile_Cstr);
|
||||
void Save (std::string outfile_str);
|
||||
void Load (std::string infile_str);
|
||||
|
||||
inline Scan_Info& operator = (const Scan_Info& ref_info)
|
||||
{
|
||||
|
@ -409,8 +419,10 @@ namespace ABACUS {
|
|||
inline void Raise_Scanning_Flags (DP threshold); // checks whether base/type should be scanned based on simpler base/type combinations
|
||||
|
||||
inline void Order_in_SRC ();
|
||||
inline void Save_Info (const char* sumfile_Cstr);
|
||||
inline void Load_Info (const char* sumfile_Cstr);
|
||||
// inline void Save_Info (const char* sumfile_Cstr);
|
||||
// inline void Load_Info (const char* sumfile_Cstr);
|
||||
inline void Save_Info (std::string sumfile_str);
|
||||
inline void Load_Info (std::string sumfile_str);
|
||||
};
|
||||
|
||||
// Do the explicit class specializations:
|
||||
|
@ -775,11 +787,11 @@ namespace ABACUS {
|
|||
}
|
||||
|
||||
template<class Tstate>
|
||||
inline void Scan_State_List<Tstate>::Save_Info (const char* sumfile_Cstr)
|
||||
inline void Scan_State_List<Tstate>::Save_Info (std::string sumfile_str)
|
||||
{
|
||||
std::ofstream outfile;
|
||||
|
||||
outfile.open(sumfile_Cstr);
|
||||
outfile.open(sumfile_str);
|
||||
if (outfile.fail()) ABACUSerror("Could not open outfile... ");
|
||||
|
||||
outfile.setf(std::ios::fixed);
|
||||
|
@ -803,12 +815,12 @@ namespace ABACUS {
|
|||
}
|
||||
|
||||
template<class Tstate>
|
||||
inline void Scan_State_List<Tstate>::Load_Info (const char* sumfile_Cstr)
|
||||
inline void Scan_State_List<Tstate>::Load_Info (std::string sumfile_str)
|
||||
{
|
||||
std::ifstream infile;
|
||||
infile.open(sumfile_Cstr);
|
||||
infile.open(sumfile_str);
|
||||
if(infile.fail()) {
|
||||
std::cout << std::endl << sumfile_Cstr << std::endl;
|
||||
std::cout << std::endl << sumfile_str << std::endl;
|
||||
ABACUSerror("Could not open input file in Scan_State_List::Load_Info.");
|
||||
}
|
||||
|
||||
|
|
|
@ -39,6 +39,12 @@ namespace ABACUS {
|
|||
|
||||
// Inexplicably missing string functions in standard library:
|
||||
|
||||
inline std::string DP_to_string (DP value) {
|
||||
std::stringstream s;
|
||||
s << std::setprecision(16) << value;
|
||||
return s.str();
|
||||
}
|
||||
|
||||
inline std::string replace(const std::string& str,
|
||||
const std::string& from,
|
||||
const std::string& to) {
|
||||
|
|
|
@ -15,6 +15,6 @@ fig = go.Figure()
|
|||
for datafilename in args.filenames:
|
||||
data = numpy.loadtxt(datafilename, delimiter="\t", usecols=[0,1,2,3])
|
||||
x = [line[0] for line in data]
|
||||
y = [line[3] for line in data]
|
||||
y = [line[2] for line in data]
|
||||
fig.add_trace(go.Bar(x=x, y=y))
|
||||
fig.show()
|
||||
|
|
|
@ -230,6 +230,7 @@ namespace ABACUS {
|
|||
int Max_Secs_used = int(0.9 * Max_Secs); // we don't start any new ithread loop beyond this point
|
||||
int Max_Secs_alert = int(0.95 * Max_Secs); // we break any ongoing ithread loop beyond this point
|
||||
|
||||
/* TO_STR
|
||||
stringstream filenameprefix;
|
||||
Data_File_Name (filenameprefix, whichDSF, iKmin, iKmax, kBT,
|
||||
AveragingState, SeedScanState, defaultScanStatename);
|
||||
|
@ -239,7 +240,14 @@ namespace ABACUS {
|
|||
filenameprefix << "_" << rank[r] << "_" << nr_processors[r];
|
||||
|
||||
string prefix = filenameprefix.str();
|
||||
*/
|
||||
string prefix = Data_Filename(whichDSF, iKmin, iKmax, kBT,
|
||||
AveragingState, SeedScanState, defaultScanStatename);
|
||||
if (in_parallel)
|
||||
for (int r = 0; r < paralevel; ++r)
|
||||
prefix += "_" + to_string(rank[r]) + "_" + to_string(nr_processors[r]);
|
||||
|
||||
/* TO_STR
|
||||
stringstream filenameprefix_prevparalevel;
|
||||
// without the rank and nr_processors of the highest paralevel
|
||||
|
||||
|
@ -249,7 +257,15 @@ namespace ABACUS {
|
|||
filenameprefix << "_" << rank[r] << "_" << nr_processors[r];
|
||||
|
||||
string prefix_prevparalevel = filenameprefix_prevparalevel.str();
|
||||
*/
|
||||
// without the rank and nr_processors of the highest paralevel
|
||||
string prefix_prevparalevel = Data_Filename(whichDSF, iKmin, iKmax, kBT,
|
||||
AveragingState, SeedScanState, defaultScanStatename);
|
||||
if (in_parallel)
|
||||
for (int r = 0; r < paralevel - 1; ++r)
|
||||
prefix_prevparalevel += "_" + to_string(rank[r]) + "_" + to_string(nr_processors[r]);
|
||||
|
||||
/* TO_STR
|
||||
stringstream RAW_stringstream; string RAW_string;
|
||||
stringstream INADM_stringstream; string INADM_string;
|
||||
stringstream CONV0_stringstream; string CONV0_string;
|
||||
|
@ -280,55 +296,66 @@ namespace ABACUS {
|
|||
SUM_string = SUM_stringstream.str(); const char* SUM_Cstr = SUM_string.c_str();
|
||||
|
||||
THRDIR_string = THRDIR_stringstream.str();
|
||||
*/
|
||||
string RAW_str = prefix + ".raw";
|
||||
string INADM_str = prefix + ".inadm";
|
||||
string CONV0_str = prefix + ".conv0";
|
||||
string STAT_str = prefix + ".stat";
|
||||
string LOG_str = prefix + ".log";
|
||||
string THR_str = prefix + ".thr";
|
||||
string THRDIR_str = prefix + "_thrdir";
|
||||
string SRC_str = prefix + ".src";
|
||||
string SUM_str = prefix + ".sum";
|
||||
|
||||
|
||||
fstream RAW_outfile;
|
||||
if (!refine || in_parallel) RAW_outfile.open(RAW_Cstr, fstream::out | fstream::trunc);
|
||||
else RAW_outfile.open(RAW_Cstr, fstream::out | fstream::app);
|
||||
if (!refine || in_parallel) RAW_outfile.open(RAW_str, fstream::out | fstream::trunc);
|
||||
else RAW_outfile.open(RAW_str, fstream::out | fstream::app);
|
||||
if (RAW_outfile.fail()) {
|
||||
cout << RAW_Cstr << endl;
|
||||
cout << RAW_str << endl;
|
||||
ABACUSerror("Could not open RAW_outfile... ");
|
||||
}
|
||||
RAW_outfile.precision(16);
|
||||
|
||||
fstream INADM_outfile;
|
||||
if (!refine || in_parallel) INADM_outfile.open(INADM_Cstr, fstream::out | fstream::trunc);
|
||||
else INADM_outfile.open(INADM_Cstr, fstream::out | fstream::app);
|
||||
if (!refine || in_parallel) INADM_outfile.open(INADM_str, fstream::out | fstream::trunc);
|
||||
else INADM_outfile.open(INADM_str, fstream::out | fstream::app);
|
||||
if (INADM_outfile.fail()) ABACUSerror("Could not open INADM_outfile... ");
|
||||
INADM_outfile.precision(16);
|
||||
|
||||
fstream CONV0_outfile;
|
||||
if (!refine || in_parallel) CONV0_outfile.open(CONV0_Cstr, fstream::out | fstream::trunc);
|
||||
else CONV0_outfile.open(CONV0_Cstr, fstream::out | fstream::app);
|
||||
if (!refine || in_parallel) CONV0_outfile.open(CONV0_str, fstream::out | fstream::trunc);
|
||||
else CONV0_outfile.open(CONV0_str, fstream::out | fstream::app);
|
||||
if (CONV0_outfile.fail()) ABACUSerror("Could not open CONV0_outfile... ");
|
||||
CONV0_outfile.precision(16);
|
||||
|
||||
fstream STAT_outfile;
|
||||
if (!refine || in_parallel) STAT_outfile.open(STAT_Cstr, fstream::out | fstream::trunc);
|
||||
else STAT_outfile.open(STAT_Cstr, fstream::out | fstream::app);
|
||||
if (!refine || in_parallel) STAT_outfile.open(STAT_str, fstream::out | fstream::trunc);
|
||||
else STAT_outfile.open(STAT_str, fstream::out | fstream::app);
|
||||
if (STAT_outfile.fail()) ABACUSerror("Could not open STAT_outfile... ");
|
||||
STAT_outfile.precision(8);
|
||||
|
||||
ofstream LOG_outfile;
|
||||
if (!in_parallel) {
|
||||
if (!refine) LOG_outfile.open(LOG_Cstr, fstream::out | fstream::trunc);
|
||||
else LOG_outfile.open(LOG_Cstr, fstream::out | fstream::app);
|
||||
if (!refine) LOG_outfile.open(LOG_str, fstream::out | fstream::trunc);
|
||||
else LOG_outfile.open(LOG_str, fstream::out | fstream::app);
|
||||
if (LOG_outfile.fail()) ABACUSerror("Could not open LOG_outfile... ");
|
||||
LOG_outfile.precision(16);
|
||||
}
|
||||
else { // in_parallel
|
||||
LOG_outfile.open(LOG_Cstr, fstream::out | fstream::trunc);
|
||||
LOG_outfile.open(LOG_str, fstream::out | fstream::trunc);
|
||||
if (LOG_outfile.fail()) ABACUSerror("Could not open LOG_outfile... ");
|
||||
LOG_outfile.precision(16);
|
||||
}
|
||||
|
||||
Scan_Info scan_info;
|
||||
|
||||
if (!refine) mkdir(THRDIR_string.c_str(), S_IRWXU | S_IRWXG | S_IRWXO);
|
||||
Scan_Thread_Data paused_thread_data (THRDIR_string, refine);
|
||||
if (!refine) mkdir(THRDIR_str.c_str(), S_IRWXU | S_IRWXG | S_IRWXO);
|
||||
Scan_Thread_Data paused_thread_data (THRDIR_str, refine);
|
||||
|
||||
if (refine) {
|
||||
paused_thread_data.Load();
|
||||
if (!in_parallel) scan_info.Load(SRC_Cstr);
|
||||
if (!in_parallel) scan_info.Load(SRC_str);
|
||||
}
|
||||
|
||||
Scan_Info scan_info_before = scan_info; // for LOG file
|
||||
|
@ -338,7 +365,7 @@ namespace ABACUS {
|
|||
Scan_State_List<Tstate> ScanStateList (whichDSF, SeedScanState);
|
||||
ScanStateList.Populate_List(whichDSF, SeedScanState);
|
||||
|
||||
if (refine && !in_parallel) ScanStateList.Load_Info (SUM_Cstr);
|
||||
if (refine && !in_parallel) ScanStateList.Load_Info (SUM_str);
|
||||
else if (in_parallel && rank.sum() == 0) {}; // do nothing, keep info in the higher .sum file!
|
||||
|
||||
DP Chem_Pot = Chemical_Potential (AveragingState);
|
||||
|
@ -807,7 +834,7 @@ namespace ABACUS {
|
|||
CONV0_outfile.close();
|
||||
STAT_outfile.close();
|
||||
|
||||
scan_info.Save(SRC_Cstr);
|
||||
scan_info.Save(SRC_str);
|
||||
|
||||
Scan_Info scan_info_refine = scan_info;
|
||||
scan_info_refine -= scan_info_before;
|
||||
|
@ -850,7 +877,7 @@ namespace ABACUS {
|
|||
|
||||
ScanStateList.Order_in_SRC ();
|
||||
|
||||
ScanStateList.Save_Info (SUM_Cstr);
|
||||
ScanStateList.Save_Info (SUM_str);
|
||||
|
||||
|
||||
// Evaluate f-sumrule:
|
||||
|
@ -890,16 +917,19 @@ namespace ABACUS {
|
|||
// Construct the finite-size saddle-point state:
|
||||
// if we refine, read the quantum numbers of the saddle point state (and seed sps) from the sps file:
|
||||
|
||||
/* TO_STR
|
||||
stringstream SPS_stringstream; string SPS_string;
|
||||
Data_File_Name (SPS_stringstream, whichDSF, c_int, L, N, iKmin, iKmax, kBT, 0.0, "");
|
||||
SPS_stringstream << ".sps";
|
||||
SPS_string = SPS_stringstream.str(); const char* SPS_Cstr = SPS_string.c_str();
|
||||
*/
|
||||
string SPS_str = Data_Filename (whichDSF, c_int, L, N, iKmin, iKmax, kBT, 0.0, "") + ".sps";
|
||||
|
||||
fstream spsfile;
|
||||
if (refine) spsfile.open(SPS_Cstr, fstream::in);
|
||||
else spsfile.open(SPS_Cstr, fstream::out | fstream::trunc);
|
||||
if (refine) spsfile.open(SPS_str, fstream::in);
|
||||
else spsfile.open(SPS_str, fstream::out | fstream::trunc);
|
||||
if (spsfile.fail()) {
|
||||
cout << SPS_Cstr << endl; ABACUSerror("Could not open spsfile.");
|
||||
cout << SPS_str << endl; ABACUSerror("Could not open spsfile.");
|
||||
}
|
||||
|
||||
LiebLin_Bethe_State spstate;
|
||||
|
|
|
@ -25,11 +25,12 @@ namespace ABACUS {
|
|||
Scan_Info::Scan_Info (DP sr, DP Nf, long long int Ni, long long int Nd, long long int Ndc, long long int Ndc0, double t) :
|
||||
sumrule_obtained(sr), Nfull(Nf), Ninadm(Ni), Ndata(Nd), Ndata_conv(Ndc), Ndata_conv0(Ndc0), TT(t) {}
|
||||
|
||||
void Scan_Info::Save (const char* outfile_Cstr)
|
||||
//void Scan_Info::Save (const char* outfile_Cstr)
|
||||
void Scan_Info::Save (string outfile_str)
|
||||
{
|
||||
ofstream outfile;
|
||||
|
||||
outfile.open(outfile_Cstr);
|
||||
outfile.open(outfile_str);
|
||||
if (outfile.fail()) ABACUSerror("Could not open outfile... ");
|
||||
|
||||
outfile.precision(16);
|
||||
|
@ -48,12 +49,13 @@ namespace ABACUS {
|
|||
return;
|
||||
}
|
||||
|
||||
void Scan_Info::Load (const char* infile_Cstr)
|
||||
//void Scan_Info::Load (const char* infile_Cstr)
|
||||
void Scan_Info::Load (string infile_str)
|
||||
{
|
||||
ifstream infile;
|
||||
infile.open(infile_Cstr);
|
||||
infile.open(infile_str);
|
||||
if(infile.fail()) {
|
||||
cout << endl << infile_Cstr << endl;
|
||||
cout << endl << infile_str << endl;
|
||||
ABACUSerror("Could not open input file in Scan_Info::Load.");
|
||||
}
|
||||
|
||||
|
|
|
@ -643,37 +643,55 @@ namespace ABACUS {
|
|||
return(sbar);
|
||||
}
|
||||
|
||||
|
||||
LiebLin_Bethe_State Discretized_LiebLin_Bethe_State (DP c_int, DP L, int N, const Root_Density& rho)
|
||||
{
|
||||
// This function returns the Bethe state at finite size which is
|
||||
// the closest approximation to the continuum density rho(lambda)
|
||||
|
||||
// Each time N \int_{-\infty}^\lambda d\lambda' \rho(\lambda') crosses a half integer, add a particle:
|
||||
// Check that the provided rho has the expected filling
|
||||
DP rho_check = 0.0;
|
||||
for (int i = 0; i < rho.Npts; ++i) rho_check += L * rho.value[i] * rho.dlambda[i];
|
||||
// The integral of rho should be between N - 0.5 and N + 0.5 for the algorithm to work
|
||||
if (fabs(rho_check - N) > 0.5)
|
||||
cout << "WARNING: integral of rho != N in Discretized_LiebLin_Bethe_State, "
|
||||
<< "consistent discretization is impossible. \int rho dlambda = "
|
||||
<< rho_check << ", N = " << N << ", L = " << L << ", N/L = " << N/L << endl;
|
||||
|
||||
// Using the counting function
|
||||
// c(\lambda) \equiv L \int_{-\infty}^\lambda d\lambda' \rho(\lambda'),
|
||||
// we seek to find lambda[i] such that c(lambda[i]) = i + 0.5, i = 0...N-1
|
||||
DP integral = 0.0;
|
||||
DP integral_prev = 0.0;
|
||||
int Nfound = 0;
|
||||
Vect<DP> lambda_found(0.0, 2*N);
|
||||
Vect<DP> lambda_found(0.0, N);
|
||||
int nr_to_set = 0;
|
||||
|
||||
for (int i = 0; i < rho.Npts; ++i) {
|
||||
// Note: integral_prev is the counting function
|
||||
// at rapidity rho.lambda[i-1] + 0.5* rho.dlambda[i-1]
|
||||
// which equals rho.lambda[i] - 0.5* rho.dlambda[i]
|
||||
integral_prev = integral;
|
||||
// Note: integral gives the value of the counting function
|
||||
// at rapidity rho.lambda[i] + 0.5* rho.dlambda[i]
|
||||
integral += L * rho.value[i] * rho.dlambda[i];
|
||||
if (integral > Nfound + 0.5) {
|
||||
// Subtle error: if the rho is too discontinuous, i.e. if more than one rapidity is found, must correct for this.
|
||||
if (integral > Nfound + 1.5 && integral < Nfound + 2.5) { // found two rapidities
|
||||
lambda_found[Nfound++] = 0.25 * (3.0 * rho.lambda[i-1] + rho.lambda[i]);
|
||||
lambda_found[Nfound++] = 0.25 * (rho.lambda[i-1] + 3.0 * rho.lambda[i]);
|
||||
}
|
||||
else {
|
||||
// Better: center the lambda_found between these points:
|
||||
lambda_found[Nfound] = 0.5 * (rho.lambda[i-1] + rho.lambda[i]);
|
||||
Nfound++;
|
||||
}
|
||||
// We already have filled the RHS of the counting equation up to Nfound - 0.5.
|
||||
// Therefore, the additional number found is
|
||||
nr_to_set = floor(integral + 0.5 - Nfound);
|
||||
// if (nr_to_set > 1)
|
||||
// cout << "WARNING: setting " << nr_to_set << " rapidities in one step in Discretized_LiebLin_Bethe_State" << endl;
|
||||
for (int n = 1; n <= nr_to_set; ++n) {
|
||||
// Solve c(lambda[Nfound]) = Nfound + 0.5 for lambda[Nfound],
|
||||
// namely (using linear interpolation)
|
||||
// integral_prev + (lambda - rho.lambda[i-1] - 0.5*rho.dlambda[i-1]) * (integral - integra_prev)/rho.dlambda[i] = Nfound + 0.5
|
||||
lambda_found[Nfound] = rho.lambda[i-1] + 0.5*rho.dlambda[i-1] + (Nfound + 0.5 - integral_prev) * rho.dlambda[i]/(integral - integral_prev);
|
||||
Nfound++;
|
||||
}
|
||||
}
|
||||
|
||||
Vect<DP> lambda(N);
|
||||
// Fill up the found rapidities:
|
||||
for (int il = 0; il < ABACUS::min(N, Nfound); ++il) lambda[il] = lambda_found[il];
|
||||
for (int il = 0; il < abacus::min(N, Nfound); ++il) lambda[il] = lambda_found[il];
|
||||
// If there are missing ones, put them at the end; ideally, this should never be called
|
||||
for (int il = Nfound; il < N; ++il) lambda[il] = lambda_found[Nfound-1] + (il - Nfound + 1) * (lambda_found[Nfound-1] - lambda_found[Nfound-2]);
|
||||
|
||||
|
@ -687,6 +705,9 @@ namespace ABACUS {
|
|||
Ix2[i] = 2.0 * floor((L* lambda[i] + sum)/twoPI + 0.5 * (N%2 ? 1 : 2)) + (N%2) - 1;
|
||||
}
|
||||
|
||||
// Check that the Ix2 are all ordered
|
||||
for (int i = 0; i < N-1; ++i) if (Ix2[i] >= Ix2[i+1]) cout << "Alert: Ix2 not ordered around index i = " << i << ": Ix2[i] = " << Ix2[i] << "\tIx2[i+1] = " << Ix2[i+1] << endl;
|
||||
|
||||
// Check that the quantum numbers are all distinct:
|
||||
bool allOK = false;
|
||||
while (!allOK) {
|
||||
|
|
|
@ -53,6 +53,32 @@ namespace ABACUS {
|
|||
return;
|
||||
}
|
||||
|
||||
string Data_Filename (char whichDSF, DP c_int, DP L, int N, int iKmin, int iKmax,
|
||||
DP kBT, DP L2, string defaultScanStatename)
|
||||
{
|
||||
string name = "LiebLin_";
|
||||
if (whichDSF == 'Z') name += "Z";
|
||||
else if (whichDSF == 'd') name += "rho-rho";
|
||||
else if (whichDSF == 'g') name += "psi-psidag";
|
||||
else if (whichDSF == 'o') name += "psidag-psi";
|
||||
else if (whichDSF == 'q') name += "GeomQuench";
|
||||
else if (whichDSF == '1') name += "Type_I_Exp_Data";
|
||||
else if (whichDSF == 'B') name += "BECg2";
|
||||
else if (whichDSF == 'C') name += "BECoverlap";
|
||||
else ABACUSerror("Option not implemented in Data_File_Name");
|
||||
|
||||
name += "_c_" + DP_to_string(c_int) + "_L_" + DP_to_string(L) + "_N_" + to_string(N);
|
||||
if (defaultScanStatename == "") name += "_" + to_string(N) + "_0_"; // simulates label of ground state
|
||||
else name += "_" + defaultScanStatename;
|
||||
if (iKmin == iKmax) name += "_iK_" + to_string(iKmin);
|
||||
else name += "_iKmin_" + to_string(iKmin) + "_iKmax_" + to_string(iKmax);
|
||||
if (kBT > 0.0) name += "_kBT_" + DP_to_string(kBT);
|
||||
if (whichDSF == 'q') name += "_L2_" + DP_to_string(L2);
|
||||
|
||||
return(name);
|
||||
}
|
||||
|
||||
|
||||
void Data_File_Name (stringstream& name, char whichDSF, int iKmin, int iKmax, DP kBT,
|
||||
LiebLin_Bethe_State& State, LiebLin_Bethe_State& RefScanState, string defaultScanStatename)
|
||||
{
|
||||
|
@ -77,6 +103,32 @@ namespace ABACUS {
|
|||
return;
|
||||
}
|
||||
|
||||
string Data_Filename (char whichDSF, int iKmin, int iKmax, DP kBT,
|
||||
LiebLin_Bethe_State& State, LiebLin_Bethe_State& RefScanState,
|
||||
string defaultScanStatename)
|
||||
{
|
||||
string name = "LiebLin_";
|
||||
if (whichDSF == 'Z') name += "Z";
|
||||
else if (whichDSF == 'd') name += "rho-rho";
|
||||
else if (whichDSF == 'g') name += "psi-psidag";
|
||||
else if (whichDSF == 'o') name += "psidag-psi";
|
||||
else if (whichDSF == 'q') name += "GeomQuench";
|
||||
else if (whichDSF == '1') name += "Type_I_Exp_Data";
|
||||
else if (whichDSF == 'B') name += "BECg2";
|
||||
else if (whichDSF == 'C') name += "BECoverlap";
|
||||
else ABACUSerror("Option not implemented in Data_File_Name");
|
||||
|
||||
name += "_c_" + DP_to_string(State.c_int) + "_L_" + DP_to_string(State.L) + "_N_" + to_string(State.N);
|
||||
if (defaultScanStatename == "") name += "_" + State.label;
|
||||
else name += "_" + defaultScanStatename;
|
||||
if (iKmin == iKmax) name += "_iK_" + to_string(iKmin);
|
||||
else name += "_iKmin_" + to_string(iKmin) + "_iKmax_" + to_string(iKmax);
|
||||
if (kBT > 0.0) name += "_kBT_" + DP_to_string(kBT);
|
||||
if (whichDSF == 'q') name += "_L2_" + DP_to_string(RefScanState.L);
|
||||
|
||||
return(name);
|
||||
}
|
||||
|
||||
|
||||
// Heisenberg:
|
||||
|
||||
|
@ -109,6 +161,35 @@ namespace ABACUS {
|
|||
return;
|
||||
}
|
||||
|
||||
string Data_Filename (char whichDSF, DP Delta, int N, int M, int iKmin, int iKmax,
|
||||
DP kBT, int N2, string defaultScanStatename)
|
||||
{
|
||||
string name = "HEIS_";
|
||||
if (whichDSF == 'Z') name += "Z";
|
||||
else if (whichDSF == 'm') name += "Smp";
|
||||
else if (whichDSF == 'z') name += "Szz";
|
||||
else if (whichDSF == 'p') name += "Spm";
|
||||
else if (whichDSF == 'a') name += "SzSz";
|
||||
else if (whichDSF == 'b') name += "SzSm";
|
||||
else if (whichDSF == 'c') name += "SmSm";
|
||||
else if (whichDSF == 'q') name += "GeomQuench";
|
||||
else {
|
||||
cout << "Option tried (1): " << whichDSF << endl;
|
||||
ABACUSerror("Option not implemented in Data_File_Name");
|
||||
}
|
||||
|
||||
name += "_D_" + to_string(Delta) + "_N_" + to_string(N) + "_M_";
|
||||
for (int i = 0; i < int(log10(DP(N/2))) - int(log10(DP(M))); ++i) name += "0";
|
||||
name += to_string(M);
|
||||
if (defaultScanStatename == "") name += "_" + to_string(M) + "_0_"; // simulates label of ground state
|
||||
else name += "_" + defaultScanStatename;
|
||||
|
||||
if (kBT > 0.0) name += "_kBT_" + to_string(kBT);
|
||||
if (whichDSF == 'q') name += "_N2_" + to_string(N2);
|
||||
|
||||
return(name);
|
||||
}
|
||||
|
||||
void Data_File_Name (stringstream& name, char whichDSF, int iKmin, int iKmax, DP kBT,
|
||||
Heis_Bethe_State& State, Heis_Bethe_State& RefScanState, string defaultScanStatename)
|
||||
{
|
||||
|
@ -137,6 +218,34 @@ namespace ABACUS {
|
|||
return;
|
||||
}
|
||||
|
||||
string Data_Filename (char whichDSF, int iKmin, int iKmax, DP kBT,
|
||||
Heis_Bethe_State& State, Heis_Bethe_State& RefScanState, string defaultScanStatename)
|
||||
{
|
||||
string name = "HEIS_";
|
||||
if (whichDSF == 'Z') name += "Z";
|
||||
else if (whichDSF == 'm') name += "Smp";
|
||||
else if (whichDSF == 'z') name += "Szz";
|
||||
else if (whichDSF == 'p') name += "Spm";
|
||||
else if (whichDSF == 'a') name += "SzSz";
|
||||
else if (whichDSF == 'b') name += "SzSm";
|
||||
else if (whichDSF == 'c') name += "SmSm";
|
||||
else if (whichDSF == 'q') name += "GeomQuench";
|
||||
else {
|
||||
cout << "Option tried (2): " << whichDSF << endl;
|
||||
ABACUSerror("Option not implemented in Data_File_Name");
|
||||
}
|
||||
|
||||
name += "_D_" + to_string(State.chain.Delta) + "_N_" + to_string(State.chain.Nsites) + "_M_";
|
||||
for (int i = 0; i < int(log10(DP(State.chain.Nsites/2))) - int(log10(DP(State.base.Mdown))); ++i) name += "0";
|
||||
name += to_string(State.base.Mdown);
|
||||
if (defaultScanStatename == "") name += "_" + State.label;
|
||||
else name += "_" + defaultScanStatename;
|
||||
if (kBT > 0.0) name += "_kBT_" + to_string(kBT);
|
||||
if (whichDSF == 'q') name += "_N2_" + to_string(RefScanState.chain.Nsites);
|
||||
|
||||
return(name);
|
||||
}
|
||||
|
||||
|
||||
// One-D spinless fermions: IN DEVELOPMENT
|
||||
/*
|
||||
|
|
|
@ -23,7 +23,7 @@ namespace ABACUS {
|
|||
|
||||
// M0[|type1:M1|type2:M2...]_nexc0[|nexc1|nexc2...]_type0Ix2old@type0Ix2new[:...][|type1Ix2old@type1Ix2new...]
|
||||
|
||||
// A label is always relative to another label reference state, in practise
|
||||
// A label is always relative to another label reference state, in practice
|
||||
// the seed state used in the scanning for correlations (or otherwise by default: the ground state).
|
||||
|
||||
// The first part of the label (before the first _ ) labels the particle content (the "base").
|
||||
|
|
Načítá se…
Odkázat v novém úkolu