Commit bf72e471 authored by Martin Reinecke's avatar Martin Reinecke

Merge branch 'NIFTy_4' into even_more_fun_with_linear_operators

parents 7db7646b 2accbbe5
Pipeline #31113 passed with stages
in 1 minute and 23 seconds
# Program to generate figures of article "Information theory for fields"
# by Torsten Ensslin, Annalen der Physik, submitted to special edition
# "Physics of Information" in April 2018
# "Physics of Information" in April 2018, arXiv:1804.03350
# to get exact figure of paper comment out lines marked by "COMMENT OUT"
import numpy as np
import nifty4 as ift
......@@ -25,8 +26,9 @@ if __name__ == "__main__":
sigma_n = 0.2 # noise level
sigma_n2 = sigma_n**2
L = 1. # Total length of interval or volume the field lives on
nprobes = 1000 # Number of probes for uncertainty quantification
nprobes = 1000 # Number of probes for uncertainty quantification used in paper
nprobes = 10 # COMMENT OUT TO REPRODUCE PAPER FIGURE EXACTLY
# Define resolution (pixels per dimension)
N_pixels = 1024
......
......@@ -76,6 +76,12 @@ class SandwichOperator(EndomorphicOperator):
def draw_sample(self, from_inverse=False, dtype=np.float64):
# Inverse samples from general sandwiches is not possible
if from_inverse:
if self._bun.capabilities & self._bun.INVERSE_TIMES:
try:
s = self._cheese.draw_sample(from_inverse, dtype)
return self._bun.inverse_times(s)
except:
pass
raise NotImplementedError(
"cannot draw from inverse of this operator")
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment