Changes between Version 14 and Version 28 of Ticket #29866
- Timestamp:
- 06/17/20 13:21:16 (9 months ago)
Legend:
- Unmodified
- Added
- Removed
- Modified
-
Ticket #29866
-
Property
Status
changed from
new
toneeds_review
-
Property
Authors
changed from
to
Samuel Lelièvre, Dima Pasechnik
- Property Cc chapoton added
-
Property
Branch
changed from
to
u/dimpase/modules/corrround
- Property Keywords round added
-
Property
Commit
changed from
to
1faa6aceeb6799ea31517c9b84b3e4164153e78d
-
Property
Status
changed from
-
Ticket #29866 – Description
v14 v28 1 In this example we compute `v`, the closest vector to the vector `u` that lies in the integer lattice `L`. 2 3 These bugs are already in Sage 8.1 (i.e. still Python 2), as well as in the latest 9.2.beta1. 4 5 However, closest_vector works in Sage 8.4, and is broken in 8.5 (membership test still broken, though). 6 7 Problem: `v` is not in `L`. 1 In this example we compute `v`, the closest vector to the vector `u` 2 that lies in the integer lattice `L`. Problem: `v` is not in `L`. 8 3 {{{ 9 4 sage: from sage.modules.free_module_integer import IntegerLattice … … 12 7 sage: u = vector([-423434678248195, -18882583298608161305227077482]) 13 8 sage: v = L.closest_vector(u) 14 sage: print(v in L)9 sage: v in L 15 10 False 16 sage: MGAP =libgap(M)17 sage: vGAP =libgap(v)18 sage: libgap.SolutionIntMat(MGAP, vGAP)# independent test that v is not in L11 sage: MGAP = libgap(M) 12 sage: vGAP = libgap(v) 13 sage: libgap.SolutionIntMat(MGAP, vGAP) # independent test that v is not in L 19 14 fail 20 15 }}} 21 A simplified version of Taylor Huang's example posted on sage-devel (https://groups.google.com/g/sage-devel/c/CtPAbZPjoeU/m/qj2IH7LxBAAJ)22 16 23 Membership test was reported broken, too (same thread) 17 This is a simplified version of 18 [https://groups.google.com/g/sage-devel/c/CtPAbZPjoeU/m/qj2IH7LxBAAJ Taylor Huang's example posted on sage-devel]. 19 20 This used to work in Sage 8.4, and was broken in 8.5.beta3 by the 21 change from `round(x, 6)` to `x.n(digits=6)` in #26648. 22 23 The sage-devel thread also reports the membership test to be broken: 24 24 {{{ 25 25 from sage.modules.free_module_integer import IntegerLattice 26 coef = Matrix([-44429982080874270968379672793605458, 98931650854481334735580708522902113]) 27 bMat = Matrix([[20957228, -4966110],[ 9411844, 19625639]]) 26 coef = Matrix([-44429982080874270968379672793605458, 27 98931650854481334735580708522902113]) 28 bMat = Matrix([[20957228, -4966110], [9411844, 19625639]]) 28 29 L = IntegerLattice(bMat) 29 coef*bMat in L # prints false30 bMatGAP =libgap(bMat)31 v =libgap(coef*bMat)[0]32 sol =libgap.SolutionIntMat(bMatGAP,v); sol# prints30 coef*bMat in L # should be true, but returns False 31 bMatGAP = libgap(bMat) 32 v = libgap(coef*bMat)[0] 33 sol = libgap.SolutionIntMat(bMatGAP, v); sol # prints 33 34 # [ -423434671769860, -18882583298608161305225815339 ] 34 vector(sol.sage())*bMat ==vector(coef*bMat)# sanity check - prints True35 vector(sol.sage())*bMat == vector(coef*bMat) # sanity check - prints True 35 36 }}} 36 37 37 but this is merely a type "error", in the sense that `coef` is not a vector, but a 1x2 matrix (a different type, and automatic conversion does not happen here). Not sure whether the latter warrants a fix. 38 but this is merely a type "error", in the sense that `coef` is not a vector, 39 but a 1x2 matrix (a different type, and automatic conversion does not happen here). 40 Not sure whether the latter warrants a fix.