Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fan isomorphism check #13189

Closed
vbraun opened this issue Jun 30, 2012 · 24 comments
Closed

fan isomorphism check #13189

vbraun opened this issue Jun 30, 2012 · 24 comments

Comments

@vbraun
Copy link
Member

vbraun commented Jun 30, 2012

This patch implements testing for isomorphism (equivalence up to GL(n,ZZ) rotation) of fans

  sage: m1 = matrix([(1, 0), (0, -5), (-3, 4)])
  sage: m2 = matrix([(3, 0), (1, 0), (-2, 1)])
  sage: m1.elementary_divisors() == m2.elementary_divisors() == [1,1,0]
  True
  sage: fan1 = Fan([Cone([m1*vector([23, 14]), m1*vector([   3,100])]), 
  ...               Cone([m1*vector([-1,-14]), m1*vector([-100, -5])])])
  sage: fan2 = Fan([Cone([m2*vector([23, 14]), m2*vector([   3,100])]), 
  ...               Cone([m2*vector([-1,-14]), m2*vector([-100, -5])])])
  sage: fan1.is_isomorphic(fan2)
  True
  sage: fan1.isomorphism(fan2)
  Fan morphism defined by the matrix
  [18  1 -5]
  [ 4  0 -1]
  [ 5  0 -1]
  Domain fan: Rational polyhedral fan in 3-d lattice N
  Codomain fan: Rational polyhedral fan in 3-d lattice N

This is implemented by first computing the isomorphisms of auxiliary labelled graphs, and then trying to lift those to actual fan morphisms.

Apply:

Depends on #12544

CC: @novoselt

Component: algebraic geometry

Keywords: toric

Author: Volker Braun

Reviewer: Andrey Novoseltsev

Merged: sage-5.3.beta2

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

@vbraun

This comment has been minimized.

@vbraun
Copy link
Member Author

vbraun commented Jun 30, 2012

Attachment: trac_13189_Hirzebruch_Jung_continued_fraction.patch.gz

Updated patch

@vbraun
Copy link
Member Author

vbraun commented Jun 30, 2012

Updated patch

@vbraun

This comment has been minimized.

@vbraun
Copy link
Member Author

vbraun commented Jun 30, 2012

comment:2

Attachment: trac_13189_virtual_rays.patch.gz

@vbraun
Copy link
Member Author

vbraun commented Jul 2, 2012

Updated patch

@vbraun
Copy link
Member Author

vbraun commented Jul 2, 2012

comment:3

Attachment: trac_13189_fan_isomorphism.patch.gz

Computing the graph automorphism group goes through GAP, which is slow. The updated patch uses a special version of the isomorphism check for 2-d fans which avoids this.

@novoselt
Copy link
Member

novoselt commented Jul 3, 2012

comment:4

I thought Robert Miller wrote a very fast graph automorphism group code for Sage - am I confusing it with something else?

@vbraun
Copy link
Member Author

vbraun commented Jul 3, 2012

comment:5

There is very nice code to compute one particular graph isomorphism, but I want to iterate over all graph isomorphisms. I'm doing this by combining the chose iso with the automorphisms of one of the graphs. But enumerating the automorphism group is using GAP, presumably you can gain more through group theory than what you can gain by making the graph theory fast.

@novoselt
Copy link
Member

Reviewer: Andrey Novoseltsev

@novoselt
Copy link
Member

Dependencies: #12544

@novoselt
Copy link
Member

comment:7

Glanced through, spotted a few typos that I'll fix in the reviewer patch.

What do you mean by the following change of output description??

By default, ``True`` if ``self`` and ``other`` are in the same
`GL(n, \ZZ)`-orbit, ``False`` otherwise.

Do you mind if I also switch computation of the virtual rays to the fan constructor and allow user to specify them? It is convenient e.g. when considering an affine toric variety corresponding to a face of another cone, or a subfanfan with similar structure. Then coordinates on the smaller variety can match the bigger ones.

