Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
ift
NIFTy
Commits
e973ddf2
Commit
e973ddf2
authored
Dec 04, 2019
by
Philipp Haim
Browse files
Removed unneeded self._spaces
parent
f0c89521
Pipeline
#64927
failed with stages
in 8 minutes and 34 seconds
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
nifty6/library/correlated_fields.py
View file @
e973ddf2
...
...
@@ -341,7 +341,6 @@ class CorrelatedFieldMaker:
def
__init__
(
self
,
amplitude_offset
,
prefix
,
total_N
):
assert
isinstance
(
amplitude_offset
,
Operator
)
self
.
_a
=
[]
self
.
_spaces
=
[]
self
.
_position_spaces
=
[]
self
.
_azm
=
amplitude_offset
...
...
@@ -421,11 +420,9 @@ class CorrelatedFieldMaker:
if
index
is
not
None
:
self
.
_a
.
insert
(
index
,
amp
)
self
.
_position_spaces
.
insert
(
index
,
position_space
)
self
.
_spaces
.
insert
(
index
,
space
)
else
:
self
.
_a
.
append
(
amp
)
self
.
_position_spaces
.
append
(
position_space
)
self
.
_spaces
.
append
(
space
)
def
_finalize_from_op
(
self
):
n_amplitudes
=
len
(
self
.
_a
)
...
...
@@ -433,29 +430,29 @@ class CorrelatedFieldMaker:
hspace
=
makeDomain
([
UnstructuredDomain
(
self
.
_total_N
)]
+
[
dd
.
target
[
-
1
].
harmonic_partner
for
dd
in
self
.
_a
])
spaces
=
list
(
1
+
np
.
arange
(
n_amplitudes
))
spaces
=
tuple
(
range
(
1
,
n_amplitudes
+
1
))
amp_space
=
1
else
:
hspace
=
makeDomain
(
[
dd
.
target
[
0
].
harmonic_partner
for
dd
in
self
.
_a
])
spaces
=
tuple
(
range
(
n_amplitudes
))
space
s
=
list
(
np
.
arange
(
n_amplitudes
))
amp_
space
=
0
expander
=
ContractionOperator
(
hspace
,
spaces
=
spaces
).
adjoint
azm
=
expander
@
self
.
_azm
# spaces = np.array(range(n_amplitudes)) + 1 - 1//self._total_N
ht
=
HarmonicTransformOperator
(
hspace
,
self
.
_position_spaces
[
0
][
self
.
_space
s
[
0
]
],
self
.
_position_spaces
[
0
][
amp
_space
],
space
=
spaces
[
0
])
for
i
in
range
(
1
,
n_amplitudes
):
ht
=
(
HarmonicTransformOperator
(
ht
.
target
,
self
.
_position_spaces
[
i
][
self
.
_space
s
[
i
]
],
self
.
_position_spaces
[
i
][
amp
_space
],
space
=
spaces
[
i
])
@
ht
)
pd
=
PowerDistributor
(
hspace
,
self
.
_a
[
0
].
target
[
self
.
_space
s
[
0
]],
self
.
_space
s
[
0
]
)
pd
=
PowerDistributor
(
hspace
,
self
.
_a
[
0
].
target
[
amp
_space
],
amp
_space
)
for
i
in
range
(
1
,
n_amplitudes
):
pd
=
(
pd
@
PowerDistributor
(
pd
.
domain
,
self
.
_a
[
i
].
target
[
self
.
_space
s
[
i
]
],
self
.
_a
[
i
].
target
[
amp
_space
],
space
=
spaces
[
i
]))
a
=
ContractionOperator
(
pd
.
domain
,
spaces
[
1
:]).
adjoint
@
self
.
_a
[
0
]
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new 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