Reorganization of headers (I): rename JSC -> ABACUS
All files need to be changed to refer to new headers. First step of the reorganization.
This commit is contained in:
@@ -2,7 +2,7 @@
|
||||
|
||||
This software is part of J.-S. Caux's ABACUS library.
|
||||
|
||||
Copyright (c).
|
||||
Copyright (c) J.-S. Caux.
|
||||
|
||||
-----------------------------------------------------------
|
||||
|
||||
@@ -11,15 +11,14 @@ File: src/LIEBLIN/LiebLin_Sumrules.cc
|
||||
Purpose: provides functions evaluating various sumrule factors
|
||||
for Lieb-Liniger.
|
||||
|
||||
|
||||
***********************************************************/
|
||||
|
||||
#include "JSC.h"
|
||||
#include "ABACUS.h"
|
||||
|
||||
using namespace std;
|
||||
using namespace JSC;
|
||||
using namespace ABACUS;
|
||||
|
||||
namespace JSC {
|
||||
namespace ABACUS {
|
||||
|
||||
//DP Sumrule_Factor (char whichDSF, LiebLin_Bethe_State& RefState, DP Chem_Pot, bool fixed_iK, int iKneeded)
|
||||
DP Sumrule_Factor (char whichDSF, LiebLin_Bethe_State& RefState, DP Chem_Pot, int iKmin, int iKmax)
|
||||
@@ -35,8 +34,8 @@ namespace JSC {
|
||||
// We sum up omega * MEsq/(iK^2) for all values of iKmin <= iK <= iKmax, discounting iK == 0 (where DSF vanishes)
|
||||
// We therefore have (N/L) x L^{-1} x (2\pi/L)^2 x (iKmax - iKmin + 1) = 4 \pi^2 x N x (iKmax - iKmin + 1)/L^4
|
||||
// Discounting iK == 0 (where DSF vanishes), if iKmin <= 0 && iKmax >= 0 (in which case 0 is containted in [iKmin, iKmax])
|
||||
sumrule_factor = (iKmin <= 0 && iKmax >= 0) ?
|
||||
(RefState.L * RefState.L * RefState.L * RefState.L)/(4.0 * PI * PI * RefState.N * (iKmax - iKmin))
|
||||
sumrule_factor = (iKmin <= 0 && iKmax >= 0) ?
|
||||
(RefState.L * RefState.L * RefState.L * RefState.L)/(4.0 * PI * PI * RefState.N * (iKmax - iKmin))
|
||||
: (RefState.L * RefState.L * RefState.L * RefState.L)/(4.0 * PI * PI * RefState.N * (iKmax - iKmin + 1));
|
||||
|
||||
/*
|
||||
@@ -53,7 +52,7 @@ namespace JSC {
|
||||
//else if (whichDSF == 'g') sumrule_factor = 1.0/((2.0 * RefState.Tableau[0].Ncols + 1.0)/RefState.L + RefState.N/RefState.L);
|
||||
// Assume that iKmin == 0 here:
|
||||
//else if (whichDSF == 'g') sumrule_factor = 1.0/(2.0* iKmax + 1.0)/RefState.L + RefState.N/RefState.L);
|
||||
else if (whichDSF == 'g')
|
||||
else if (whichDSF == 'g')
|
||||
sumrule_factor = 1.0/((abs(iKmax - iKmin) + 1.0)/RefState.L + RefState.N/RefState.L);
|
||||
//sumrule_factor = 1.0/((pow(twoPI * iKmax/RefState.L, 2.0) - Chem_Pot + 4.0 * RefState.c_int * RefState.N/RefState.L)/RefState.L);
|
||||
// For the one-body function, it's just the density:
|
||||
@@ -61,20 +60,20 @@ namespace JSC {
|
||||
else if (whichDSF == 'q') sumrule_factor = 1.0;
|
||||
else if (whichDSF == 'B') sumrule_factor = 1.0;
|
||||
else if (whichDSF == 'C') sumrule_factor = 1.0;
|
||||
else JSCerror("whichDSF option not consistent in Sumrule_Factor");
|
||||
else ABACUSerror("whichDSF option not consistent in Sumrule_Factor");
|
||||
}
|
||||
|
||||
//else if (fixed_iK) {
|
||||
else if (iKmin == iKmax) {
|
||||
if (whichDSF == 'Z') sumrule_factor = 1.0;
|
||||
else if (whichDSF == 'd' || whichDSF == '1')
|
||||
else if (whichDSF == 'd' || whichDSF == '1')
|
||||
//// We sum up omega * MEsq/(iK^2): this should give (1/L) x (N/L) x k^2 = N x (2\pi)^2/L^4
|
||||
//sumrule_factor = pow(RefState.L, 4.0)/(4.0 * PI * PI * RefState.N);
|
||||
// We sum up omega * MEsq
|
||||
//sumrule_factor = pow(RefState.L, 4.0)/(4.0 * PI * PI * iKneeded * iKneeded * RefState.N);
|
||||
sumrule_factor = pow(RefState.L, 4.0)/(4.0 * PI * PI * iKmax * iKmax * RefState.N);
|
||||
else if (whichDSF == 'g' || whichDSF == 'o') {
|
||||
// We sum up omega * MEsq
|
||||
// We sum up omega * MEsq
|
||||
//sumrule_factor = 1.0/((pow(twoPI * iKneeded/RefState.L, 2.0) - Chem_Pot + 4.0 * RefState.c_int * RefState.N/RefState.L)/RefState.L);
|
||||
sumrule_factor = 1.0/((pow(twoPI * iKmax/RefState.L, 2.0) - Chem_Pot + 4.0 * RefState.c_int * RefState.N/RefState.L)/RefState.L);
|
||||
}
|
||||
@@ -82,9 +81,9 @@ namespace JSC {
|
||||
else if (whichDSF == 'q') sumrule_factor = 1.0;
|
||||
else if (whichDSF == 'B') sumrule_factor = 1.0;
|
||||
else if (whichDSF == 'C') sumrule_factor = 1.0;
|
||||
else JSCerror("whichDSF option not consistent in Sumrule_Factor");
|
||||
else ABACUSerror("whichDSF option not consistent in Sumrule_Factor");
|
||||
}
|
||||
|
||||
|
||||
return(sumrule_factor);
|
||||
}
|
||||
|
||||
@@ -95,12 +94,12 @@ namespace JSC {
|
||||
infile.open(RAW_Cstr);
|
||||
if(infile.fail()) {
|
||||
cout << "Filename RAW_Cstr = " << RAW_Cstr << endl;
|
||||
JSCerror("Could not open input file in Evaluate_F_Sumrule(LiebLin...).");
|
||||
ABACUSerror("Could not open input file in Evaluate_F_Sumrule(LiebLin...).");
|
||||
}
|
||||
|
||||
// We run through the data file to check the f sumrule at each positive momenta:
|
||||
//int iK_UL = RefState.Tableau[0].Ncols; // this is iK_UL
|
||||
//Vect<DP> Sum_omega_MEsq(0.0, iK_UL + 1);
|
||||
//Vect<DP> Sum_omega_MEsq(0.0, iK_UL + 1);
|
||||
Vect_DP Sum_omega_MEsq (0.0, iKmax - iKmin + 1);
|
||||
Vect_DP Sum_abs_omega_MEsq (0.0, iKmax - iKmin + 1);
|
||||
|
||||
@@ -128,7 +127,7 @@ namespace JSC {
|
||||
infile.close();
|
||||
|
||||
//cout << "Read " << nraw << " entries in raw file." << endl;
|
||||
|
||||
|
||||
ofstream outfile;
|
||||
outfile.open(FSR_Cstr);
|
||||
outfile.precision(16);
|
||||
@@ -136,23 +135,23 @@ namespace JSC {
|
||||
if (whichDSF == 'd' || whichDSF == '1') {
|
||||
/*
|
||||
outfile << 0 << "\t" << 1; // full saturation at k = 0 !
|
||||
for (int i = 1; i <= iK_UL; ++i)
|
||||
outfile << endl << i << "\t" << Sum_omega_MEsq[i] * RefState.L * RefState.L
|
||||
for (int i = 1; i <= iK_UL; ++i)
|
||||
outfile << endl << i << "\t" << Sum_omega_MEsq[i] * RefState.L * RefState.L
|
||||
* RefState.L * RefState.L/(4.0 * PI * PI * i * i * RefState.N);
|
||||
*/
|
||||
|
||||
for (int i = iKmin; i <= iKmax; ++i) {
|
||||
|
||||
if (i > iKmin) outfile << endl;
|
||||
//outfile << i << "\t" << Sum_omega_MEsq[i - iKmin] * pow(RefState.L, 4.0)/(pow(2.0 * PI * JSC::max(abs(i), 1), 2.0) * RefState.N);
|
||||
outfile << i << "\t" << Sum_omega_MEsq[i - iKmin] * pow(RefState.L, 4.0)/(pow(2.0 * PI * JSC::max(abs(i), 1), 2.0) * RefState.N)
|
||||
//outfile << i << "\t" << Sum_omega_MEsq[i - iKmin] * pow(RefState.L, 4.0)/(pow(2.0 * PI * ABACUS::max(abs(i), 1), 2.0) * RefState.N);
|
||||
outfile << i << "\t" << Sum_omega_MEsq[i - iKmin] * pow(RefState.L, 4.0)/(pow(2.0 * PI * ABACUS::max(abs(i), 1), 2.0) * RefState.N)
|
||||
// Include average of result at +iK and -iK in a third column: iK is at index index(iK) = iK - iKmin
|
||||
// so -iK is at index index(-iK) = -iK - iKmin
|
||||
// so -iK is at index index(-iK) = -iK - iKmin
|
||||
// We can only use this index if it is >= 0 and < iKmax - iKmin + 1, otherwise third column is copy of second:
|
||||
<< "\t" << ((i + iKmin <= 0 && -i < iKmax + 1) ?
|
||||
0.5 * (Sum_omega_MEsq[i - iKmin] + Sum_omega_MEsq[-i - iKmin])
|
||||
: Sum_omega_MEsq[i - iKmin])
|
||||
* pow(RefState.L, 4.0)/(pow(2.0 * PI * JSC::max(abs(i), 1), 2.0) * RefState.N);
|
||||
<< "\t" << ((i + iKmin <= 0 && -i < iKmax + 1) ?
|
||||
0.5 * (Sum_omega_MEsq[i - iKmin] + Sum_omega_MEsq[-i - iKmin])
|
||||
: Sum_omega_MEsq[i - iKmin])
|
||||
* pow(RefState.L, 4.0)/(pow(2.0 * PI * ABACUS::max(abs(i), 1), 2.0) * RefState.N);
|
||||
}
|
||||
}
|
||||
else if (whichDSF == 'g' || whichDSF == 'o') {
|
||||
@@ -168,7 +167,7 @@ namespace JSC {
|
||||
///((4.0 * PI * PI * i * i)/(RefState.L * RefState.L) - Chem_Pot + 4.0 * RefState.c_int * RefState.N/RefState.L);
|
||||
outfile << i << "\t" << Sum_omega_MEsq[i - iKmin] * RefState.L
|
||||
/((4.0 * PI * PI * i * i)/(RefState.L * RefState.L) - Chem_Pot + 4.0 * RefState.c_int * RefState.N/RefState.L)
|
||||
<< "\t" << ((i + iKmin <= 0 && -i < iKmax + 1) ?
|
||||
<< "\t" << ((i + iKmin <= 0 && -i < iKmax + 1) ?
|
||||
0.5 * (Sum_omega_MEsq[i - iKmin] + Sum_omega_MEsq[-i - iKmin]) : Sum_omega_MEsq[i - iKmin])
|
||||
* RefState.L/((4.0 * PI * PI * i * i)/(RefState.L * RefState.L) - Chem_Pot + 4.0 * RefState.c_int * RefState.N/RefState.L);
|
||||
}
|
||||
@@ -182,7 +181,7 @@ namespace JSC {
|
||||
{
|
||||
|
||||
stringstream RAW_stringstream; string RAW_string;
|
||||
RAW_stringstream << prefix << ".raw";
|
||||
RAW_stringstream << prefix << ".raw";
|
||||
RAW_string = RAW_stringstream.str(); const char* RAW_Cstr = RAW_string.c_str();
|
||||
|
||||
stringstream FSR_stringstream; string FSR_string;
|
||||
@@ -224,9 +223,9 @@ namespace JSC {
|
||||
|
||||
// Define the raw input file name:
|
||||
stringstream filenameprefix;
|
||||
//Data_File_Name (filenameprefix, whichDSF, iKmin, iKmax, kBT, ensemble.state[ns], ensemble.state[ns], ensemble.state[ns].label);
|
||||
Data_File_Name (filenameprefix, whichDSF, iKmin, iKmax, 0.0, ensemble.state[ns], ensemble.state[ns], ensemble.state[ns].label);
|
||||
string prefix = filenameprefix.str();
|
||||
//Data_File_Name (filenameprefix, whichDSF, iKmin, iKmax, kBT, ensemble.state[ns], ensemble.state[ns], ensemble.state[ns].label);
|
||||
Data_File_Name (filenameprefix, whichDSF, iKmin, iKmax, 0.0, ensemble.state[ns], ensemble.state[ns], ensemble.state[ns].label);
|
||||
string prefix = filenameprefix.str();
|
||||
stringstream RAW_stringstream; string RAW_string;
|
||||
RAW_stringstream << prefix << ".raw";
|
||||
RAW_string = RAW_stringstream.str(); const char* RAW_Cstr = RAW_string.c_str();
|
||||
@@ -235,7 +234,7 @@ namespace JSC {
|
||||
infile.open(RAW_Cstr);
|
||||
if(infile.fail()) {
|
||||
cout << "Filename RAW_Cstr = " << RAW_Cstr << endl;
|
||||
JSCerror("Could not open input file in Evaluate_F_Sumrule(LiebLin...).");
|
||||
ABACUSerror("Could not open input file in Evaluate_F_Sumrule(LiebLin...).");
|
||||
}
|
||||
|
||||
while (infile.peek() != EOF) {
|
||||
@@ -258,21 +257,21 @@ namespace JSC {
|
||||
if (whichDSF == 'd' || whichDSF == '1') {
|
||||
/*
|
||||
outfile << 0 << "\t" << 1; // full saturation at k = 0 !
|
||||
for (int i = 1; i <= iK_UL; ++i)
|
||||
outfile << endl << i << "\t" << Sum_omega_MEsq[i] * RefState.L * RefState.L
|
||||
for (int i = 1; i <= iK_UL; ++i)
|
||||
outfile << endl << i << "\t" << Sum_omega_MEsq[i] * RefState.L * RefState.L
|
||||
* RefState.L * RefState.L/(4.0 * PI * PI * i * i * RefState.N);
|
||||
*/
|
||||
for (int i = iKmin; i <= iKmax; ++i) {
|
||||
if (i > iKmin) outfile << endl;
|
||||
//outfile << i << "\t" << Sum_omega_MEsq[i - iKmin] * pow(RefState.L, 4.0)/(pow(2.0 * PI * JSC::max(abs(i), 1), 2.0) * RefState.N);
|
||||
outfile << i << "\t" << Sum_omega_MEsq[i - iKmin] * pow(RefState.L, 4.0)/(pow(2.0 * PI * JSC::max(abs(i), 1), 2.0) * RefState.N)
|
||||
//outfile << i << "\t" << Sum_omega_MEsq[i - iKmin] * pow(RefState.L, 4.0)/(pow(2.0 * PI * ABACUS::max(abs(i), 1), 2.0) * RefState.N);
|
||||
outfile << i << "\t" << Sum_omega_MEsq[i - iKmin] * pow(RefState.L, 4.0)/(pow(2.0 * PI * ABACUS::max(abs(i), 1), 2.0) * RefState.N)
|
||||
// Include average of result at +iK and -iK in a third column: iK is at index index(iK) = iK - iKmin
|
||||
// so -iK is at index index(-iK) = -iK - iKmin
|
||||
// so -iK is at index index(-iK) = -iK - iKmin
|
||||
// We can only use this index if it is >= 0 and < iKmax - iKmin + 1, otherwise third column is copy of second:
|
||||
<< "\t" << ((i + iKmin <= 0 && -i < iKmax + 1) ?
|
||||
0.5 * (Sum_omega_MEsq[i - iKmin] + Sum_omega_MEsq[-i - iKmin])
|
||||
: Sum_omega_MEsq[i - iKmin])
|
||||
* pow(RefState.L, 4.0)/(pow(2.0 * PI * JSC::max(abs(i), 1), 2.0) * RefState.N);
|
||||
<< "\t" << ((i + iKmin <= 0 && -i < iKmax + 1) ?
|
||||
0.5 * (Sum_omega_MEsq[i - iKmin] + Sum_omega_MEsq[-i - iKmin])
|
||||
: Sum_omega_MEsq[i - iKmin])
|
||||
* pow(RefState.L, 4.0)/(pow(2.0 * PI * ABACUS::max(abs(i), 1), 2.0) * RefState.N);
|
||||
}
|
||||
}
|
||||
else if (whichDSF == 'g' || whichDSF == 'o') {
|
||||
@@ -288,7 +287,7 @@ namespace JSC {
|
||||
///((4.0 * PI * PI * i * i)/(RefState.L * RefState.L) - Chem_Pot + 4.0 * RefState.c_int * RefState.N/RefState.L);
|
||||
outfile << i << "\t" << Sum_omega_MEsq[i - iKmin] * RefState.L
|
||||
/((4.0 * PI * PI * i * i)/(RefState.L * RefState.L) - Chem_Pot + 4.0 * RefState.c_int * RefState.N/RefState.L)
|
||||
<< "\t" << ((i + iKmin <= 0 && -i < iKmax + 1) ?
|
||||
<< "\t" << ((i + iKmin <= 0 && -i < iKmax + 1) ?
|
||||
0.5 * (Sum_omega_MEsq[i - iKmin] + Sum_omega_MEsq[-i - iKmin]) : Sum_omega_MEsq[i - iKmin])
|
||||
* RefState.L/((4.0 * PI * PI * i * i)/(RefState.L * RefState.L) - Chem_Pot + 4.0 * RefState.c_int * RefState.N/RefState.L);
|
||||
}
|
||||
@@ -299,4 +298,4 @@ namespace JSC {
|
||||
}
|
||||
|
||||
|
||||
} // namespace JSC
|
||||
} // namespace ABACUS
|
||||
|
||||
Reference in New Issue
Block a user