Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

.coordinate_vector() for IntegerLattice does not respect the base ring (ZZ) #33882

Open
maxale opened this issue May 22, 2022 · 3 comments
Open

Comments

@maxale
Copy link
Contributor

maxale commented May 22, 2022

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.

CC: @yyyyx4

Component: linear algebra

Stopgaps: todo

Issue created by migration from https://trac.sagemath.org/ticket/33882

@maxale maxale added this to the sage-9.7 milestone May 22, 2022
@maxale

This comment has been minimized.

@maxale

This comment has been minimized.

@maxale
Copy link
Contributor Author

maxale commented Jul 27, 2022

Stopgaps: todo

@mkoeppe mkoeppe modified the milestones: sage-9.7, sage-9.8 Sep 19, 2022
@mkoeppe mkoeppe removed this from the sage-9.8 milestone Jan 29, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants