Import ABACUS++G_8 code; cleanup files; new README
This commit is contained in:
@@ -0,0 +1,52 @@
|
||||
/**********************************************************
|
||||
|
||||
This software is part of J.-S. Caux's ABACUS library.
|
||||
|
||||
Copyright (c).
|
||||
|
||||
-----------------------------------------------------------
|
||||
|
||||
File: LiebLin_Gaudin_lnnorm.cc
|
||||
|
||||
Purpose: calculates the Gaudin norm of a vector of arbitrary
|
||||
complex rapidities
|
||||
|
||||
***********************************************************/
|
||||
|
||||
#include "JSC.h"
|
||||
|
||||
using namespace std;
|
||||
using namespace JSC;
|
||||
|
||||
namespace JSC {
|
||||
|
||||
DP LiebLin_Twisted_lnnorm (Vect<complex<DP> >& lambdaoc, double cxL)
|
||||
{
|
||||
// Calculates the lnnorm of an eigenstate of the twisted transfer matrix
|
||||
// so Gaudin can be used.
|
||||
|
||||
int N = lambdaoc.size();
|
||||
|
||||
SQMat<complex<DP> > Gaudin(N);
|
||||
|
||||
complex<DP> sum_Kernel = 0.0;
|
||||
|
||||
for (int j = 0; j < N; ++j)
|
||||
for (int k = 0; k < N; ++k) {
|
||||
if (j == k) {
|
||||
sum_Kernel = 0.0;
|
||||
for (int kp = 0; kp < N; ++kp) if (j != kp) sum_Kernel += 2.0/((lambdaoc[j] - lambdaoc[kp]) * (lambdaoc[j] - lambdaoc[kp]) + 1.0);
|
||||
Gaudin[j][k] = cxL + sum_Kernel;
|
||||
}
|
||||
else Gaudin[j][k] = - 2.0/((lambdaoc[j] - lambdaoc[k]) * (lambdaoc[j] - lambdaoc[k]) + 1.0);
|
||||
}
|
||||
|
||||
DP lnnorm = real(lndet_LU_CX_dstry(Gaudin));
|
||||
|
||||
// Add the pieces outside of Gaudin determinant
|
||||
for (int j = 0; j < N - 1; ++j) for (int k = j+1; k < N; ++k) lnnorm += log(1.0 + 1.0/norm(lambdaoc[j] - lambdaoc[k]));
|
||||
|
||||
return(lnnorm);
|
||||
}
|
||||
|
||||
} // namespace JSC
|
||||
Reference in New Issue
Block a user