Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
R, cutoff, y=ym, renorm=renorm, make_tensor=make_tensor, modified=True
)
if y is None:
y = np.zeros([n], dtype=complex)
m = y.shape[0]
if m != n:
raise ValueError("The matrix R and vector y have incompatible dimensions")
Rt = np.real_if_close(R)
yt = np.real_if_close(y)
if Rt.dtype == np.float and yt.dtype == np.float:
values = np.array(hmr(Rt, yt, cutoff, renorm=renorm))
else:
values = np.array(hm(R, y, cutoff, renorm=renorm))
if make_tensor:
shape = cutoff * np.ones([n], dtype=int)
values = np.reshape(values, shape)
return values