@novoselt
Copy link
Member

comment:8

Got one error testing cone.py:

    Traceback (most recent call last):
      File "/home/novoselt/sage-5.2.beta0/local/bin/ncadoctest.py", line 1231, in run_one_test
        self.run_one_example(test, example, filename, compileflags)
      File "/home/novoselt/sage-5.2.beta0/local/bin/sagedoctest.py", line 38, in run_one_example
        OrigDocTestRunner.run_one_example(self, test, example, filename, compileflags)
      File "/home/novoselt/sage-5.2.beta0/local/bin/ncadoctest.py", line 1172, in run_one_example
        compileflags, 1) in test.globs
      File "<doctest __main__.example_26[13]>", line 9, in <module>
        frac = Hirzebruch_Jung_continued_fraction_list(k/d)
      File "/home/novoselt/sage-5.2.beta0/local/lib/python/site-packages/sage/rings/arith.py", line 4193, in Hirzebruch_Jung_continued_fraction_list
        if not sage.rings.rational.is_Rational(x):
    AttributeError: 'module' object has no attribute 'is_Rational'

The new module also has to be included into documentation, I think. Is there actually a particular reason why it is not just in fan.py?

@vbraun
Copy link
Member Author

vbraun commented Jul 12, 2012

comment:9

Replying to @novoselt:

What do you mean by the following change of output description??

By default, ``True`` if ``self`` and ``other`` are in the same
`GL(n, \ZZ)`-orbit, ``False`` otherwise.

I'm trying to say that it returns whether the two fans are equivalent up to a GL(n,ZZ) basis change. Apparently not comprehensible enough ;-)

Do you mind if I also switch computation of the virtual rays to the fan constructor and allow user to specify them?

If you want to implement that, go for it.

@vbraun
Copy link
Member Author

vbraun commented Jul 12, 2012

comment:10

Replying to @novoselt:

The new module also has to be included into documentation, I think. Is there actually a particular reason why it is not just in fan.py?

The fan_isomorphism.py file is just a way to prevent fan.py from getting too large. The relevant user-visible documentation is in fan.py, so I don't think we should include fan_isomorphism.py in the developer guide.

@novoselt

This comment has been minimized.

@novoselt
Copy link
Member

comment:11

Tests pass now. The first patch is OK modulo changes, going through others...

@novoselt
Copy link
Member

novoselt commented Aug 1, 2012

Attachment: trac_13189_reviewer.patch.gz

@novoselt
Copy link
Member

novoselt commented Aug 1, 2012

comment:12

OK, positive review to Volker's patches modulo reviewer's one, which needs review now.

Changes:

  • move virtual_rays method to fans only and allow specifying them during fan construction;
  • allow addition of point collections, which results in some simplification of code and examples;
  • a bunch of clarification/typo fixes in the documentation.

Also, am I right that with automatically chosen virtual rays the choice cannot affect the isomorphism of cones?

@novoselt
Copy link
Member

novoselt commented Aug 1, 2012

Changed keywords from none to toric

@novoselt
Copy link
Member

novoselt commented Aug 1, 2012

comment:13

For the record: I have removed trailing whitespaces on new lines in the reviewer patch, so I don't think that patchbot should complain. As far as I know, ticket numbers are automatically added, so it should not complain either. And all tests pass, patchbot errors are not related.

@vbraun
Copy link
Member Author

vbraun commented Aug 4, 2012

Added commit message

@vbraun
Copy link
Member Author

vbraun commented Aug 4, 2012

comment:14

Attachment: trac_13189_cone_isomorphism.patch.gz

I forgot the commit message in trac_13189_cone_isomorphism.patch, no actual code changes.

The reviewer patch looks good to me.

The virtual ray choice doesn't change whether or not there is a isomorphism of two cones / two fans (barring any bugs), but the matrix entries of the lattice map of course differ.

@jdemeyer
Copy link

Merged: sage-5.3.beta2

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants