sagemath / sage

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

more examples of simplicial complexes: RP^n, CP^2, etc. #9125

Closed jhpalmieri closed 13 years ago

jhpalmieri commented 14 years ago

This patch adds more examples of simplicial complexes: real projective spaces (that is, RPd for any positive d), CP2, and the Poincare homology sphere. Some of these are the minimal triangulations, some are not; see the documentation.

These are important test cases for homology and other computations which I hope will be implemented soon -- see tickets #6102 and #6103, for instance.

Apply:

trac_9125-projective-space.patch

trac_9125-cumulative-doctest.patch

Component: algebraic topology

Author: John Palmieri

Reviewer: Robert Goss, Marshall Hampton

Merged: sage-4.7.alpha4

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

jhpalmieri commented 14 years ago

Attachment: trac_9125-projective-space.patch.gz

16f2fe85-2f43-42c8-9822-3fece4b041d2 commented 13 years ago
comment:2

A very useful patch the documentation is very good.

The doc tests all run and the functionality seems correct.

I have been working on a function to generate simplicial complexes for the lens spaces. Although the implimentation is naive would it be something which would be useful to put in this patch?

Robert

jhpalmieri commented 13 years ago
comment:3

Replying to @sagetrac-robert-goss:

I have been working on a function to generate simplicial complexes for the lens spaces. Although the implimentation is naive would it be something which would be useful to put in this patch?

I think having lens spaces would be very nice, although maybe it could go on another ticket so that the current patch can get merged. If you post something, I'll almost certainly review it. A naive approach would be fine, but you might also look at some of the papers referenced in the current patch. In particular,

are both expository papers which might include some discussion of lens spaces, or might give references. (I think I've seen discussions of triangulations of lens spaces somewhere, but I don't remember where. You might also try searching the web.)

jdemeyer commented 13 years ago
comment:4

robert_goss: please add your real name to Account Names mapped to Real Names and also add it on this ticket as Reviewer.

16f2fe85-2f43-42c8-9822-3fece4b041d2 commented 13 years ago

Reviewer: Robert Goss

16f2fe85-2f43-42c8-9822-3fece4b041d2 commented 13 years ago
comment:5

Replying to @jdemeyer:

robert_goss: please add your real name to Account Names mapped to Real Names and also add it on this ticket as Reviewer.

Hi thank you jdemeyer this is my first time contributing directly to sage and I am not sure of all the procedures.

Is there anything else I should do?

jdemeyer commented 13 years ago

Merged: sage-4.6.1.alpha2

bac7d3ea-3f1b-4826-8464-f0b53d5e12d2 commented 13 years ago
comment:7

See the notes from François Bissey

https://groups.google.com/group/sage-devel/browse_thread/thread/9e4cef8c8558150?hl=en

that this may be the cause of some timeouts seen on sage-gentoo.

Dave

jdemeyer commented 13 years ago

Changed merged from sage-4.6.1.alpha2 to none

jdemeyer commented 13 years ago
comment:8

The tests take way too long time. This is on a 32-bit Linux Pentium 4 system:

sage: P5 = simplicial_complexes.RealProjectiveSpace(Integer(5))
sage: time P5.homology()
CPU times: user 4083.68 s, sys: 0.63 s, total: 4084.31 s
Wall time: 4084.50 s
{0: 0, 1: C2, 2: 0, 3: C2, 4: 0, 5: Z}
jdemeyer commented 13 years ago

Work Issues: reduce doctest time

jhpalmieri commented 13 years ago
comment:10

Apply this patch on top of the other one. This way the doctest will only run if you give it a command like sage -t -long -only-optional=chomp. Since the test finishes in about a second when using CHomP, as opposed to around half an hour (sometimes causing timeouts, since 1800 seconds is the cutoff for long doctests) without CHomP, this seems like the right solution.

jdemeyer commented 13 years ago
comment:11

On the same Pentium 4 system, the following test

sage:P4 = simplicial_complexes.RealProjectiveSpace(4)

takes almost 4 seconds, so that should also be # long time (and hence also the following tests involving P4).

jdemeyer commented 13 years ago

Changed work issues from reduce doctest time to none

jhpalmieri commented 13 years ago
comment:12

Replying to @jdemeyer:

On the same Pentium 4 system, the following test takes almost 4 seconds, so that should also be # long time (and hence also the following tests involving P4).

