Commit bd51954c authored by Theo Steininger's avatar Theo Steininger

Fixed fixed point normalization.

parent 02913710
Pipeline #12883 passed with stages
in 11 minutes and 15 seconds
......@@ -605,19 +605,26 @@ class Field(Loggable, Versionable, object):
if flipped_Q:
h *= np.sqrt(2)
a *= np.sqrt(2)
fixed_points = [[fp] if fp is None else fp for fp in fixed_points]
for product_point in itertools.product(*fixed_points):
slice_object = np.array((slice(None), )*len(val.shape),
dtype=np.object)
for i, sp in enumerate(spaces):
point_component = product_point[i]
if point_component is None:
point_component = slice(None)
slice_object[list(domain_axes[sp])] = point_component
slice_object = tuple(slice_object)
h[slice_object] /= np.sqrt(2)
a[slice_object] /= np.sqrt(2)
# in principle one must not correct the variance for the fixed
# points of the hermitianization. However, for a complex field
# the input field looses half of its power at its fixed points
# in the `hermitian` part. Hence, here a factor of sqrt(2) is
# also necessary!
# fixed_points = [[fp] if fp is None else fp for fp in fixed_points]
# for product_point in itertools.product(*fixed_points):
# slice_object = np.array((slice(None), )*len(val.shape),
# dtype=np.object)
# for i, sp in enumerate(spaces):
# point_component = product_point[i]
# if point_component is None:
# point_component = slice(None)
# slice_object[list(domain_axes[sp])] = point_component
#
# slice_object = tuple(slice_object)
# h[slice_object] /= np.sqrt(2)
# a[slice_object] /= np.sqrt(2)
return (h, a)
......
......@@ -97,8 +97,8 @@ class LMSpace(Space):
anti_hermitian_part[:] = x.imag * 1j
return (hermitian_part, anti_hermitian_part)
def hermitian_fixed_points(self):
return None
# def hermitian_fixed_points(self):
# return None
# ---Mandatory properties and methods---
......
......@@ -120,17 +120,17 @@ class RGSpace(Space):
return (hermitian_part, anti_hermitian_part)
def hermitian_fixed_points(self):
shape = self.shape
mid_index = np.array(shape)//2
ndlist = [2 if (shape[i] % 2 == 0) else 1 for i in xrange(len(shape))]
ndlist = tuple(ndlist)
odd_axes_list = np.array([1 if (shape[i] % 2 == 1) else 0
for i in xrange(len(shape))])
fixed_points = []
for i in np.ndindex(ndlist):
fixed_points += [tuple((i+odd_axes_list) * mid_index)]
return fixed_points
# def hermitian_fixed_points(self):
# shape = self.shape
# mid_index = np.array(shape)//2
# ndlist = [2 if (shape[i] % 2 == 0) else 1 for i in xrange(len(shape))]
# ndlist = tuple(ndlist)
# odd_axes_list = np.array([1 if (shape[i] % 2 == 1) else 0
# for i in xrange(len(shape))])
# fixed_points = []
# for i in np.ndindex(ndlist):
# fixed_points += [tuple((i+odd_axes_list) * mid_index)]
# return fixed_points
def _hermitianize_correct_variance(self, hermitian_part,
anti_hermitian_part, axes):
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment