-
Notifications
You must be signed in to change notification settings - Fork 49
Expand file tree
/
Copy pathtm_sub_Hopping_Matrix.c
More file actions
111 lines (99 loc) · 2.75 KB
/
tm_sub_Hopping_Matrix.c
File metadata and controls
111 lines (99 loc) · 2.75 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
/**********************************************************************
*
* Copyright (C) 2012 Carsten Urbach
*
* This file is based on an implementation of the Dirac operator
* written by Martin Luescher, modified by Martin Hasenbusch in 2002
* and modified and extended by Carsten Urbach from 2003-2008
*
* 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
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* 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 <http://www.gnu.org/licenses/>.
*
*
* Hopping_Matrix is the conventional Wilson
* hopping matrix
*
****************************************************************/
#ifdef HAVE_CONFIG_H
#include <tmlqcd_config.h>
#endif
#include <stdio.h>
#include <stdlib.h>
#ifdef TM_USE_OMP
#include <omp.h>
#endif
#include <complex.h>
#include "global.h"
#include "su3.h"
#ifdef TM_USE_MPI
#include "xchange/xchange.h"
#endif
#include "boundary.h"
#include "init/init_dirac_halfspinor.h"
#include "tm_sub_Hopping_Matrix.h"
#include "update_backward_gauge.h"
// now comes the definition of tm_times_Hopping_Matrix
// which does (a + g5 i b - Hopping_Matrix)
// where cfactor = a + i b
//
#if (defined TM_USE_HALFSPINOR)
#include "operator/halfspinor_hopping.h"
void tm_sub_Hopping_Matrix(const int ieo, spinor* const l, spinor* const p, spinor* const k,
complex double const cfactor) {
#ifdef TM_USE_GAUGE_COPY
if (g_update_gauge_copy) {
update_backward_gauge(g_gauge_field);
}
#endif
#ifdef TM_USE_OMP
#pragma omp parallel
{
su3* restrict u0 ALIGN;
#endif
#define _TM_SUB_HOP
spinor* pn;
#include "operator/halfspinor_body.inc"
#undef _TM_SUB_HOP
#ifdef TM_USE_OMP
} /* OpenMP closing brace */
#endif
return;
}
#elif (!defined _NO_COMM && !defined TM_USE_HALFSPINOR)
#include "hopping.h"
void tm_sub_Hopping_Matrix(const int ieo, spinor* const l, spinor* p, spinor* const k,
complex double const cfactor) {
#ifdef TM_USE_GAUGE_COPY
if (g_update_gauge_copy) {
update_backward_gauge(g_gauge_field);
}
#endif
#if (defined TM_USE_MPI)
xchange_field(k, ieo);
#endif
#ifdef TM_USE_OMP
#pragma omp parallel
{
#endif
#define _TM_SUB_HOP
spinor* pn;
#include "operator/hopping_body_dbl.inc"
#undef _TM_SUB_HOP
#ifdef TM_USE_OMP
} /* OpenMP closing brace */
#endif
return;
}
#endif