Skip to content

Commit

Permalink
adjust interface
Browse files Browse the repository at this point in the history
  • Loading branch information
lehner committed Jul 10, 2024
1 parent f2a71ab commit ab357cc
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 6 deletions.
8 changes: 4 additions & 4 deletions lib/gpt/qcd/pseudofermion/action/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -52,14 +52,14 @@ def draw(self, fields, rng):
def gradient(self, fields, dfields):
raise NotImplementedError()

def transformed(self, t):
return transformed_action(self, t)
def transformed(self, t, **args):
return transformed_action(self, t, **args)


class transformed_action(action_base):
def __init__(self, a, t):
def __init__(self, a, t, **args):
self.a = a
self.at = differentiable_functional.transformed(a, t)
self.at = differentiable_functional.transformed(a, t, **args)
self.t = t

def __call__(self, fields):
Expand Down
3 changes: 2 additions & 1 deletion lib/gpt/qcd/pseudofermion/action/exact_one_flavor.py
Original file line number Diff line number Diff line change
Expand Up @@ -159,6 +159,7 @@ def gradient(self, fields, dfields):
if mu < len(fields) - 1:
dS.append(g.qcd.gauge.project.traceless_hermitian(frc[mu]))
else:
raise Exception("not implemented")
# not yet implemented
dS.append(None)

return dS
2 changes: 1 addition & 1 deletion tests/qcd/fermion_actions.py
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ def mobius(m_plus, m_minus):
]

sm = g.qcd.gauge.smear.stout(rho=0.157)
a_sm = acts[0][0].transformed(sm)
a_sm = acts[0][0].transformed(sm, indices=[0, 1, 2, 3])
a_sm.assert_gradient_error(rng, U + [acts[0][2]], U, 1e-3, 5e-7)

for _a in acts:
Expand Down

0 comments on commit ab357cc

Please sign in to comment.