12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485 |
- /**********************************************************
-
- This software is part of J.-S. Caux's ABACUS library.
-
- Copyright (c) J.-S. Caux.
-
- -----------------------------------------------------------
-
- File: src/LIEBLIN/ln_g2_ME.cc
-
- Purpose: provides the matrix element of the second density moment g2(x = 0)
-
- NOTE: based on Lorenzo Piroli's expression of the matrix element
-
- ***********************************************************/
-
- #include "ABACUS.h"
-
- using namespace std;
- using namespace ABACUS;
-
- namespace ABACUS {
-
- complex<DP> Fn_V_g2 (int j, LiebLin_Bethe_State& lstate, LiebLin_Bethe_State& rstate)
- {
- complex<DP> result = 1.0;
-
- for (int m = 0; m < lstate.N; ++m) {
- result *= (lstate.lambdaoc[m] - rstate.lambdaoc[j] + II)/(rstate.lambdaoc[m] - rstate.lambdaoc[j] + II);
- }
-
- return(result);
- }
-
-
- complex<DP> ln_g2_ME (LiebLin_Bethe_State& lstate, LiebLin_Bethe_State& rstate)
- {
- // Computes the log of the density operator \rho(x = 0) matrix element between lstate and rstate.
-
- // If we have lstate == rstate, density matrix element = 0:
- if (lstate.Ix2 == rstate.Ix2) return(-200.);
-
- SQMat_DP one_plus_U (0.0, lstate.N);
-
- Vect_CX Vplus (0.0, lstate.N); // contains V^+_j; V^-_j is the conjugate
- Vect_CX ln_Fn_Prod (0.0, lstate.N); // product_{m\neq j} (\mu_m - \lambdaoc_j)/(\lambdaoc_m - \lambdaoc_j)
- Vect_DP rKern (0.0, lstate.N); // K(lambdaoc_j - lambdaoc_(p == arbitrary))
-
- int p = rstate.N/2-1; // choice doesn't matter, see 1990_Slavnov_TMP_82 after (3.8). Choose rapidity around the middle.
-
- DP c_int = rstate.c_int;
-
- DP Eout = log(pow(lstate.E - rstate.E,2.)) - (2)*log(c_int) - log(2*lstate.N);
-
- for (int a = 0; a < lstate.N; ++a) {
- Vplus[a] = Fn_V_g2 (a, lstate, rstate);
- ln_Fn_Prod[a] = 0.0;;
- for (int m = 0; m < lstate.N; ++m)
- if (m != a) ln_Fn_Prod[a] += log(complex<DP>(lstate.lambdaoc[m] - rstate.lambdaoc[a])
- /(rstate.lambdaoc[m] - rstate.lambdaoc[a]));
- rKern[a] = rstate.Kernel (a, p);
- }
-
- for (int a = 0; a < lstate.N; ++a)
- for (int b = 0; b < lstate.N; ++b)
- one_plus_U[a][b] = (a == b ? 1.0 : 0.0) + 0.5 * 1./imag(Vplus[a])
- * ((lstate.lambdaoc[a] - rstate.lambdaoc[a])*real(exp(ln_Fn_Prod[a]))
- * (rstate.Kernel(a,b) - rKern[b]) + rKern[b]);
-
- complex<DP> ln_ddalpha_sigma = lndet_LU_dstry(one_plus_U);
-
- complex<DP> ln_prod_V = 0.0;
- for (int a = 0; a < lstate.N; ++a) ln_prod_V += log(2.0 * II * imag(Vplus[a]));
-
- complex<DP> ln_prod_2 = 0.0;
- for (int a = 0; a < lstate.N; ++a)
- for (int b = 0; b < lstate.N; ++b)
- ln_prod_2 += log((rstate.lambdaoc[a] - rstate.lambdaoc[b] + II)/(lstate.lambdaoc[a] - rstate.lambdaoc[b]));
-
- ln_ddalpha_sigma += ln_prod_V + ln_prod_2 - log(2.0 * II * imag(Vplus[p]));
-
- return (log(II) + Eout + ln_ddalpha_sigma - 0.5 * (lstate.lnnorm + rstate.lnnorm));
- }
-
- } // namespace ABACUS
|