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.

ABACUS_TBA.h 5.7KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145
  1. /**********************************************************
  2. This software is part of J.-S. Caux's ABACUS. library.
  3. Copyright (c) J.-S. Caux.
  4. -----------------------------------------------------------
  5. File: ABACUS_TBA.h
  6. Purpose: Thermodynamic Bethe Ansatz general functions
  7. ***********************************************************/
  8. #ifndef ABACUS_TBA_H
  9. #define ABACUS_TBA_H
  10. #include "ABACUS.h"
  11. namespace ABACUS {
  12. struct Root_Density {
  13. int Npts; // how many points are used to describe each function
  14. DP lambdamax; // what the largest rapidity is
  15. Vect_DP lambda; // rapidity vector
  16. Vect_DP dlambda; // differential element
  17. Vect_DP value; // the root density itself
  18. Vect_DP prev_value; // results of previous iteration
  19. DP diff; // relative differences with previous iteration
  20. bool value_infty_set; // boolean, true if asymptotic value set
  21. DP value_infty; // asymptotic value, computed analytically
  22. Root_Density ();
  23. Root_Density (int Npts_ref, DP lambdamax_ref);
  24. Root_Density& operator= (const Root_Density& RefDensity);
  25. void Save (const char* outfile_Cstr);
  26. DP Return_Value (DP lambda_ref); // evaluates the function for any argument using linear interpolation
  27. void Set_Asymptotics (DP value_infty_ref); // sets value for lambda >= lambdamax
  28. Root_Density Compress_and_Match_Densities (DP comp_factor); // returns a Root_Density with fewer points
  29. };
  30. struct Root_Density_Set {
  31. int ntypes;
  32. Vect<Root_Density> epsilon;
  33. int Npts_total; // sum of all Npts of epsilon's
  34. DP diff; // sum of diff's of the epsilon's
  35. Root_Density_Set ();
  36. Root_Density_Set (int ntypes_ref, int Npts_ref, DP lambdamax_ref);
  37. Root_Density_Set (int ntypes_ref, Vect_INT Npts_ref, Vect_DP lambdamax_ref);
  38. Root_Density_Set& operator= (const Root_Density_Set& RefSet);
  39. void Insert_new_function (DP asymptotic_value);
  40. void Extend_limits (Vect<bool> need_to_extend_limit);
  41. void Insert_new_points (Vect<Vect<bool> > need_new_point_around);
  42. DP Return_Value (int n_ref, DP lambda_ref); // returns a value, no matter what.
  43. Root_Density_Set Return_Compressed_and_Matched_Set (DP comp_factor);
  44. void Match_Densities (Root_Density_Set& RefSet);
  45. void Save (const char* outfile_Cstr);
  46. };
  47. struct LiebLin_TBA_Solution {
  48. DP c_int;
  49. DP mu;
  50. DP kBT;
  51. DP nbar;
  52. DP ebar; // mean energy, \int d\lambda \lambda^2 \rho (\lambda)
  53. DP sbar; // entropy per unit length
  54. Root_Density epsilon;
  55. Root_Density depsilon_dmu;
  56. Root_Density rho;
  57. Root_Density rhoh;
  58. LiebLin_TBA_Solution (DP c_int_ref, DP mu_ref, DP kBT_ref, DP req_diff, int Max_Secs);
  59. };
  60. // Functions defined in TBA_LiebLin.cc
  61. Root_Density LiebLin_rho_GS (DP c_int, DP k_F, DP lambdamax, int Npts, DP req_prec);
  62. DP Density_GS (Root_Density& rho_GS);
  63. DP k_F_given_n (DP c_int, DP n, DP lambdamax, int Npts, DP req_prec);
  64. Root_Density LiebLin_Z_GS (DP c_int, DP k_F, DP lambdamax, int Npts, DP req_prec);
  65. Root_Density LiebLin_Fbackflow_GS (DP c_int, DP k_F, DP lambdamax, DP lambda, int Npts, DP req_prec);
  66. // epsilon for a given mu:
  67. Root_Density LiebLin_epsilon_TBA (DP c_int, DP mu, DP kBT, DP req_diff, int Max_Secs);
  68. // depsilon/dmu for a given mu:
  69. Root_Density LiebLin_depsilon_dmu_TBA (DP c_int, DP mu, DP kBT, DP req_diff, int Max_Secs, const Root_Density& epsilon);
  70. Root_Density LiebLin_rho_TBA (DP kBT, const Root_Density& epsilon, const Root_Density& depsilon_dmu);
  71. Root_Density LiebLin_rhoh_TBA (DP kBT, const Root_Density& epsilon, const Root_Density& depsilon_dmu);
  72. DP LiebLin_nbar_TBA (const Root_Density& rho);
  73. DP LiebLin_ebar_TBA (const Root_Density& rho);
  74. DP LiebLin_sbar_TBA (const Root_Density& rho, const Root_Density& rhoh);
  75. LiebLin_TBA_Solution LiebLin_TBA_Solution_fixed_nbar (DP c_int, DP nbar_required, DP kBT, DP req_diff, int Max_Secs);
  76. LiebLin_TBA_Solution LiebLin_TBA_Solution_fixed_nbar_ebar (DP c_int, DP nbar_required, DP ebar_required, DP req_diff, int Max_Secs);
  77. LiebLin_Bethe_State Discretized_LiebLin_Bethe_State (DP c_int, DP L, int N, const Root_Density& rho);
  78. // Functions defined in TBA_XXZ.cc
  79. DP XXZ_phi1_kernel (DP zeta, DP lambda);
  80. DP XXZ_phi2_kernel (DP zeta, DP lambda);
  81. DP XXZ_a1_kernel (DP sinzeta, DP coszeta, DP lambda);
  82. DP XXZ_da1dlambda_kernel (DP sinzeta, DP coszeta, DP lambda);
  83. DP XXZ_a2_kernel (DP sin2zeta, DP cos2zeta, DP lambda);
  84. Root_Density XXZ_rhotot_GS (DP Delta, DP B, DP lambdamax, int Npts, DP req_prec);
  85. DP Return_GS_Sz_tot_value (DP B, Root_Density& rhotot_GS);
  86. Root_Density XXZ_eps_GS (DP Delta, DP Hz, DP lambdamax, int Npts, DP req_prec);
  87. Root_Density XXZ_depsdlambda_GS (DP Delta, DP B, DP lambdamax, int Npts, DP req_prec);
  88. Root_Density XXZ_b2BB_lambda_B (DP Delta, DP B, DP lambdamax, int Npts, DP req_prec);
  89. Root_Density XXZ_b2BB_lambda_lambdap (DP Delta, DP B, DP lambdap, DP lambdamax, int Npts, DP req_prec);
  90. Root_Density XXZ_Kbackflow_GS (DP Delta, DP B, DP lambdamax, DP lambda_p, DP lambda_h, int Npts, DP req_prec);
  91. Root_Density XXZ_Fbackflow_GS (DP Delta, DP B, DP lambdamax, DP lambda_p, DP lambda_h, int Npts, DP req_prec);
  92. Root_Density XXZ_Z_GS (DP Delta, DP B, DP lambdamax, int Npts, DP req_prec);
  93. // Defined in TBA_2CBG.cc:
  94. struct TBA_Data_2CBG {
  95. DP c_int;
  96. DP mu;
  97. DP Omega;
  98. DP kBT;
  99. DP f; // Gibbs free energy
  100. DP n1; // first population
  101. DP n2; // second population
  102. };
  103. // Defined in src/TBA_2CBG.cc:
  104. TBA_Data_2CBG Solve_2CBG_TBAE_via_refinements (DP c_int, DP mu, DP Omega, DP kBT, int Max_Secs, bool Save_data);
  105. // Defined in src/TBA_2CBG.cc:
  106. void Scan_2CBG_TBAE (DP c_int, DP mu_min, DP mu_max, int Nmu, DP Omega_min, DP Omega_max, int NOmega,
  107. DP kBT_min, DP kBT_max, int NkBT, int Max_Secs);
  108. } // namespace ABACUS
  109. #endif