I'll do that, but are you using specific guidelines about what constitutes "long"? On a 2-year-old iMac, it takes about 10 seconds to doctest the whole file ("sage -t examples.py", not "sage -t -long"). That doesn't seem excessively long to me, especially since the machine isn't new, and it wasn't a top-of-the line machine even when it was new.

jdemeyer commented 13 years ago
comment:13

The guideline is that 1 second is the bound for # long time. In the Sage developer manual, there is the following example:

sage: E = EllipticCurve([0, 0, 1, -1, 0])
sage: E.regulator()              # long time (1 second)
0.0511114082399688
jhpalmieri commented 13 years ago

apply on top of other patch

jhpalmieri commented 13 years ago
comment:14

Attachment: trac_9125-doctest-fix.patch.gz

Can this get reviewed soon? The original patch was reviewed positively already, so I think only "trac_9125-doctest-fix.patch" needs to be reviewed. That one just marks some doctests as being "long time" or "optional - CHomP", so I think it should be easy to review.

5d2aaf09-c963-473a-bf79-1f742a72700f commented 13 years ago
comment:15

Looks like you missed one "long time" addition, so there is a doctest failure.

**********************************************************************
File "/Users/mh/sagestuff/sage-4.7.alpha2/devel/sage-t1/sage/homology/examples.py", line 518:
    sage: P4.dimension()
Exception raised:
    Traceback (most recent call last):
      File "/Users/mh/sagestuff/sage-4.7.alpha2/local/bin/ncadoctest.py", line 1231, in run_one_test
        self.run_one_example(test, example, filename, compileflags)
      File "/Users/mh/sagestuff/sage-4.7.alpha2/local/bin/sagedoctest.py", line 38, in run_one_example
        OrigDocTestRunner.run_one_example(self, test, example, filename, compileflags)
      File "/Users/mh/sagestuff/sage-4.7.alpha2/local/bin/ncadoctest.py", line 1172, in run_one_example
        compileflags, 1) in test.globs
      File "<doctest __main__.example_12[7]>", line 1, in <module>
        P4.dimension()###line 518:
    sage: P4.dimension()
    NameError: name 'P4' is not defined
**********************************************************************

I am attaching a cumulative patch that fixes that.

5d2aaf09-c963-473a-bf79-1f742a72700f commented 13 years ago

Use instead of previous doctest patch

5d2aaf09-c963-473a-bf79-1f742a72700f commented 13 years ago
comment:16

Attachment: trac_9125-cumulative-doctest.patch.gz

Oops, I forgot to fold so my patch is only cumulative with respect to trac_9125-doctest-fix.patch.

5d2aaf09-c963-473a-bf79-1f742a72700f commented 13 years ago
comment:17

Looks good, passes all tests in sage/homology without chomp and everything passes -long -optional with chomp installed.

John, I think this can have a positive review but you should just double-check my patch. (Its a tiny change.) If its OK then you can change to positive review.

5d2aaf09-c963-473a-bf79-1f742a72700f commented 13 years ago

Description changed:

--- 
+++ 
@@ -1,3 +1,7 @@
 This patch adds more examples of simplicial complexes: real projective spaces (that is, RP<sup>d</sup> for any positive d), CP<sup>2</sup>, and the Poincare homology sphere.  Some of these are the minimal triangulations, some are not; see the documentation.

 These are important test cases for homology and other computations which I hope will be implemented soon -- see tickets #6102 and #6103, for instance.
+
+Apply:
+trac_9125-projective-space.patch
+trac_9125-cumulative-doctest.patch
5d2aaf09-c963-473a-bf79-1f742a72700f commented 13 years ago

Description changed:

--- 
+++ 
@@ -3,5 +3,7 @@
 These are important test cases for homology and other computations which I hope will be implemented soon -- see tickets #6102 and #6103, for instance.

 Apply:
+
 trac_9125-projective-space.patch
+
 trac_9125-cumulative-doctest.patch
jhpalmieri commented 13 years ago
comment:20

Thanks, Marshall, looks good. Tests failed with just my two patches, but they pass with yours.

jhpalmieri commented 13 years ago

Changed reviewer from Robert Goss to Robert Goss, Marshall Hampton

jdemeyer commented 13 years ago

Merged: sage-4.7.alpha4