3
5 {
6
8 {
10 if (
param.su_project) {
13 *num_failures_h = 0;
16 if (*num_failures_h > 0)
errorQuda(
"Error in the SU(3) unitarization: %d failures\n", *num_failures_h);
18 }
19
20 if (
param.compute_plaquette) {
22 param.plaquette[0] = plaq.x;
23 param.plaquette[1] = plaq.y;
24 param.plaquette[2] = plaq.z;
25 }
27
28 // no point constructing Fmunu unless we are going to use it
29 if (!
param.compute_qcharge && !
param.compute_qcharge_density)
return;
30
31 // create the Fmunu field
33 // u is an extended field we need to shrink for the Fmunu field
34 int x[4];
35 for (
int i = 0; i < 4; i++) x[i] = u.
X()[i] - 2 * u.
R()[i];
42
47
48 if (
param.compute_qcharge ||
param.compute_qcharge_density) {
51 if (
param.compute_qcharge_density && !
param.qcharge_density)
52 errorQuda(
"Charge density requested, but destination field not defined");
56
58
59 if (
param.compute_qcharge_density)
61 else
63
65
66 if (
param.compute_qcharge_density) {
68 qudaMemcpy(
param.qcharge_density, d_qDensity, size, cudaMemcpyDeviceToHost);
70
74 }
75 }
76 }
77
78 } // namespace quda
QudaPrecision Precision() const
@ QUDA_FLOAT2_GAUGE_ORDER
#define pool_pinned_malloc(size)
#define pool_device_malloc(size)
#define pool_pinned_free(ptr)
#define pool_device_free(ptr)
#define get_mapped_device_pointer(ptr)
void gaugeObservables(GaugeField &u, QudaGaugeObservableParam ¶m, TimeProfile &profile)
Calculates a variety of gauge-field observables.
double3 plaquette(const GaugeField &U)
Compute the plaquette of the gauge field.
void computeQCharge(double energy[3], double &qcharge, const GaugeField &Fmunu)
Compute the topological charge and field energy.
void computeFmunu(GaugeField &Fmunu, const GaugeField &gauge)
Compute the Fmunu tensor.
void projectSU3(GaugeField &U, double tol, int *fails)
Project the input gauge field onto the SU(3) group. This is a destructive operation....
void computeQChargeDensity(double energy[3], double &qcharge, void *qdensity, const GaugeField &Fmunu)
Compute the topological charge, field energy and the topological charge density per lattice site.
#define qudaMemcpy(dst, src, count, kind)
QudaGaugeFieldOrder order
QudaGhostExchange ghostExchange
QudaSiteSubset siteSubset