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
dce58040
Commit
dce58040
authored
Jul 11, 2017
by
Martin Reinecke
Browse files
fix field.vdot
parent
89e27a11
Pipeline
#14736
passed with stage
in 8 minutes and 40 seconds
Changes
2
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
nifty/field.py
View file @
dce58040
...
...
@@ -1073,7 +1073,7 @@ class Field(Loggable, Versionable, object):
if
spaces
is
None
:
x_val
=
x
.
get_val
(
copy
=
False
)
y_val
=
y
.
get_val
(
copy
=
False
)
result
=
(
x
_val
.
conjugate
()
*
y
_val
).
sum
()
result
=
(
y
_val
.
conjugate
()
*
x
_val
).
sum
()
return
result
else
:
# create a diagonal operator which is capable of taking care of the
...
...
test/test_field.py
View file @
dce58040
...
...
@@ -119,3 +119,12 @@ class Test_Functionality(unittest.TestCase):
assert_allclose
(
ps2
.
val
.
get_full_data
()
/
samples
,
fp2
.
val
.
get_full_data
(),
rtol
=
0.1
)
def
test_vdot
(
self
):
s
=
RGSpace
((
10
,))
f1
=
Field
.
from_random
(
"normal"
,
domain
=
s
,
dtype
=
np
.
complex128
)
f2
=
Field
.
from_random
(
"normal"
,
domain
=
s
,
dtype
=
np
.
complex128
)
assert_allclose
(
f1
.
vdot
(
f2
),
f1
.
vdot
(
f2
,
spaces
=
0
))
assert_allclose
(
f1
.
vdot
(
f2
),
np
.
conj
(
f2
.
vdot
(
f1
)))
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