A function that was obtained from get_params_to_statetensor_func will return NaN when given too few parameters, rather than erroring out or assuming the extra parameters to be zero. Is this the expected behaviour?
Minimum working example:
f = qujax.get_params_to_statetensor_func(['Rx', 'Ry'], [[0], [0]], [[0], [1]])
f(np.array([1.0]))
# returns: Array([nan+nanj, nan+nanj], dtype=complex64)
I would expect either an error, since:
np.array([1.0, 0.0])[2]
# throws: "IndexError: index 2 is out of bounds for axis 0 with size 2"
or for the extra parameters to be assumed to be zero, since:
jax.numpy.array([1.0, 0.0])[2]
# returns: Array(0., dtype=float32)
I think throwing an error would be the ideal behaviour here.
A function that was obtained from
get_params_to_statetensor_funcwill return NaN when given too few parameters, rather than erroring out or assuming the extra parameters to be zero. Is this the expected behaviour?Minimum working example:
I would expect either an error, since:
or for the extra parameters to be assumed to be zero, since:
I think throwing an error would be the ideal behaviour here.