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.

ln_g2_ME.cc 2.8KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485
  1. /**********************************************************
  2. This software is part of J.-S. Caux's ABACUS library.
  3. Copyright (c) J.-S. Caux.
  4. -----------------------------------------------------------
  5. File: src/LIEBLIN/ln_g2_ME.cc
  6. Purpose: provides the matrix element of the second density moment g2(x = 0)
  7. NOTE: based on Lorenzo Piroli's expression of the matrix element
  8. ***********************************************************/
  9. #include "ABACUS.h"
  10. using namespace std;
  11. using namespace ABACUS;
  12. namespace ABACUS {
  13. complex<DP> Fn_V_g2 (int j, LiebLin_Bethe_State& lstate, LiebLin_Bethe_State& rstate)
  14. {
  15. complex<DP> result = 1.0;
  16. for (int m = 0; m < lstate.N; ++m) {
  17. result *= (lstate.lambdaoc[m] - rstate.lambdaoc[j] + II)/(rstate.lambdaoc[m] - rstate.lambdaoc[j] + II);
  18. }
  19. return(result);
  20. }
  21. complex<DP> ln_g2_ME (LiebLin_Bethe_State& lstate, LiebLin_Bethe_State& rstate)
  22. {
  23. // Computes the log of the density operator \rho(x = 0) matrix element between lstate and rstate.
  24. // If we have lstate == rstate, density matrix element = 0:
  25. if (lstate.Ix2 == rstate.Ix2) return(-200.);
  26. SQMat_DP one_plus_U (0.0, lstate.N);
  27. Vect_CX Vplus (0.0, lstate.N); // contains V^+_j; V^-_j is the conjugate
  28. Vect_CX ln_Fn_Prod (0.0, lstate.N); // product_{m\neq j} (\mu_m - \lambdaoc_j)/(\lambdaoc_m - \lambdaoc_j)
  29. Vect_DP rKern (0.0, lstate.N); // K(lambdaoc_j - lambdaoc_(p == arbitrary))
  30. int p = rstate.N/2-1; // choice doesn't matter, see 1990_Slavnov_TMP_82 after (3.8). Choose rapidity around the middle.
  31. DP c_int = rstate.c_int;
  32. DP Eout = log(pow(lstate.E - rstate.E,2.)) - (2)*log(c_int) - log(2*lstate.N);
  33. for (int a = 0; a < lstate.N; ++a) {
  34. Vplus[a] = Fn_V_g2 (a, lstate, rstate);
  35. ln_Fn_Prod[a] = 0.0;;
  36. for (int m = 0; m < lstate.N; ++m)
  37. if (m != a) ln_Fn_Prod[a] += log(complex<DP>(lstate.lambdaoc[m] - rstate.lambdaoc[a])
  38. /(rstate.lambdaoc[m] - rstate.lambdaoc[a]));
  39. rKern[a] = rstate.Kernel (a, p);
  40. }
  41. for (int a = 0; a < lstate.N; ++a)
  42. for (int b = 0; b < lstate.N; ++b)
  43. one_plus_U[a][b] = (a == b ? 1.0 : 0.0) + 0.5 * 1./imag(Vplus[a])
  44. * ((lstate.lambdaoc[a] - rstate.lambdaoc[a])*real(exp(ln_Fn_Prod[a]))
  45. * (rstate.Kernel(a,b) - rKern[b]) + rKern[b]);
  46. complex<DP> ln_ddalpha_sigma = lndet_LU_dstry(one_plus_U);
  47. complex<DP> ln_prod_V = 0.0;
  48. for (int a = 0; a < lstate.N; ++a) ln_prod_V += log(2.0 * II * imag(Vplus[a]));
  49. complex<DP> ln_prod_2 = 0.0;
  50. for (int a = 0; a < lstate.N; ++a)
  51. for (int b = 0; b < lstate.N; ++b)
  52. ln_prod_2 += log((rstate.lambdaoc[a] - rstate.lambdaoc[b] + II)/(lstate.lambdaoc[a] - rstate.lambdaoc[b]));
  53. ln_ddalpha_sigma += ln_prod_V + ln_prod_2 - log(2.0 * II * imag(Vplus[p]));
  54. return (log(II) + Eout + ln_ddalpha_sigma - 0.5 * (lstate.lnnorm + rstate.lnnorm));
  55. }
  56. } // namespace ABACUS