ABACUS/src/EXECS/Smoothen_LiebLin_DSF_MosesS...

98 lines
4.0 KiB
C++

/**********************************************************
This software is part of J.-S. Caux's ABACUS library.
Copyright (c) J.-S. Caux.
-----------------------------------------------------------
File: Smoothen_LiebLin_DSF_MosesState.cc
Purpose: produces .dsf and .ssf files from a .raw file
***********************************************************/
#include "ABACUS.h"
using namespace std;
using namespace ABACUS;
int main(int argc, char* argv[])
{
if (argc != 15) { // Print out instructions
cout << endl << "Welcome to ABACUS\t(copyright J.-S. Caux)." << endl;
cout << endl << "Usage of Smoothen_LiebLin_DSF_MosesState executable: " << endl;
cout << endl << "Provide the following arguments:" << endl << endl;
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" << endl;
cout << "DP L \t\t\t Length of the system" << endl;
cout << "int N \t\t\t Number of particles" << endl;
cout << "int Nl \t\t\t Number of particles in left Fermi sea (Nr is then N - Nl)" << endl;
cout << "int DIl \t\t shift of left sea as compared to its ground state position" << endl;
cout << "int DIr \t\t shift of right sea as compared to its ground state position" << endl;
cout << "int iKmin" << endl << "int iKmax \t\t Min and max momentum integers" << endl;
//cout << "DP kBT \t\t Temperature" << endl;
cout << "int DiK \t\t\t Window of iK over which DSF is averaged (DiK == 0 means a single iK is used; DiK == 1 means 3 are used (iK-1, iK, iK+1), etc.)" << endl;
cout << "DP ommin" << endl << "DP ommax \t\t Min and max frequencies to cover in smoothened DSF" << endl;
cout << "Nom \t\t\t Number of frequency points used for discretization" << endl;
cout << "DP width \t\t Gaussian width used in smoothing, in units of two-particle level spacing" << endl;
cout << endl << "EXAMPLE: " << endl << endl;
cout << "Smoothen_LiebLin_DSF_MosesState d 1.0 100.0 100 50 -30 40 0 200 1 0.0 10.0 500 2.0" << endl << endl;
}
else if (argc == 15) { // !fixed_iK
char whichDSF = *argv[1];
DP c_int = atof(argv[2]);
DP L = atof(argv[3]);
int N = atoi(argv[4]);
int Nl = atoi(argv[5]);
//int Nr = N - Nl;
int DIl = atoi(argv[6]);
int DIr = atoi(argv[7]);
int iKmin = atoi(argv[8]);
int iKmax = atoi(argv[9]);
//DP kBT = atof(argv[10]);
DP kBT = 0.0;
int DiK = atoi(argv[10]);
DP ommin = atof(argv[11]);
DP ommax = atof(argv[12]);
int Nom = atoi(argv[13]);
DP width = atof(argv[14]);
// Handy default name:
stringstream defaultScanStatename_strstream;
defaultScanStatename_strstream << "Moses_Nl_" << Nl << "_DIl_" << DIl << "_DIr_" << DIr;
string defaultScanStatename = defaultScanStatename_strstream.str();
stringstream filenameprefix;
//void Data_File_Name (stringstream& name, char whichDSF, DP c_int, DP L, int N, int iKmin, int iKmax, DP kBT, DP L2)
Data_File_Name (filenameprefix, whichDSF, c_int, L, N, iKmin, iKmax, kBT, 0.0, defaultScanStatename);
string prefix = filenameprefix.str();
DP normalization = twoPI * L;
DP denom_sum_K = L;
Write_K_File (L, iKmin, iKmax);
Write_Omega_File (Nom, ommin, ommax);
//cout << "Smoothing: sumcheck = " << Smoothen_RAW_into_SF (prefix, iKmin, iKmax, ommin, ommax, Nom, width, normalization) << endl;
// We use the scaled width function as default:
DP sumcheck;
//if (kBT < 0.1)
//sumcheck = Smoothen_RAW_into_SF_LiebLin_Scaled (prefix, L, N, iKmin, iKmax, DiK, ommin, ommax, Nom, width, normalization);
sumcheck = Smoothen_RAW_into_SF (prefix, iKmin, iKmax, DiK, ommin, ommax, Nom, width, normalization, denom_sum_K);
//else sumcheck = Smoothen_RAW_into_SF (prefix, iKmin, iKmax, ommin, ommax, Nom, width, normalization);
//cout << "Smoothing: sumcheck = " << sumcheck << endl;
}
//else ABACUSerror("Wrong number of arguments to Smoothen_LiebLin_DSF executable.");
return(0);
}