Skip to content

Commit

Permalink
test complete
Browse files Browse the repository at this point in the history
  • Loading branch information
lehner committed Dec 11, 2023
1 parent a20d6c3 commit c19934c
Show file tree
Hide file tree
Showing 3 changed files with 38 additions and 14 deletions.
1 change: 1 addition & 0 deletions lib/gpt/qcd/gauge/fix/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,3 +17,4 @@
# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
#
from gpt.qcd.gauge.fix.landau import landau
from gpt.qcd.gauge.fix.identity import identity
30 changes: 30 additions & 0 deletions lib/gpt/qcd/gauge/fix/identity.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
#
# GPT - Grid Python Toolkit
# Copyright (C) 2020 Christoph Lehner ([email protected], https://github.com/lehner/gpt)
#
# This program 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 2 of the License, or
# (at your option) any later version.
#
# This program 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 this program; if not, write to the Free Software Foundation, Inc.,
# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
#
import gpt as g


def identity(U, mu=3):
# U'(x) = V(x) U_mu(x) Vdag(x+mu)
# V = [1, U[0], U[0] U[1], U[0] U[1] U[2], ...]
U_n = g.separate(U[mu], mu)
V_n = [g.identity(U_n[0])]
N = len(U_n)
for n in range(N - 1):
V_n.append(g(V_n[n] * U_n[n]))
return g.merge(V_n, mu)
21 changes: 7 additions & 14 deletions tests/qcd/gauge.py
Original file line number Diff line number Diff line change
Expand Up @@ -225,20 +225,13 @@


# test temporal gauge
def identity(U, mu=3):
# U'(x) = V(x) U_mu(x) Vdag(x+mu)
# V = [1, U[0], U[0] U[1], U[0] U[1] U[2], ...]
U_n = g.separate(U[mu], mu)
V_n = [g.identity(U_n[0])]
N = len(U_n)
for n in range(N - 1):
V_n.append(g(V_n[n] * U_n[n]))
return g.merge(V_n, mu)


V = identity(U)
V = g.qcd.gauge.fix.identity(U, mu=3)

Up = g.qcd.gauge.transformed(U, V)

for t in range(16):
print(t, Up[3][0, 0, 0, t])
ref = g.identity(V)[0, 0, 0, 0]

for t in range(grid.gdimensions[3] - 1):
eps2 = g.norm2(Up[3][0, 0, 0, t] - ref)
g.message(f"Test temporal gauge at t={t}: {eps2}")
assert eps2 < 1e-25

0 comments on commit c19934c

Please sign in to comment.