Skip to content

Commit

Permalink
bug fix
Browse files Browse the repository at this point in the history
  • Loading branch information
jinluchang committed Jun 16, 2024
1 parent 19a0e14 commit 7f14883
Show file tree
Hide file tree
Showing 4 changed files with 45 additions and 14 deletions.
15 changes: 11 additions & 4 deletions docs/contents/shmc.md
Original file line number Diff line number Diff line change
Expand Up @@ -169,6 +169,13 @@ U^{ba}(x,\mu) T^a = U(x,\mu) T^b U^{-1}(x,\mu)
\ea
$$

therefore
$$
\ba
U^{ba}(x,\mu) T^b = U^{-1}(x,\mu) T^a U(x,\mu)
\ea
$$

### Gauge momentum evolve

$$
Expand Down Expand Up @@ -211,16 +218,16 @@ $$
\ba
\frac{d}{dt}\pi_2(x,\mu)
&=
-\frac{1}{2} T^a \frac{\delta S}{\delta s_2(x,\mu)^a}
-\frac{1}{2} T^b \frac{\delta S}{\delta s_2(x,\mu)^b}
\\
&=
\frac{1}{2} U^{ba}(x,\mu) T^a \frac{\delta S}{\delta s_1(x,\mu)^b}
\frac{1}{2} U^{ba}(x,\mu) T^b \frac{\delta S}{\delta s_1(x,\mu)^a}
\\
&=
\frac{1}{2} U(x,\mu) T^a U^{-1}(x,\mu) \frac{\delta S}{\delta s_1(x,\mu)^a}
\frac{1}{2} U(x,\mu) T^a U(x,\mu) \frac{\delta S}{\delta s_1(x,\mu)^a}
\\
&=
- U(x,\mu) \frac{d}{dt}\pi_1(x,\mu) U^{-1}(x,\mu)
- U^{-1}(x,\mu) \frac{d}{dt}\pi_1(x,\mu) U(x,\mu)
\ea
$$
where
Expand Down
24 changes: 24 additions & 0 deletions examples-py/hmc-pure-gauge-symmetric.log
Original file line number Diff line number Diff line change
Expand Up @@ -26,4 +26,28 @@ CHECK: ('meson_tensor_tsep', 1)
CHECK: ('meson_jwjj_threshold', 0.1)
CHECK: ('meson_tsep_list', [1, 2, 3, 4, 5, 6, 7])
CHECK: ('hmc', {'max_traj': 8, 'max_traj_always_accept': 4, 'max_traj_reverse_test': 2, 'md_time': 1.0, 'n_step': 6, 'beta': 2.13, 'c1': -0.331, 'save_traj_interval': 4, 'is_saving_topo_info': True})
CHECK: 0 'run_hmc: 1 plaq' actual: 0.7349941278702551 ; load: 0.518293870285883 .
CHECK: target eps: 1e-05 ; actual eps: 0.34581079193798353 .
CHECK: ERROR: JSON results value does not match.
CHECK: 1 'run_hmc: 2 plaq' actual: 0.6690061680093138 ; load: 0.22815696564136062 .
CHECK: target eps: 1e-05 ; actual eps: 0.9827626344254248 .
CHECK: ERROR: JSON results value does not match.
CHECK: 2 'run_hmc: 3 plaq' actual: 0.6347955903849722 ; load: 0.158129326711539 .
CHECK: target eps: 1e-05 ; actual eps: 1.2022986121280272 .
CHECK: ERROR: JSON results value does not match.
CHECK: 3 'run_hmc: 4 plaq' actual: 0.6347955903849722 ; load: 0.158129326711539 .
CHECK: target eps: 1e-05 ; actual eps: 1.2022986121280272 .
CHECK: ERROR: JSON results value does not match.
CHECK: 4 'run_hmc: 5 plaq' actual: 0.6347955903849722 ; load: 0.158129326711539 .
CHECK: target eps: 1e-05 ; actual eps: 1.2022986121280272 .
CHECK: ERROR: JSON results value does not match.
CHECK: 5 'run_hmc: 6 plaq' actual: 0.6347955903849722 ; load: 0.158129326711539 .
CHECK: target eps: 1e-05 ; actual eps: 1.2022986121280272 .
CHECK: ERROR: JSON results value does not match.
CHECK: 6 'run_hmc: 7 plaq' actual: 0.6347955903849722 ; load: 0.158129326711539 .
CHECK: target eps: 1e-05 ; actual eps: 1.2022986121280272 .
CHECK: ERROR: JSON results value does not match.
CHECK: 7 'run_hmc: 8 plaq' actual: 0.6347955903849722 ; load: 0.158129326711539 .
CHECK: target eps: 1e-05 ; actual eps: 1.2022986121280272 .
CHECK: ERROR: JSON results value does not match.
CHECK: finished successfully.
16 changes: 8 additions & 8 deletions examples-py/hmc-pure-gauge-symmetric.log.json
Original file line number Diff line number Diff line change
@@ -1,34 +1,34 @@
[
[
"run_hmc: 1 plaq",
0.518293870285883
0.7349941278702551
],
[
"run_hmc: 2 plaq",
0.22815696564136062
0.6690061680093138
],
[
"run_hmc: 3 plaq",
0.158129326711539
0.6347955903849722
],
[
"run_hmc: 4 plaq",
0.158129326711539
0.6347955903849722
],
[
"run_hmc: 5 plaq",
0.158129326711539
0.6347955903849722
],
[
"run_hmc: 6 plaq",
0.158129326711539
0.6347955903849722
],
[
"run_hmc: 7 plaq",
0.158129326711539
0.6347955903849722
],
[
"run_hmc: 8 plaq",
0.158129326711539
0.6347955903849722
]
]
4 changes: 2 additions & 2 deletions qlat/qlat/lib/hmc.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -256,14 +256,14 @@ void set_gm_force_dual(GaugeMomentum& gm_force_dual, const GaugeField& gf,
qacc_for(index, gf.geo().local_volume(), {
const Geometry& geo = gf.geo();
const Coordinate xl = geo.coordinate_from_index(index);
Vector<ColorMatrix> gm_dual_v = gm_force_dual.get_elems_const(xl);
Vector<ColorMatrix> gm_dual_v = gm_force_dual.get_elems(xl);
const Vector<ColorMatrix> gf_v = gf.get_elems_const(xl);
const Vector<ColorMatrix> gm_v = gm_force.get_elems_const(xl);
qassert(gm_dual_v.size() == 4);
qassert(gf_v.size() == 4);
qassert(gm_v.size() == 4);
for (int mu = 0; mu < 4; ++mu) {
gm_dual_v[mu] = -gf_v[mu] * gm_v[mu] * matrix_adjoint(gf_v[mu]);
gm_dual_v[mu] = -matrix_adjoint(gf_v[mu]) * gm_v[mu] * gf_v[mu];
}
});
}
Expand Down

0 comments on commit 7f14883

Please sign in to comment.