Open mehrhardt opened 4 years ago
I tried the example below (taken from linearized.py but with dtype='complex') which failed with
linearized.py
dtype='complex'
TypeError: Cannot cast ufunc add output from dtype('complex128') to dtype('float64') with casting rule 'same_kind'
This can be fixed by disp_field_space = space.tangent_bundle.real_space. Is this the desired behaviour?
disp_field_space = space.tangent_bundle.real_space
import odl space = odl.uniform_discr(0, 1, 5, dtype='complex') disp_field_space = space.tangent_bundle template = space.element([0, 0, 1, 0, 0]) displacement_field = disp_field_space.element([[0, 0, 0, -0.2, 0]]) odl.deform.linear_deform(template, displacement_field)
Good observation. I'm not 100% sure if the correct solution is to make the tangent bundle itself real, or if we should use real_space here. Perhaps @ozanoktem has the correct mathematical intuition?
I tried the example below (taken from
linearized.py
but withdtype='complex'
) which failed withThis can be fixed by
disp_field_space = space.tangent_bundle.real_space
. Is this the desired behaviour?