You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The following code demonstrates that despite IntegerLattice being defined as a module over ZZ, its .component_vector() method fails to recognize that a given vector is not in self and proceeds with representing it as a linear combination with fractional coefficients.
from sage.modules.free_module_integer import IntegerLattice
L = IntegerLattice([2,2,2])
r = vector(ZZ,[1,1,1])
print(r in L) # this is False
print(L.coordinate_vector(r,check=True)) # check should fail, and exception should be raised but it's not
On a related note, it is unclear how L.coordinate_vector(r) behaves when r does belong to L. I'd expect it to return a vector with integer components, but given the above behavior it seems that it may return a vector with fractional components anyway. It should stick to the base ring, i.e. ZZ in this case, or at least have an option to enforce this.
The following code demonstrates that despite
IntegerLattice
being defined as a module overZZ
, its.component_vector()
method fails to recognize that a given vector is not inself
and proceeds with representing it as a linear combination with fractional coefficients.On a related note, it is unclear how
L.coordinate_vector(r)
behaves whenr
does belong toL
. I'd expect it to return a vector with integer components, but given the above behavior it seems that it may return a vector with fractional components anyway. It should stick to the base ring, i.e.ZZ
in this case, or at least have an option to enforce this.CC: @yyyyx4
Component: linear algebra
Stopgaps: todo
Issue created by migration from https://trac.sagemath.org/ticket/33882
The text was updated successfully, but these errors were encountered: