Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
N
NIFTy
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
12
Issues
12
List
Boards
Labels
Milestones
Merge Requests
7
Merge Requests
7
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Packages & Registries
Packages & Registries
Container Registry
Analytics
Analytics
CI / CD
Repository
Value Stream
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
ift
NIFTy
Commits
bd51954c
Commit
bd51954c
authored
May 24, 2017
by
Theo Steininger
1
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fixed fixed point normalization.
parent
02913710
Pipeline
#12883
passed with stages
in 11 minutes and 15 seconds
Changes
3
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
33 additions
and
26 deletions
+33
-26
nifty/field.py
nifty/field.py
+20
-13
nifty/spaces/lm_space/lm_space.py
nifty/spaces/lm_space/lm_space.py
+2
-2
nifty/spaces/rg_space/rg_space.py
nifty/spaces/rg_space/rg_space.py
+11
-11
No files found.
nifty/field.py
View file @
bd51954c
...
...
@@ -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
)
...
...
nifty/spaces/lm_space/lm_space.py
View file @
bd51954c
...
...
@@ -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---
...
...
nifty/spaces/rg_space/rg_space.py
View file @
bd51954c
...
...
@@ -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
):
...
...
Theo Steininger
@theos
mentioned in issue
#135 (closed)
·
May 23, 2017
mentioned in issue
#135 (closed)
mentioned in issue #135
Toggle commit list
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment