Opened 10 years ago

Closed 7 years ago

#12607 closed defect (fixed)

ChainComplex reports zero homology groups (depending on ChomP)

Reported by: vbraun Owned by: jhpalmieri
Priority: major Milestone: sage-6.9
Component: algebraic topology Keywords: chomp
Cc: jhpalmieri, kini, dunfield Merged in:
Authors: Frédéric Chapoton Reviewers: John Palmieri
Report Upstream: N/A Work issues:
Branch: 9febd32 (Commits, GitHub, GitLab) Commit: 9febd321d52405bee2ad201cba99edc504b737bb
Dependencies: Stopgaps:

Status badges

Description

As reported on https://groups.google.com/d/msg/sage-release/gW9IsTBrVII/eGL-ih824vAJ, whether or not ChomP is installed changes the output of ChainComplex.homology by trivial pieces:

sage -t -long -force_lib "devel/sage-main/sage/geometry/fan.py" 
********************************************************************** 
File "/64bitdev/storage/sage/sage-5.0.beta6/devel/sage-main/sage/ 
geometry/fan.py", line 2779: 
    sage: fan.complex().homology() 
Expected: 
    {0: 0, 1: 0, 2: Z x Z, 3: 0} 
Got: 
    {2: Z x Z, 3: 0} 
********************************************************************** 
File "/64bitdev/storage/sage/sage-5.0.beta6/devel/sage-main/sage/ 
geometry/fan.py", line 2783: 
    sage: fan.complex().homology() 
Expected: 
    {0: 0, 1: 0, 2: Z, 3: 0} 
Got: 
    {2: Z, 3: 0} 

The fact that zero-dimensional cohomology groups are reported above and below the non-trivial range is already somewhat annoying, so I propose to fix this by changing the homology method to chop off these irrelevant zeroes. This would then have the additional benefit of the representation no longer depending on whether or not ChomP is installed. So the output for the homology of the 2-sphere should be

{0: Z, 1: 0, 2: Z} 

Change History (18)

comment:1 Changed 10 years ago by jhpalmieri

I'm not sure what you mean by irrelevant zeroes: if we chop off zeroes, then should the reduced homology of the 2-sphere just be {2: Z}? That is overly brief, I think. The answer

{0: 0, 1: 0, 2: Z, 3: 0}

for the homology of the fan includes dimensions 0-3 because those are the dimensions in which the chain complex is nonzero. I think it makes sense to include those groups, whether zero or not.

I think that the CHomP interface should be fixed so that we don't have this issue: it can detect the upper and lower dimensions of the complex, and then pad with zeroes as necessary. It might also make sense to add a flag for the homology method to only return nontrivial groups.

comment:2 Changed 10 years ago by kini

  • Cc kini added

comment:3 Changed 9 years ago by jdemeyer

  • Milestone changed from sage-5.11 to sage-5.12

comment:4 Changed 8 years ago by vbraun_spam

  • Milestone changed from sage-6.1 to sage-6.2

comment:5 Changed 8 years ago by vbraun_spam

  • Milestone changed from sage-6.2 to sage-6.3

comment:6 Changed 8 years ago by vbraun_spam

  • Milestone changed from sage-6.3 to sage-6.4

comment:7 Changed 7 years ago by chapoton

  • Authors set to Frédéric Chapoton
  • Branch set to u/chapoton/12607
  • Commit set to 7e02fd3ab1db778d4d1ffeefc26d5e65097e263c
  • Keywords chomp added
  • Milestone changed from sage-6.4 to sage-6.8
  • Status changed from new to needs_review

simple proposal: stuff zero in the answer of chomp, so that it fits the standard answer


New commits:

7e02fd3trac #12607 first try by adding the missing zeroes

comment:8 Changed 7 years ago by git

  • Commit changed from 7e02fd3ab1db778d4d1ffeefc26d5e65097e263c to 0646662551fb74d4234a5fc9e136d7b1c9744aaa

Branch pushed to git repo; I updated commit sha1. New commits:

0646662trac #12607 correct a typo in verbose call

comment:9 Changed 7 years ago by git

  • Commit changed from 0646662551fb74d4234a5fc9e136d7b1c9744aaa to f78f493d923b1950cfae0f52936637934c339482

Branch pushed to git repo; I updated commit sha1. New commits:

f78f493trac #12607 two unused things in chain_complex

comment:10 Changed 7 years ago by git

  • Commit changed from f78f493d923b1950cfae0f52936637934c339482 to 5b75dfe33aa8ed5c723492ac6761422332da9560

Branch pushed to git repo; I updated commit sha1. New commits:

5b75dfetrac #12607 handling the ChomP errors and fixing the doctests

comment:11 Changed 7 years ago by dunfield

  • Cc dunfield added

comment:12 Changed 7 years ago by chapoton

  • Milestone changed from sage-6.8 to sage-6.9

comment:13 Changed 7 years ago by jhpalmieri

If I install CHomP, I get one doctest failure:

sage -t --long --warn-long 51.8 src/sage/homology/delta_complex.py
**********************************************************************
File "src/sage/homology/delta_complex.py", line 605, in sage.homology.delta_complex.DeltaComplex.chain_complex
Failed example:
    T.homology(subcomplex=T)
