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
ba78fbd1
Commit
ba78fbd1
authored
Feb 09, 2017
by
Theo Steininger
Browse files
Added probing.py
parent
6698f9c7
Changes
1
Hide whitespace changes
Inline
Side-by-side
demos/probing.py
0 → 100644
View file @
ba78fbd1
# -*- coding: utf-8 -*-
from
nifty
import
Field
,
RGSpace
,
DiagonalProberMixin
,
TraceProberMixin
,
\
Prober
,
DiagonalOperator
class
DiagonalProber
(
DiagonalProberMixin
,
Prober
):
pass
class
MultiProber
(
DiagonalProberMixin
,
TraceProberMixin
,
Prober
):
pass
x
=
RGSpace
((
8
,
8
))
f
=
Field
.
from_random
(
domain
=
x
,
random_type
=
'normal'
)
diagOp
=
DiagonalOperator
(
domain
=
x
,
diagonal
=
f
)
diagProber
=
DiagonalProber
(
domain
=
x
)
diagProber
(
diagOp
)
print
(
f
-
diagProber
.
diagonal
).
norm
()
multiProber
=
MultiProber
(
domain
=
x
)
multiProber
(
diagOp
)
print
(
f
-
multiProber
.
diagonal
).
norm
()
print
f
.
sum
()
-
multiProber
.
trace
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