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
96e392be
Commit
96e392be
authored
Mar 09, 2020
by
Philipp Arras
Browse files
Support Operator.vdot(Field)
parent
11e62c4e
Pipeline
#70441
failed with stages
in 20 minutes and 5 seconds
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
nifty6/operators/operator.py
View file @
96e392be
...
...
@@ -71,7 +71,16 @@ class Operator(metaclass=NiftyMeta):
return
ContractionOperator
(
self
.
target
,
spaces
)(
self
)
def
vdot
(
self
,
other
):
return
(
self
.
conjugate
()
*
other
).
sum
()
from
..field
import
Field
from
..multi_field
import
MultiField
from
..sugar
import
makeOp
if
isinstance
(
other
,
Operator
):
res
=
self
.
conjugate
()
*
other
elif
isinstance
(
other
,
(
Field
,
MultiField
)):
res
=
makeOp
(
other
)
@
self
.
conjugate
()
else
:
raise
TypeError
return
res
.
sum
()
@
property
def
real
(
self
):
...
...
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