68 for (
int i = 0; i <
n_kr; i++)
residua.push_back(0.0);
115 default:
errorQuda(
"Invalid eig solver type");
121 errorQuda(
"Cannot solve non-Hermitian system with strictly Hermitian eigensolver %d, %d", (
int)!
mat.
hermitian(),
127 if (!eig_solver->
hermitian())
errorQuda(
"Polynomial acceleration not supported with non-Hermitian solver");
131 errorQuda(
"The imaginary spectrum of a Hermitian operator cannot be computed");
146 RNG *rng =
new RNG(*kSpace[0], 1234);
156 while (!orthed && k < kmax) {
160 printfQuda(
"Orthonormalising initial guesses with Modified Gram Schmidt, iter k=%d/5\n", (k + 1));
162 printfQuda(
"Orthonormalising initial guess\n");
167 if (!orthed)
errorQuda(
"Failed to orthonormalise initial guesses");
189 for (
int i =
n_conv; i <
n_kr; i++) evals.push_back(0.0);
195 printfQuda(
"********************************\n");
196 printfQuda(
"**** START QUDA EIGENSOLVER ****\n");
197 printfQuda(
"********************************\n");
245 for (
unsigned int i =
n_conv; i < kSpace.size(); i++) {
delete kSpace[i]; }
253 std::vector<ColorSpinorField *> vecs_ptr;
263 for (
unsigned int i = 0; i < kSpace.size(); i++) {
264 kSpace[i]->setSuggestedParity(mat_parity);
265 vecs_ptr.push_back(kSpace[i]->CreateAlias(csParamClone));
268 printfQuda(
"kSpace successfully down copied from prec %d to prec %d\n", kSpace[0]->Precision(),
269 vecs_ptr[0]->Precision());
272 for (
int i = 0; i <
n_conv; i++) {
273 kSpace[i]->setSuggestedParity(mat_parity);
274 vecs_ptr.push_back(kSpace[i]);
280 for (
unsigned int i = 0; i < kSpace.size() &&
save_prec <
prec; i++)
delete vecs_ptr[i];
289 printfQuda(
"********************************\n");
290 printfQuda(
"***** END QUDA EIGENSOLVER *****\n");
291 printfQuda(
"********************************\n");
321 double delta = (b - a) / 2.0;
322 double theta = (b + a) / 2.0;
323 double sigma1 = -delta / theta;
325 double d1 = sigma1 / delta;
348 double sigma_old = sigma1;
352 sigma = 1.0 / (2.0 / sigma1 - sigma_old);
354 d1 = 2.0 * sigma / delta;
356 d3 = -sigma * sigma_old;
385 RNG *rng =
new RNG(in, 1234);
397 for (
int i = 0; i < 100; i++) {
398 if ((i + 1) % 10 == 0) {
410 return result * 1.10;
420 std::vector<ColorSpinorField *> vecs_ptr;
421 vecs_ptr.reserve(size);
422 for (
int i = 0; i < size; i++) vecs_ptr.push_back(vecs[i]);
424 std::vector<Complex> H(size * size);
429 for (
int i = 0; i < size; i++) {
430 for (
int j = 0; j < size; j++) {
431 auto cnorm = H[i * size + j];
435 printfQuda(
"Norm <%d|%d>^2 = ||(%e,%e)|| = %e\n", i, j, cnorm.real(), cnorm.imag(),
abs(cnorm));
441 printfQuda(
"1 - Norm <%d|%d>^2 = 1 - ||(%e,%e)|| = %e\n", i, j, cnorm.real(), cnorm.imag(),
454 std::vector<ColorSpinorField *> vecs_ptr;
455 vecs_ptr.reserve(size);
456 for (
int i = 0; i < size; i++) vecs_ptr.push_back(vecs[i]);
458 for (
int i = 0; i < size; i++) {
459 for (
int j = 0; j < i; j++) {
472 int r_size = (int)rvecs.size();
473 int array_size = vecs_size * r_size;
474 std::vector<Complex> s(array_size);
476 std::vector<ColorSpinorField *> vecs_ptr;
477 vecs_ptr.reserve(vecs_size);
478 for (
int i = 0; i < vecs_size; i++) { vecs_ptr.push_back(vecs[i]); }
484 for (
int i = 0; i < array_size; i++) s[i] *= -1.0;
493 std::vector<int> pivots(size);
494 for (
int i = 0; i < size; i++) {
495 for (
int j = 0; j < size; j++) {
496 if (
mat[j * size + i] == 1) { pivots[j] = i; }
506 for (
int i = 0; i < size; i++) {
508 if (pivots[i] > 0 || i == 0) {
512 pivots[i] = -pivots[i];
515 pivots[j] = -pivots[j];
522 for (
int i = 0; i < size; i++) {
523 if (pivots[i] > 0)
errorQuda(
"Error at pivot %d", i);
530 int block_i_rank = i_range.second - i_range.first;
531 int block_j_rank = j_range.second - j_range.first;
534 if (block_i_rank == 0 || block_j_rank == 0)
return;
537 std::vector<ColorSpinorField *> vecs_ptr;
538 std::vector<ColorSpinorField *> kSpace_ptr;
541 vecs_ptr.reserve(block_i_rank);
542 for (
int i = i_range.first; i < i_range.second; i++) { vecs_ptr.push_back(kSpace[
num_locked + i]); }
544 kSpace_ptr.reserve(block_j_rank);
545 for (
int j = j_range.first; j < j_range.second; j++) {
546 int k =
n_kr + 1 + j - j_range.first;
547 kSpace_ptr.push_back(kSpace[k]);
550 double *batch_array = (
double *)
safe_malloc((block_i_rank * block_j_rank) *
sizeof(double));
552 for (
int j = j_range.first; j < j_range.second; j++) {
553 for (
int i = i_range.first; i < i_range.second; i++) {
554 int j_arr = j - j_range.first;
555 int i_arr = i - i_range.first;
556 batch_array[i_arr * block_j_rank + j_arr] = array[j * rank + i];
563 default:
errorQuda(
"Undefined MultiBLAS type in blockRotate");
574 for (
int j = j_start; j < j_end; j++) {
575 int k = offset + j - j_start;
582 const range &i_range,
const range &j_range,
blockType b_type,
int offset)
584 int block_i_rank = i_range.second - i_range.first;
585 int block_j_rank = j_range.second - j_range.first;
588 if (block_i_rank == 0 || block_j_rank == 0)
return;
591 std::vector<ColorSpinorField *> vecs_ptr;
592 std::vector<ColorSpinorField *> kSpace_ptr;
595 vecs_ptr.reserve(block_i_rank);
596 for (
int i = i_range.first; i < i_range.second; i++) { vecs_ptr.push_back(kSpace[
num_locked + i]); }
598 kSpace_ptr.reserve(block_j_rank);
599 for (
int j = j_range.first; j < j_range.second; j++) {
600 int k = offset + j - j_range.first;
601 kSpace_ptr.push_back(kSpace[k]);
606 for (
int j = j_range.first; j < j_range.second; j++) {
607 for (
int i = i_range.first; i < i_range.second; i++) {
608 int j_arr = j - j_range.first;
609 int i_arr = i - i_range.first;
610 batch_array[i_arr * block_j_rank + j_arr] = array[j * rank + i];
617 default:
errorQuda(
"Undefined MultiBLAS type in blockRotate");
630 if (evecs.size() != (
unsigned int)(2 *
n_conv))
631 errorQuda(
"Incorrect deflation space sized %d passed to computeSVD, expected %d", (
int)(evecs.size()), 2 *
n_conv);
633 std::vector<double> sigma_tmp(
n_conv);
635 for (
int i = 0; i <
n_conv; i++) {
660 printfQuda(
"Sval[%04d] = %+.16e sigma - sqrt(|lambda|) = %+.16e\n", i, sigma_tmp[i],
661 sigma_tmp[i] -
sqrt(
abs(lambda.real())));
663 evals[i] = sigma_tmp[i];
673 const std::vector<ColorSpinorField *> &evecs,
const std::vector<Complex> &evals,
674 bool accumulate)
const
678 warningQuda(
"deflateSVD called with n_ev_deflate = 0");
684 errorQuda(
"Incorrect deflation space sized %d passed to deflateSVD, expected %d", (
int)(evecs.size()),
693 std::vector<ColorSpinorField *> left_vecs;
694 left_vecs.reserve(n_defl);
697 std::vector<Complex> s(n_defl * src.size());
698 std::vector<ColorSpinorField *> src_ =
const_cast<decltype(src) &
>(src);
706 std::vector<ColorSpinorField *> right_vecs;
707 right_vecs.reserve(n_defl);
708 for (
int i = 0; i < n_defl; i++) {
709 right_vecs.push_back(evecs[i]);
710 s[i] /= evals[i].real();
719 std::vector<Complex> &evals,
int size)
721 if (size > (
int)evecs.size())
722 errorQuda(
"Requesting %d eigenvectors with only storage allocated for %lu", size, evecs.size());
723 if (size > (
int)evals.size())
724 errorQuda(
"Requesting %d eigenvalues with only storage allocated for %lu", size, evals.size());
727 std::vector<ColorSpinorField *> temp;
730 for (
int i = 0; i < size; i++) {
743 printfQuda(
"Eval[%04d] = (%+.16e,%+.16e) residual = %+.16e\n", i, evals[i].real(), evals[i].imag(),
residua[i]);
753 const std::vector<ColorSpinorField *> &evecs,
const std::vector<Complex> &evals,
754 bool accumulate)
const
758 warningQuda(
"deflate called with n_ev_deflate = 0");
771 std::vector<ColorSpinorField *> eig_vecs;
772 eig_vecs.reserve(n_defl);
773 for (
int i = 0; i < n_defl; i++) eig_vecs.push_back(evecs[i]);
776 std::vector<Complex> s(n_defl * src.size());
777 std::vector<ColorSpinorField *> src_ =
const_cast<decltype(src) &
>(src);
781 for (
int i = 0; i < n_defl; i++) { s[i] /= evals[i].real(); }
793 std::vector<Complex> &evals)
797 for (
int i = 0; i <
n_conv; i++) { kSpace[i]->setSuggestedParity(mat_parity); }
800 std::vector<ColorSpinorField *> vecs_ptr;
802 for (
int i = 0; i <
n_conv; i++) { vecs_ptr.push_back(kSpace[i]); }
831 std::vector<std::pair<Complex, Complex>> array(n);
832 for (
int i = 0; i < n; i++) array[i] = std::make_pair(x[i], y[i]);
836 std::sort(array.begin(), array.begin() + n,
837 [](
const std::pair<Complex, Complex> &a,
const std::pair<Complex, Complex> &b) {
838 return (abs(a.first) < abs(b.first));
842 std::sort(array.begin(), array.begin() + n,
843 [](
const std::pair<Complex, Complex> &a,
const std::pair<Complex, Complex> &b) {
844 return (abs(a.first) > abs(b.first));
848 std::sort(array.begin(), array.begin() + n,
849 [](
const std::pair<Complex, Complex> &a,
const std::pair<Complex, Complex> &b) {
850 return (a.first).real() < (b.first).real();
854 std::sort(array.begin(), array.begin() + n,
855 [](
const std::pair<Complex, Complex> &a,
const std::pair<Complex, Complex> &b) {
856 return (a.first).real() > (b.first).real();
860 std::sort(array.begin(), array.begin() + n,
861 [](
const std::pair<Complex, Complex> &a,
const std::pair<Complex, Complex> &b) {
862 return (a.first).imag() < (b.first).imag();
866 std::sort(array.begin(), array.begin() + n,
867 [](
const std::pair<Complex, Complex> &a,
const std::pair<Complex, Complex> &b) {
868 return (a.first).imag() > (b.first).imag();
871 default:
errorQuda(
"Undefined spectrum type %d given", spec_type);
875 for (
int i = 0; i < n; i++) {
876 x[i] = array[i].first;
877 y[i] = array[i].second;
885 std::vector<Complex> y_tmp(n, 0.0);
886 for (
int i = 0; i < n; i++) y_tmp[i].real(y[i]);
888 for (
int i = 0; i < n; i++) y[i] = y_tmp[i].real();
895 std::vector<Complex> x_tmp(n, 0.0);
896 for (
int i = 0; i < n; i++) x_tmp[i].real(x[i]);
898 for (
int i = 0; i < n; i++) x[i] = x_tmp[i].real();
905 std::vector<Complex> x_tmp(n, 0.0);
906 std::vector<Complex> y_tmp(n, 0.0);
907 for (
int i = 0; i < n; i++) {
912 for (
int i = 0; i < n; i++) {
913 x[i] = x_tmp[i].real();
914 y[i] = y_tmp[i].real();
919 const int dim,
const int keep,
const int locked,
TimeProfile &profile)
922 if (batched_rotate <= 0 || batched_rotate >= keep) {
923 if ((
int)kSpace.size() < offset + keep) {
927 kSpace.reserve(offset + keep);
928 for (
int i = kSpace.size(); i < offset + keep; i++) {
934 std::vector<ColorSpinorField *> vecs_ptr;
935 std::vector<ColorSpinorField *> kSpace_ptr;
938 kSpace_ptr.reserve(keep);
939 for (
int i = 0; i < keep; i++) {
940 kSpace_ptr.push_back(kSpace[offset + i]);
945 vecs_ptr.reserve(
dim);
946 for (
int j = 0; j <
dim; j++) vecs_ptr.push_back(kSpace[locked + j]);
954 for (
int i = 0; i < keep; i++)
std::swap(kSpace[locked + i], kSpace[offset + i]);
960 int full_batches = keep / batch_size;
961 int batch_size_r = keep % batch_size;
962 bool do_batch_remainder = (batch_size_r != 0 ? true :
false);
964 if ((
int)kSpace.size() < offset + batch_size) {
968 kSpace.reserve(offset + batch_size);
969 for (
int i = kSpace.size(); i < offset + batch_size; i++) {
975 MatrixXcd
mat = MatrixXcd::Zero(
dim, keep);
976 for (
int j = 0; j < keep; j++)
977 for (
int i = 0; i <
dim; i++)
mat(i, j) = rot_array[i * keep + j];
979 FullPivLU<MatrixXcd> matLU(
mat);
982 MatrixXcd matUpper = MatrixXcd::Zero(keep, keep);
983 matUpper = matLU.matrixLU().triangularView<Eigen::Upper>();
984 matUpper.conservativeResize(keep, keep);
987 MatrixXcd matLower = MatrixXcd::Identity(
dim,
dim);
988 matLower.block(0, 0,
dim, keep).triangularView<Eigen::StrictlyLower>() = matLU.matrixLU();
989 matLower.conservativeResize(
dim, keep);
992 MatrixXi matP = MatrixXi::Zero(
dim,
dim);
993 MatrixXi matQ = MatrixXi::Zero(keep, keep);
994 matP = matLU.permutationP().inverse();
995 matQ = matLU.permutationQ().inverse();
1008 for (
int b = 0; b < full_batches; b++) {
1012 {b * batch_size, (b + 1) * batch_size},
LOWER_TRI, offset);
1015 {b * batch_size, (b + 1) * batch_size},
PENCIL, offset);
1016 blockReset(kSpace, b * batch_size, (b + 1) * batch_size, offset);
1018 if (do_batch_remainder) {
1021 {full_batches * batch_size, keep},
LOWER_TRI, offset);
1027 blockReset(kSpace, full_batches * batch_size, keep, offset);
1032 if (do_batch_remainder) {
1035 {full_batches * batch_size, keep},
UPPER_TRI, offset);
1038 {full_batches * batch_size, keep},
PENCIL, offset);
1039 blockReset(kSpace, full_batches * batch_size, keep, offset);
1043 for (
int b = full_batches - 1; b >= 0; b--) {
1045 blockRotateComplex(kSpace, matUpper.data(), keep, {b * batch_size, (b + 1) * batch_size},
1046 {b * batch_size, (b + 1) * batch_size},
UPPER_TRI, offset);
1049 blockRotateComplex(kSpace, matUpper.data(), keep, {0, b * batch_size}, {b * batch_size, (b + 1) * batch_size},
1052 blockReset(kSpace, b * batch_size, (b + 1) * batch_size, offset);
1063 const int dim,
const int keep,
const int locked,
TimeProfile &profile)
1066 if (batched_rotate <= 0 || batched_rotate >= keep) {
1067 if ((
int)kSpace.size() < offset + keep) {
1071 kSpace.reserve(offset + keep);
1072 for (
int i = kSpace.size(); i < offset + keep; i++) {
1078 std::vector<ColorSpinorField *> vecs_ptr;
1079 std::vector<ColorSpinorField *> kSpace_ptr;
1082 kSpace_ptr.reserve(keep);
1083 for (
int i = 0; i < keep; i++) {
1084 kSpace_ptr.push_back(kSpace[offset + i]);
1089 vecs_ptr.reserve(
dim);
1090 for (
int j = 0; j <
dim; j++) vecs_ptr.push_back(kSpace[locked + j]);
1098 for (
int i = 0; i < keep; i++)
std::swap(kSpace[locked + i], kSpace[offset + i]);
1103 int full_batches = keep / batch_size;
1104 int batch_size_r = keep % batch_size;
1105 bool do_batch_remainder = (batch_size_r != 0 ? true :
false);
1107 if ((
int)kSpace.size() < offset + batch_size) {
1111 kSpace.reserve(offset + batch_size);
1112 for (
int i = kSpace.size(); i < offset + batch_size; i++) {
1118 MatrixXd
mat = MatrixXd::Zero(
dim, keep);
1119 for (
int j = 0; j < keep; j++)
1120 for (
int i = 0; i <
dim; i++)
mat(i, j) = rot_array[i * keep + j];
1122 FullPivLU<MatrixXd> matLU(
mat);
1125 MatrixXd matUpper = MatrixXd::Zero(keep, keep);
1126 matUpper = matLU.matrixLU().triangularView<Eigen::Upper>();
1127 matUpper.conservativeResize(keep, keep);
1130 MatrixXd matLower = MatrixXd::Identity(
dim,
dim);
1131 matLower.block(0, 0,
dim, keep).triangularView<Eigen::StrictlyLower>() = matLU.matrixLU();
1132 matLower.conservativeResize(
dim, keep);
1135 MatrixXi matP = MatrixXi::Zero(
dim,
dim);
1136 MatrixXi matQ = MatrixXi::Zero(keep, keep);
1137 matP = matLU.permutationP().inverse();
1138 matQ = matLU.permutationQ().inverse();
1151 for (
int b = 0; b < full_batches; b++) {
1154 blockRotate(kSpace, matLower.data(),
dim, {b * batch_size, (b + 1) * batch_size},
1155 {b * batch_size, (b + 1) * batch_size},
LOWER_TRI);
1157 blockRotate(kSpace, matLower.data(),
dim, {(b + 1) * batch_size, dim}, {b * batch_size, (b + 1) * batch_size},
1159 blockReset(kSpace, b * batch_size, (b + 1) * batch_size, offset);
1161 if (do_batch_remainder) {
1163 blockRotate(kSpace, matLower.data(),
dim, {full_batches * batch_size, keep}, {full_batches * batch_size, keep},
1167 blockRotate(kSpace, matLower.data(),
dim, {keep, dim}, {full_batches * batch_size, keep},
PENCIL);
1169 blockReset(kSpace, full_batches * batch_size, keep, offset);
1174 if (do_batch_remainder) {
1176 blockRotate(kSpace, matUpper.data(), keep, {full_batches * batch_size, keep}, {full_batches * batch_size, keep},
1179 blockRotate(kSpace, matUpper.data(), keep, {0, full_batches * batch_size}, {full_batches * batch_size, keep},
1181 blockReset(kSpace, full_batches * batch_size, keep, offset);
1185 for (
int b = full_batches - 1; b >= 0; b--) {
1187 blockRotate(kSpace, matUpper.data(), keep, {b * batch_size, (b + 1) * batch_size},
1188 {b * batch_size, (b + 1) * batch_size},
UPPER_TRI);
1191 blockRotate(kSpace, matUpper.data(), keep, {0, b * batch_size}, {b * batch_size, (b + 1) * batch_size},
PENCIL);
1193 blockReset(kSpace, b * batch_size, (b + 1) * batch_size, offset);
Block Thick Restarted Lanczos Method.
static ColorSpinorField * Create(const ColorSpinorParam ¶m)
virtual void Source(const QudaSourceType sourceType, const int st=0, const int s=0, const int c=0)=0
void setPrecision(QudaPrecision precision, QudaPrecision ghost_precision=QUDA_INVALID_PRECISION, bool force_native=false)
virtual void M(ColorSpinorField &out, const ColorSpinorField &in) const =0
Apply M for the dirac op. E.g. the Schur Complement operator.
const Dirac * Expose() const
virtual bool hermitian() const
unsigned long long flops() const
QudaMatPCType getMatPCType() const
void blockOrthogonalize(std::vector< ColorSpinorField * > v, std::vector< ColorSpinorField * > &r, int j)
Orthogonalise input vectors r against vector space v using block-BLAS.
void blockReset(std::vector< ColorSpinorField * > &kSpace, int js, int je, int offset)
Copy temp part of kSpace, zero out for next use.
void matVec(const DiracMatrix &mat, ColorSpinorField &out, const ColorSpinorField &in)
Applies the specified matVec operation: M, Mdag, MMdag, MdagM.
void blockRotate(std::vector< ColorSpinorField * > &kSpace, double *array, int rank, const range &i, const range &j, blockType b_type)
Rotate part of kSpace.
bool orthoCheck(std::vector< ColorSpinorField * > v, int j)
Check orthonormality of input vector space v.
void rotateVecs(std::vector< ColorSpinorField * > &kSpace, const double *rot_array, const int offset, const int dim, const int keep, const int locked, TimeProfile &profile)
Rotate the Krylov space.
void deflate(std::vector< ColorSpinorField * > &sol, const std::vector< ColorSpinorField * > &src, const std::vector< ColorSpinorField * > &evecs, const std::vector< Complex > &evals, bool accumulate=false) const
Deflate a set of source vectors with a given eigenspace.
void prepareInitialGuess(std::vector< ColorSpinorField * > &kSpace)
Check for an initial guess. If none present, populate with rands, then orthonormalise.
void deflateSVD(std::vector< ColorSpinorField * > &sol, const std::vector< ColorSpinorField * > &vec, const std::vector< ColorSpinorField * > &evecs, const std::vector< Complex > &evals, bool accumulate=false) const
Deflate a set of source vectors with a set of left and right singular vectors.
void sortArrays(QudaEigSpectrumType spec_type, int n, std::vector< Complex > &x, std::vector< Complex > &y)
Sort array the first n elements of x according to spec_type, y comes along for the ride.
EigenSolver(const DiracMatrix &mat, QudaEigParam *eig_param, TimeProfile &profile)
Constructor for base Eigensolver class.
void orthonormalizeMGS(std::vector< ColorSpinorField * > &v, int j)
Orthonormalise input vector space v using Modified Gram-Schmidt.
virtual bool hermitian()=0
std::vector< ColorSpinorField * > r
void checkChebyOpMax(const DiracMatrix &mat, std::vector< ColorSpinorField * > &kSpace)
Check for a maximum of the Chebyshev operator.
double setEpsilon(const QudaPrecision prec)
Set the epsilon parameter.
void computeEvals(const DiracMatrix &mat, std::vector< ColorSpinorField * > &evecs, std::vector< Complex > &evals, int size)
Compute eigenvalues and their residiua.
void computeSVD(const DiracMatrix &mat, std::vector< ColorSpinorField * > &evecs, std::vector< Complex > &evals)
Computes Left/Right SVD from pre computed Right/Left.
void rotateVecsComplex(std::vector< ColorSpinorField * > &kSpace, const Complex *rot_array, const int offset, const int dim, const int keep, const int locked, TimeProfile &profile)
Rotate the Krylov space.
void permuteVecs(std::vector< ColorSpinorField * > &kSpace, int *mat, int size)
Permute the vector space using the permutation matrix.
double estimateChebyOpMax(const DiracMatrix &mat, ColorSpinorField &out, ColorSpinorField &in)
Estimate the spectral radius of the operator for the max value of the Chebyshev polynomial.
void queryPrec(const QudaPrecision prec)
Query the eigensolver precision to stdout.
static EigenSolver * create(QudaEigParam *eig_param, const DiracMatrix &mat, TimeProfile &profile)
Creates the eigensolver using the parameters given and the matrix.
void prepareKrylovSpace(std::vector< ColorSpinorField * > &kSpace, std::vector< Complex > &evals)
Extend the Krylov space.
void loadFromFile(const DiracMatrix &mat, std::vector< ColorSpinorField * > &eig_vecs, std::vector< Complex > &evals)
Load and check eigenpairs from file.
void cleanUpEigensolver(std::vector< ColorSpinorField * > &kSpace, std::vector< Complex > &evals)
Release memory, save eigenvectors, resize the Krylov space to its original dimension.
void blockRotateComplex(std::vector< ColorSpinorField * > &kSpace, Complex *array, int rank, const range &i, const range &j, blockType b_type, int offset)
Rotate part of kSpace.
void printEigensolverSetup()
Dump the eigensolver parameters to stdout.
void chebyOp(const DiracMatrix &mat, ColorSpinorField &out, const ColorSpinorField &in)
Promoted the specified matVec operation: M, Mdag, MMdag, MdagM to a Chebyshev polynomial.
std::vector< double > residua
Implicitly Restarted Arnoldi Method.
QudaFieldLocation Location() const
Class declaration to initialize and hold CURAND RNG states.
Thick Restarted Lanczos Method.
bool isRunning(QudaProfileType idx)
VectorIO is a simple wrapper class for loading and saving sets of vector fields using QIO.
void load(std::vector< ColorSpinorField * > &vecs)
Load vectors from filename.
void save(const std::vector< ColorSpinorField * > &vecs)
Save vectors to filename.
void mat(void *out, void **link, void *in, int dagger_bit, int mu, QudaPrecision sPrecision, QudaPrecision gPrecision)
enum QudaPrecision_s QudaPrecision
@ QUDA_CPU_FIELD_LOCATION
enum QudaEigSpectrumType_s QudaEigSpectrumType
@ QUDA_EIG_BLK_IR_ARNOLDI
@ QUDA_EIG_BLK_TR_LANCZOS
@ QUDA_REFERENCE_FIELD_CREATE
enum QudaParity_s QudaParity
#define safe_malloc(size)
void caxpby(const Complex &a, ColorSpinorField &x, const Complex &b, ColorSpinorField &y)
void caxpbypczw(const Complex &a, ColorSpinorField &x, const Complex &b, ColorSpinorField &y, const Complex &c, ColorSpinorField &z, ColorSpinorField &w)
void hDotProduct(Complex *result, std::vector< ColorSpinorField * > &a, std::vector< ColorSpinorField * > &b)
Computes the matrix of inner products between the vector set a and the vector set b....
void ax(double a, ColorSpinorField &x)
void axpy_L(const double *a, std::vector< ColorSpinorField * > &x, std::vector< ColorSpinorField * > &y)
Compute the block "axpy_L" with over the set of ColorSpinorFields. E.g., it computes.
void zero(ColorSpinorField &a)
double norm2(const ColorSpinorField &a)
void caxpy_U(const Complex *a, std::vector< ColorSpinorField * > &x, std::vector< ColorSpinorField * > &y)
Compute the block "caxpy_U" with over the set of ColorSpinorFields. E.g., it computes.
void caxpy_L(const Complex *a, std::vector< ColorSpinorField * > &x, std::vector< ColorSpinorField * > &y)
Compute the block "caxpy_L" with over the set of ColorSpinorFields. E.g., it computes.
double reDotProduct(ColorSpinorField &x, ColorSpinorField &y)
void axpy_U(const double *a, std::vector< ColorSpinorField * > &x, std::vector< ColorSpinorField * > &y)
Compute the block "axpy_U" with over the set of ColorSpinorFields. E.g., it computes.
void axpy(double a, ColorSpinorField &x, ColorSpinorField &y)
void caxpy(const Complex &a, ColorSpinorField &x, ColorSpinorField &y)
void copy(ColorSpinorField &dst, const ColorSpinorField &src)
Complex cDotProduct(ColorSpinorField &, ColorSpinorField &)
void saveTuneCache(bool error=false)
std::complex< double > Complex
__host__ __device__ ValueType sqrt(ValueType x)
__host__ __device__ ValueType norm(const complex< ValueType > &z)
Returns the magnitude of z squared.
constexpr QudaParity impliedParityFromMatPC(const QudaMatPCType &matpc_type)
Helper function for getting the implied spinor parity from a matrix preconditioning type.
void spinorNoise(ColorSpinorField &src, RNG &randstates, QudaNoiseType type)
Generate a random noise spinor. This variant allows the user to manage the RNG state.
__host__ __device__ ValueType abs(ValueType x)
void printQudaEigParam(QudaEigParam *param)
QudaEigSpectrumType spectrum
QudaBoolean io_parity_inflate
DEVICEHOST void swap(Real &a, Real &b)
QudaVerbosity getVerbosity()