You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

LiebLin_DSF_GeneralState.cc 3.2KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586
  1. /**********************************************************
  2. This software is part of J.-S. Caux's ABACUS library.
  3. Copyright (c) J.-S. Caux.
  4. -----------------------------------------------------------
  5. File: LiebLin_DSF_GeneralState.cc
  6. Purpose: function for ABACUS for LiebLin gas, on general states
  7. ***********************************************************/
  8. #include "ABACUS.h"
  9. using namespace std;
  10. using namespace ABACUS;
  11. int main(int argc, char* argv[])
  12. {
  13. if (argc != 11) { // provide some info
  14. cout << endl << "Welcome to ABACUS\t(copyright J.-S. Caux)." << endl;
  15. cout << endl << "Usage of LiebLin_DSF_Tgt0 executable: " << endl;
  16. cout << endl << "Provide the following arguments:" << endl << endl;
  17. cout << "char whichDSF \t\t Which structure factor should be calculated ? Options are: "
  18. "d for rho rho, g for psi psi{dagger}, o for psi{dagger} psi" << endl;
  19. cout << "DP c_int \t\t Value of the interaction parameter: use positive real values only" << endl;
  20. cout << "DP L \t\t\t Length of the system: use positive real values only" << endl;
  21. cout << "int N \t\t\t Number of particles: use positive integer values only" << endl;
  22. cout << "char* defaultScanStatename:\t\t file [].Ix2 contains the quantum numbers defining the "
  23. "AveragingState; used as defaultScanStatename" << endl;
  24. cout << "int iKmin" << endl << "int iKmax \t\t Min and max momentum integers to scan over: "
  25. "recommended values: -2*N and 2*N" << endl;
  26. cout << "int Max_Secs \t\t Allowed computational time: (in seconds)" << endl;
  27. cout << "DP target_sumrule \t sumrule saturation you're satisfied with" << endl;
  28. cout << "bool refine \t\t Is this a refinement of earlier calculations ? (0 == false, 1 == true)" << endl;
  29. cout << endl << "EXAMPLE: " << endl << endl;
  30. cout << "LiebLin_DSF d 1.0 100.0 100 0 200 0.56 600 1.0 0" << endl << endl;
  31. }
  32. else { // (argc == 10), correct nr of arguments
  33. int n = 1;
  34. char whichDSF = *argv[n++];
  35. DP c_int = atof(argv[n++]);
  36. DP L = atof(argv[n++]);
  37. int N = atoi(argv[n++]);
  38. char* Ix2filenameprefix = argv[n++];
  39. int iKmin = atoi(argv[n++]);
  40. int iKmax = atoi(argv[n++]);
  41. int Max_Secs = atoi(argv[n++]);
  42. DP target_sumrule = atof(argv[n++]);
  43. bool refine = (atoi(argv[n++]) == 1);
  44. // Read the Ix2 from the file:
  45. Vect<int> Ix2_input(N);
  46. ifstream Ix2_input_file;
  47. stringstream filenamestrstream;
  48. filenamestrstream << Ix2filenameprefix;
  49. string defaultScanStatename = filenamestrstream.str();
  50. filenamestrstream << ".Ix2";
  51. string filenamestr = filenamestrstream.str();
  52. const char* filename_Cstr = filenamestr.c_str();
  53. Ix2_input_file.open(filename_Cstr);
  54. if (Ix2_input_file.fail()) {
  55. cout << filename_Cstr << endl;
  56. ABACUSerror("Could not open Ix2 input file in LiebLin_DSF_GeneralState");
  57. }
  58. for (int i = 0; i < N; ++i) {
  59. Ix2_input_file >> Ix2_input[i];
  60. }
  61. // Now define the AveragingState
  62. LiebLin_Bethe_State AveragingState(c_int, L, N);
  63. AveragingState.Ix2 = Ix2_input;
  64. AveragingState.Compute_All(true);
  65. Scan_LiebLin (whichDSF, AveragingState, defaultScanStatename, iKmin, iKmax, Max_Secs, target_sumrule, refine);
  66. }
  67. return(0);
  68. }