Changes between Version 1 and Version 2 of Ticket #29866


Ignore:
Timestamp:
06/16/20 00:49:18 (8 months ago)
Author:
slelievre
Comment:

Legend:

Unmodified
Added
Removed
Modified
  • Ticket #29866

    • Property Cc slelievre added
  • Ticket #29866 – Description

    v1 v2  
    1 in this example a closest vector in L is not in L:
     1In this example we compute `v`, the closest vector to the vector `u` that lies in the integer lattice `L`.
     2
     3Problem: `v` is not in `L`.
    24{{{
    35sage: from sage.modules.free_module_integer import IntegerLattice
    4 ....: L0 = matrix(ZZ,[[20957228, -4966110],[ 9411844, 19625639]])
    5 ....: L = IntegerLattice(L0)
    6 ....: v0 = vector([-423434678248195, -18882583298608161305227077482])
    7 ....: cv = L.closest_vector(v0)
    8 ....: print(cv in L)
    9 ....:
     6sage: M = matrix(ZZ, [[20957228, -4966110], [9411844, 19625639]])
     7sage: L = IntegerLattice(M)
     8sage: u = vector([-423434678248195, -18882583298608161305227077482])
     9sage: v = L.closest_vector(u)
     10sage: print(v in L)
    1011False
    1112}}}