Skip to content

Commit

Permalink
c-order potential
Browse files Browse the repository at this point in the history
  • Loading branch information
lehner committed Dec 19, 2024
1 parent e72c7cd commit c469d84
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions lib/gpt/algorithms/group/polar_regulator.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,16 +21,17 @@


class polar_regulator(differentiable_functional):
def __init__(self, lam, kap):
def __init__(self, lam, kap, c):
self.lam = lam
self.kap = kap
self.c = c

def __call__(self, fields):
I = g.identity(fields[0])
Nc = fields[0].otype.Ndim
r = 0.0
for mu in range(len(fields)):
r += (self.lam / 2 / Nc) * g.sum(g.trace((fields[mu] - I) * (fields[mu] - I))).real
r += (self.lam / 2 / Nc) * g.sum(g.component.pow(self.c)(g.trace((fields[mu] - I) * (fields[mu] - I)))).real
r -= (self.kap / Nc) * g.sum(g.component.log(g.matrix.det(fields[mu]))).real
return r

Expand All @@ -41,6 +42,6 @@ def gradient(self, fields, dfields):
I = g.identity(dfields[0])
Nc = fields[0].otype.Ndim
for df in dfields:
x = g(2.0 * (self.lam / 2 / Nc) * (df - I) - (self.kap / Nc) * g.matrix.inv(df))
x = g(2.0 * (self.lam / 2 / Nc) * self.c * g.component.pow(self.c-1)(g.trace((df - I)*(df-I)))* (df - I) - (self.kap / Nc) * g.matrix.inv(df))

Check failure on line 45 in lib/gpt/algorithms/group/polar_regulator.py

View workflow job for this annotation

GitHub Actions / lint

E226:missing whitespace around arithmetic operator

Check failure on line 45 in lib/gpt/algorithms/group/polar_regulator.py

View workflow job for this annotation

GitHub Actions / lint

E226:missing whitespace around arithmetic operator

Check failure on line 45 in lib/gpt/algorithms/group/polar_regulator.py

View workflow job for this annotation

GitHub Actions / lint

E226:missing whitespace around arithmetic operator

Check failure on line 45 in lib/gpt/algorithms/group/polar_regulator.py

View workflow job for this annotation

GitHub Actions / lint

E225:missing whitespace around operator
dAdS.append(x)
return dAdS

0 comments on commit c469d84

Please sign in to comment.