Exception raised:
    Traceback (most recent call last):
      File "/Users/palmieri/Desktop/Sage_stuff/sage_builds/CHOMP/sage-6.8/local/lib/python2.7/site-packages/sage/doctest/forker.py", line 496, in _run
        self.compile_and_execute(example, compiler, test.globs)
      File "/Users/palmieri/Desktop/Sage_stuff/sage_builds/CHOMP/sage-6.8/local/lib/python2.7/site-packages/sage/doctest/forker.py", line 858, in compile_and_execute
        exec(compiled, globs)
      File "<doctest sage.homology.delta_complex.DeltaComplex.chain_complex[8]>", line 1, in <module>
        T.homology(subcomplex=T)
      File "/Users/palmieri/Desktop/Sage_stuff/sage_builds/CHOMP/sage-6.8/local/lib/python2.7/site-packages/sage/homology/cell_complex.py", line 541, in homology
        answer = C.homology(**kwds)
      File "/Users/palmieri/Desktop/Sage_stuff/sage_builds/CHOMP/sage-6.8/local/lib/python2.7/site-packages/sage/misc/decorators.py", line 705, in wrapper
        return func(*args, **kwds)
      File "/Users/palmieri/Desktop/Sage_stuff/sage_builds/CHOMP/sage-6.8/local/lib/python2.7/site-packages/sage/homology/chain_complex.py", line 1213, in homology
        return self._homology_chomp(deg, base_ring, verbose, generators)
      File "/Users/palmieri/Desktop/Sage_stuff/sage_builds/CHOMP/sage-6.8/local/lib/python2.7/site-packages/sage/homology/chain_complex.py", line 1054, in _homology_chomp
        generators=generators)
      File "/Users/palmieri/Desktop/Sage_stuff/sage_builds/CHOMP/sage-6.8/local/lib/python2.7/site-packages/sage/interfaces/chomp.py", line 590, in homchain
        return CHomP()('homchain', complex, **kwds)
      File "/Users/palmieri/Desktop/Sage_stuff/sage_builds/CHOMP/sage-6.8/local/lib/python2.7/site-packages/sage/interfaces/chomp.py", line 263, in __call__
        raise RuntimeError('error inside CHomP')
    RuntimeError: error inside CHomP
**********************************************************************
1 item had failures:
   1 of  13 in sage.homology.delta_complex.DeltaComplex.chain_complex
    [145 tests, 1 failure, 1.31 s]

If I then run tests with --optional=sage,chomp, I get a few more errors:

sage -t --long --warn-long 51.8 src/sage/homology/tests.py
**********************************************************************
File "src/sage/homology/tests.py", line 10, in sage.homology.tests
Failed example:
    test_random_chain_complex(trials=20)  # optional - CHomP
Expected nothing
Got:
    Random testing has revealed a problem in test_random_chain_complex
    Please report this bug!  You may be the first
    person in the world to have seen this problem.
    Please include this random seed in your bug report:
    Random seed: 159304674290093254409624536430227373862
    RuntimeError('error inside CHomP',)
**********************************************************************
File "src/sage/homology/tests.py", line 11, in sage.homology.tests
Failed example:
    test_random_chain_complex(level=2, trials=20)  # optional - CHomP
Expected nothing
Got:
    Random testing has revealed a problem in test_random_chain_complex
    Please report this bug!  You may be the first
    person in the world to have seen this problem.
    Please include this random seed in your bug report:
    Random seed: 130448957777511520486902617862493201212
    RuntimeError('error inside CHomP',)
**********************************************************************
File "src/sage/homology/tests.py", line 12, in sage.homology.tests
Failed example:
    test_random_chain_complex(level=3, trials=20)  # long time # optional - CHomP
Expected nothing
Got:
    Random testing has revealed a problem in test_random_chain_complex
    Please report this bug!  You may be the first
    person in the world to have seen this problem.
    Please include this random seed in your bug report:
    Random seed: 337572972161276702442755420588198438138
    RuntimeError('error inside CHomP',)
**********************************************************************
File "src/sage/homology/tests.py", line 72, in sage.homology.tests.test_random_chain_complex
Failed example:
    test_random_chain_complex(trials=2)  # optional - CHomP
Expected nothing
Got:
    Random testing has revealed a problem in test_random_chain_complex
    Please report this bug!  You may be the first
    person in the world to have seen this problem.
    Please include this random seed in your bug report:
    Random seed: 190504759948336957776305453124739057674
    RuntimeError('error inside CHomP',)
**********************************************************************
2 items had failures:
   3 of   9 in sage.homology.tests
   1 of   3 in sage.homology.tests.test_random_chain_complex
    [20 tests, 4 failures, 2.40 s]

We need to fix the failures in delta_complex.py. It would be nice to fix the ones in tests.py, but that could be done on another ticket. (This is on OS X, for what that's worth.)

comment:14 Changed 7 years ago by jhpalmieri

  • Status changed from needs_review to needs_work

comment:15 Changed 7 years ago by git

  • Commit changed from 5b75dfe33aa8ed5c723492ac6761422332da9560 to 9febd321d52405bee2ad201cba99edc504b737bb

Branch pushed to git repo; I updated commit sha1. New commits:

c6524f8Merge branch 'u/chapoton/12607' into 6.9.b0
9febd32trac #12607 one temporary fix in delta_complex

comment:16 Changed 7 years ago by jhpalmieri

  • Reviewers set to John Palmieri
  • Status changed from needs_work to positive_review

comment:17 Changed 7 years ago by jhpalmieri

Looks good, thank you.

comment:18 Changed 7 years ago by vbraun

  • Branch changed from u/chapoton/12607 to 9febd321d52405bee2ad201cba99edc504b737bb
  • Resolution set to fixed
  • Status changed from positive_review to closed
Note: See TracTickets for help on using tickets.