mirror of
https://github.com/paboyle/Grid.git
synced 2026-05-21 09:34:17 +01:00
added more debug output
This commit is contained in:
@@ -297,10 +297,11 @@ class KrylovSchur {
|
|||||||
Eigen::VectorXcd btmp = b.head(Nk); // careful about how you slice Eigen::VectorXcd!
|
Eigen::VectorXcd btmp = b.head(Nk); // careful about how you slice Eigen::VectorXcd!
|
||||||
b = btmp;
|
b = btmp;
|
||||||
|
|
||||||
|
std::cout << GridLogDebug << "Rayleigh after truncation: " << std::endl << Rayleigh << std::endl;
|
||||||
|
|
||||||
checkKSDecomposition();
|
checkKSDecomposition();
|
||||||
|
|
||||||
// Compute eigensystem of Rayleigh. Note the eigenvectors correspond to the sorted eigenvalues.
|
// Compute eigensystem of Rayleigh. Note the eigenvectors correspond to the sorted eigenvalues.
|
||||||
std::cout << GridLogDebug << "Rayleigh after truncation: " << std::endl << Rayleigh << std::endl;
|
|
||||||
computeEigensystem(Rayleigh);
|
computeEigensystem(Rayleigh);
|
||||||
std::cout << GridLogMessage << "Eigenvalues (first Nk sorted): " << std::endl << evals << std::endl;
|
std::cout << GridLogMessage << "Eigenvalues (first Nk sorted): " << std::endl << evals << std::endl;
|
||||||
|
|
||||||
@@ -520,9 +521,12 @@ class KrylovSchur {
|
|||||||
|
|
||||||
// rotate basis by Rayleigh to construct UR
|
// rotate basis by Rayleigh to construct UR
|
||||||
// std::vector<Field> rotated;
|
// std::vector<Field> rotated;
|
||||||
|
|
||||||
|
std::cout << GridLogDebug << "Rayleigh in KSDecomposition: " << std::endl << Rayleigh << std::endl;
|
||||||
|
|
||||||
std::vector<Field> rotated = basis;
|
std::vector<Field> rotated = basis;
|
||||||
Eigen::MatrixXcd Rt = Rayleigh.adjoint();
|
|
||||||
constructUR(rotated, basis, Rayleigh, k); // manually rotate
|
constructUR(rotated, basis, Rayleigh, k); // manually rotate
|
||||||
|
// Eigen::MatrixXcd Rt = Rayleigh.adjoint();
|
||||||
// basisRotate(rotated, Rt, 0, k, 0, k, k); // UR
|
// basisRotate(rotated, Rt, 0, k, 0, k, k); // UR
|
||||||
|
|
||||||
// TODO: make a new function that I'm positive does what this is doing
|
// TODO: make a new function that I'm positive does what this is doing
|
||||||
@@ -609,10 +613,13 @@ class KrylovSchur {
|
|||||||
void constructUR(std::vector<Field>& UR, std::vector<Field> &U, Eigen::MatrixXcd& R, int N) {
|
void constructUR(std::vector<Field>& UR, std::vector<Field> &U, Eigen::MatrixXcd& R, int N) {
|
||||||
Field tmp (Grid);
|
Field tmp (Grid);
|
||||||
UR.clear();
|
UR.clear();
|
||||||
|
|
||||||
|
std::cout << GridLogDebug << "R to rotate by (should be Rayleigh): " << R << std::endl;
|
||||||
|
|
||||||
for (int i = 0; i < N; i++) {
|
for (int i = 0; i < N; i++) {
|
||||||
tmp = Zero();
|
tmp = Zero();
|
||||||
for (int j = 0; j < N; j++) {
|
for (int j = 0; j < N; j++) {
|
||||||
std::cout << GridLogDebug << "Adding R(j, i) = " << R(j, i) << " to rotated" << std::endl;
|
std::cout << GridLogDebug << "Adding R("<<j<<", "<<i<<") = " << R(j, i) << " to rotated" << std::endl;
|
||||||
std::cout << GridLogDebug << "Norm of U[j] is " << norm2(U[j]) << " to rotated" << std::endl;
|
std::cout << GridLogDebug << "Norm of U[j] is " << norm2(U[j]) << " to rotated" << std::endl;
|
||||||
tmp = tmp + U[j] * R(j, i);
|
tmp = tmp + U[j] * R(j, i);
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user