1
0
mirror of https://github.com/paboyle/Grid.git synced 2025-06-12 20:27:06 +01:00

Checked the hermiticity of the op in derivative, ok

Still CG fails to converge
This commit is contained in:
Guido Cossu
2016-07-31 12:37:33 +01:00
parent 089f0ab582
commit 49b5c49851
6 changed files with 47 additions and 38 deletions

View File

@ -1,6 +1,6 @@
/*
* Policy classes for the HMC
* Author: Guido Cossu
* Policy classes for the HMC
* Author: Guido Cossu
*/
#ifndef ADJOINT_H
@ -27,8 +27,9 @@ class AdjointRep {
LatticeField U;
explicit AdjointRep(GridBase *grid) : U(grid) {}
void update_representation(const LatticeGaugeField &Uin) {
std::cout << GridLogDebug << "Updating adjoint representation\n" ;
std::cout << GridLogDebug << "Updating adjoint representation\n" ;
// Uin is in the fundamental representation
// get the U in AdjointRep
// (U_adj)_B = tr[e^a U e^b U^dag]
@ -41,28 +42,36 @@ class AdjointRep {
Vector<typename SU<ncolour>::Matrix> ta(Dimension);
// Debug lines
//LatticeMatrix uno(Uin._grid);
//uno = 1.0;
////////////////
// FIXME probably not very efficient to get all the generators
// everytime
for (int a = 0; a < Dimension; a++) SU<ncolour>::generator(a, ta[a]);
for (int mu = 0; mu < Nd; mu++) {
auto Uin_mu = peekLorentz(Uin, mu);
auto U_mu = peekLorentz(U, mu);
auto U_mu = peekLorentz(U, mu);
for (int a = 0; a < Dimension; a++) {
tmp = 2.0 * adj(Uin_mu) * ta[a] * Uin_mu;
for (int b = 0; b < Dimension; b++)
pokeColour(U_mu, trace(tmp * ta[b]), a, b);
pokeColour(U_mu, trace(tmp * ta[b]), b, a);
}
// Check matrix U_mu, must be real orthogonal
//reality
LatticeMatrix Ucheck = U_mu - conjugate(U_mu);
std::cout << GridLogMessage << "Reality check: " << norm2(Ucheck) << std::endl;
LatticeMatrix uno(Uin._grid);
uno = 1.0;
Ucheck = U_mu * adj(U_mu) - uno;
std::cout << GridLogMessage << "orthogonality check: " << norm2(Ucheck) << std::endl;
pokeLorentz(U, U_mu, mu);
// Check matrix U_mu, must be real orthogonal
// reality
/*
LatticeMatrix Ucheck = U_mu - conjugate(U_mu);
std::cout << GridLogMessage << "Reality check: " << norm2(Ucheck) <<
std::endl;
Ucheck = U_mu * adj(U_mu) - uno;
std::cout << GridLogMessage << "orthogonality check: " << norm2(Ucheck) <<
std::endl;
*/
}
}
@ -81,8 +90,8 @@ class AdjointRep {
projectOnAlgebra(h, in_mu, scale);
FundamentalLieAlgebraMatrix(h, out_mu, 1.0); // apply scale only once
pokeLorentz(out, out_mu, mu);
// Returns traceless antihermitian matrix Nc * Nc.
// Confirmed
// Returns traceless antihermitian matrix Nc * Nc.
// Confirmed
}
return out;
}