Bug in metric
The following script crashes in the current version of nifty and even on the branch opsumdomains
the last example crashes. Anyone any ideas how to fix this?
import nifty5 as ift
dom = ift.RGSpace(10)
diffuse = ift.ducktape(dom, None, 'xi')
diffuse2 = ift.ducktape(dom, None, 'xi2')
e1 = ift.GaussianEnergy(domain=diffuse.target)
ops = []
ops.append((e1 + e1) @ diffuse)
ops.append(e1 @ diffuse)
ops.append(e1 @ diffuse + e1 @ diffuse2)
for op in ops:
pos = ift.full(op.domain, 0)
lin = ift.Linearization.make_var(pos, True)
print(op(lin).metric)
assert isinstance(op(lin).metric.domain, ift.MultiDomain)
assert op(lin).metric.domain is op.domain