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
f286a57f
Commit
f286a57f
authored
Jul 11, 2017
by
Theo Steininger
Browse files
Merge branch 'fix_vdot' into 'master'
fix field.vdot See merge request
!160
parents
89e27a11
dce58040
Pipeline
#14738
passed with stages
in 12 minutes and 27 seconds
Changes
2
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
nifty/field.py
View file @
f286a57f
...
...
@@ -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 @
f286a57f
...
...
@@ -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