Skip to content


Subversion checkout URL

You can clone with
Download ZIP
Fetching contributors…

Cannot retrieve contributors at this time

94 lines (84 sloc) 3.11 KB
* Copyright (C) 2012 Carsten Urbach
* This file is part of tmLQCD.
* tmLQCD is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
* tmLQCD is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* GNU General Public License for more details.
* You should have received a copy of the GNU General Public License
* along with tmLQCD. If not, see <>.
* invert_clover_eo makes an inversion with EO preconditioned
* clover tm Operator
* Even and Odd are the numbers of spinor_field that contain
* the even and the odd sites of the source. The result is stored
* int Even_new and Odd_new.
* invert_eo returns the number of iterations needed or -1 if the
* solver did not converge.
* Author: Carsten Urbach
# include<config.h>
#include "solver/dirac_operator_eigenvectors.h"
int invert_clover_eo(spinor * const Even_new, spinor * const Odd_new,
spinor * const Even, spinor * const Odd,
const double precision, const int max_iter,
const int solver_flag, const int rel_prec,
su3 *** gf, matrix_mult Qsq, matrix_mult Qm) {
int iter;
if(g_proc_id == 0 && g_debug_level > 0) {
printf("# Using even/odd preconditioning!\n"); fflush(stdout);
assign_mul_one_sw_pm_imu_inv(EE, Even_new, Even, +g_mu);
Hopping_Matrix(OE, g_spinor_field[DUM_DERI], Even_new);
/* The sign is plus, since in Hopping_Matrix */
/* the minus is missing */
assign_mul_add_r(g_spinor_field[DUM_DERI], +1., Odd, VOLUME/2);
/* Do the inversion with the preconditioned */
/* matrix to get the odd sites */
/* Here we invert the hermitean operator squared */
gamma5(g_spinor_field[DUM_DERI], g_spinor_field[DUM_DERI], VOLUME/2);
if(g_proc_id == 0) {
printf("# Using CG!\n");
printf("# mu = %f, kappa = %f, csw = %f\n",
g_mu/2./g_kappa, g_kappa, g_c_sw);
iter = cg_her(Odd_new, g_spinor_field[DUM_DERI], max_iter,
precision, rel_prec,
VOLUME/2, Qsq);
Qm(Odd_new, Odd_new);
/* Reconstruct the even sites */
Hopping_Matrix(EO, g_spinor_field[DUM_DERI], Odd_new);
clover_inv(EE, g_spinor_field[DUM_DERI], +g_mu);
/* The sign is plus, since in Hopping_Matrix */
/* the minus is missing */
assign_add_mul_r(Even_new, g_spinor_field[DUM_DERI], +1., VOLUME/2);
Jump to Line
Something went wrong with that request. Please try again.