Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
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
13
Issues
13
List
Boards
Labels
Service Desk
Milestones
Merge Requests
9
Merge Requests
9
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Incidents
Environments
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
1e3c56b9
Commit
1e3c56b9
authored
Nov 22, 2019
by
Philipp Frank
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
cleanup
parent
e7ed8b6f
Pipeline
#64216
passed with stages
in 9 minutes and 31 seconds
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
5 additions
and
9 deletions
+5
-9
nifty5/library/correlated_fields.py
nifty5/library/correlated_fields.py
+5
-9
No files found.
nifty5/library/correlated_fields.py
View file @
1e3c56b9
...
...
@@ -21,7 +21,6 @@ import numpy as np
from
..domain_tuple
import
DomainTuple
from
..domains.power_space
import
PowerSpace
from
..domains.unstructured_domain
import
UnstructuredDomain
from
..field
import
Field
from
..operators.adder
import
Adder
from
..operators.contraction_operator
import
ContractionOperator
from
..operators.distributors
import
PowerDistributor
...
...
@@ -31,9 +30,8 @@ from ..operators.linear_operator import LinearOperator
from
..operators.diagonal_operator
import
DiagonalOperator
from
..operators.operator
import
Operator
from
..operators.simple_linear_operators
import
VdotOperator
,
ducktape
from
..operators.value_inserter
import
ValueInserter
from
..probing
import
StatCalculator
from
..sugar
import
from_global_data
,
f
rom_random
,
f
ull
,
makeDomain
from
..sugar
import
from_global_data
,
full
,
makeDomain
def
_reshaper
(
x
,
N
):
...
...
@@ -160,7 +158,6 @@ class _TwoLogIntegrations(LinearOperator):
dom
[
space
]
=
UnstructuredDomain
((
2
,
self
.
target
[
space
].
shape
[
0
]
-
2
))
self
.
_domain
=
makeDomain
(
dom
)
self
.
_space
=
space
logk_lengths
=
_log_k_lengths
(
self
.
_target
[
space
])
self
.
_log_vol
=
_log_vol
(
self
.
_target
[
space
])
self
.
_capability
=
self
.
TIMES
|
self
.
ADJOINT_TIMES
...
...
@@ -203,7 +200,6 @@ class _Normalization(Operator):
hspace
[
space
]
=
hspace
[
space
].
harmonic_partner
hspace
=
makeDomain
(
hspace
)
pd
=
PowerDistributor
(
hspace
,
power_space
=
self
.
_domain
[
space
],
space
=
space
)
# TODO Does not work on sphere yet
mode_multiplicity
=
pd
.
adjoint
(
full
(
pd
.
target
,
1.
)).
to_global_data_rw
()
zero_mode
=
(
slice
(
None
),)
*
self
.
_domain
.
axes
[
space
][
0
]
+
(
0
,)
mode_multiplicity
[
zero_mode
]
=
0
...
...
@@ -267,7 +263,8 @@ class _Amplitude(Operator):
if
len
(
dofdex
)
>
0
:
N_copies
=
max
(
dofdex
)
+
1
space
=
1
distributed_tgt
=
makeDomain
((
UnstructuredDomain
(
len
(
dofdex
)),
target
))
distributed_tgt
=
makeDomain
((
UnstructuredDomain
(
len
(
dofdex
)),
target
))
target
=
makeDomain
((
UnstructuredDomain
(
N_copies
),
target
))
Distributor
=
_Distributor
(
dofdex
,
target
,
distributed_tgt
,
0
)
else
:
...
...
@@ -305,7 +302,7 @@ class _Amplitude(Operator):
foo
,
bar
=
[
np
.
zeros
(
target
[
space
].
shape
)
for
_
in
range
(
2
)]
bar
[
1
:]
=
foo
[
0
]
=
totvol
vol0
,
vol1
=
[
DiagonalOperator
(
from_global_data
(
target
[
space
],
aa
),
target
,
space
)
for
aa
in
(
foo
,
bar
)]
target
,
space
)
for
aa
in
(
foo
,
bar
)]
#Prepare fields for Adder
shift
,
vol0
=
[
op
(
full
(
op
.
domain
,
1
))
for
op
in
(
shift
,
vol0
)]
...
...
@@ -328,11 +325,10 @@ class _Amplitude(Operator):
self
.
_fluc
=
(
_Distributor
(
dofdex
,
fluctuations
.
target
,
distributed_tgt
[
0
])
@
fluctuations
)
else
:
op
=
(
Adder
(
vol0
)
)
@
(
sig_fluc
*
(
azm_expander
@
azm
.
one_over
())
*
op
)
op
=
Adder
(
vol0
)
@
(
sig_fluc
*
(
azm_expander
@
azm
.
one_over
())
*
op
)
self
.
_fluc
=
fluctuations
self
.
apply
=
op
.
apply
self
.
_domain
,
self
.
_target
=
op
.
domain
,
op
.
target
self
.
_space
=
space
...
...
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