sagemath / sage

Main repository of SageMath
https://www.sagemath.org
Other
1.33k stars 453 forks source link

Installing ChomP causes ChainComplex to return incorrect answers #16364

Closed NathanDunfield closed 9 years ago

NathanDunfield commented 10 years ago

Installing the ChomP package causes ChainComplex to give different (and basically wrong) answers. Here are two examples from the doctests:

sage: C = ChainComplex([matrix(ZZ, 1, 1, [2]), matrix(ZZ, 1, 1), matrix(1, 1, [3])])
sage: C.torsion_list(5)
[(2, []), (3, [])]   # Should be [(2, [1]), (3, [3])]
sage: S = simplicial_complexes.SumComplex(17, [0, 1, 4])
sage: S.homology(1)
0    # Should be C140183

May be related to #12607 where installing ChomP causes certain 0 dimensional homology groups not to be reported.

Upstream: Reported upstream. No feedback yet.

CC: @jhpalmieri @kini

Component: packages: optional

Keywords: chomp

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

NathanDunfield commented 9 years ago
comment:2

I poked around a bit. In the first example, the issue seems to be that the wrapper is misparsing the correct output of "homchain". In the second example, "homchain" outputs the following abort message (due to integer overflow, I think) which is ignored by the wrapper.

[Tech info: chain 24, addr 8, intgr 2.] Reading a chain complex from 'bad.txt'... Time used so far: 0.00 sec (0.000 min). The ring of coefficients is the ring of integers. Computing the homology of the chain complex... Reducing D_1: 0 +ERROR: Number out of range (*).

kcrisman commented 9 years ago
comment:3

Possibly related: http://ask.sagemath.org/question/26550/make-ptest-best-way-to-fix-errors/

jhpalmieri commented 9 years ago

Upstream: Reported upstream. No feedback yet.

jhpalmieri commented 9 years ago
comment:4

Several comments: first, there is a new version of CHomP: see https://github.com/shaunharker/CHomP, but it does not fix these problems (at least the second one: the first is a problem with Sage's interface with CHomP, so that's our fault). Second, because of the second problem, we obviously need to catch this kind of error to avoid producing nonsensical answers. (It would also be nice to fix CHomP. I'll email the developer.)

tscrim commented 9 years ago
comment:5

We probably should fix #12607 now that optional spkgs are always tested, and we can do a version bump of CHomP (along with making it a new-style spkg).

jhpalmieri commented 9 years ago
comment:6

It would also be good to deal with #15202, but that's a more complicated project.

fchapoton commented 9 years ago
comment:7

The first problem is solved by the branch at #12607, that needs review.

fchapoton commented 9 years ago

Changed keywords from none to chomp

fchapoton commented 9 years ago
comment:9

And the second looks indeed like an overflow error in a product inside CHomP. This works

sage: S = simplicial_complexes.SumComplex(17, [0, 1, 4])
sage: S.homology(algorithm='chomp',verbose=True,base_ring=GF(103))

How should we catch the errors of CHomP ?

fchapoton commented 9 years ago
comment:10

I am taking care of the second problem also in ticket #12607

fchapoton commented 9 years ago
comment:12

Everything should be taken care of in #12607