Opened 8 years ago

Closed 6 years ago

#14684 closed defect (fixed)

Convert between free group elements considering generator names.

Reported by: mmarco Owned by: mmarco
Priority: major Milestone: sage-6.4
Component: group theory Keywords: free groups
Cc: vbraun, sydahmad, vdelecroix, jhpalmieri, tjolivet, rbeezer, dimpase, dshurbert Merged in:
Authors: Miguel Marco Reviewers: Vincent Delecroix
Report Upstream: N/A Work issues:
Branch: 4a479ed (Commits) Commit: 4a479edb0db34d4d9d956dd2a1c306d93a00c7e1
Dependencies: Stopgaps:

Description

Right now, when we try to convert elements between free groups, they just get converted to the Tietze list, forgeting about the names of the generators. This can cause strange behaviour like:

sage: F.<a,b>=FreeGroup()
sage: G.<b,a>=FreeGroup()
sage: F(a) 
b

This patch solves this, looking for generators with matching names.

Attachments (1)

14684_free_group_conversion.patch (1.4 KB) - added by mmarco 8 years ago.

Download all attachments as: .zip

Change History (21)

Changed 8 years ago by mmarco

comment:1 Changed 8 years ago by mmarco

  • Status changed from new to needs_review

comment:2 Changed 8 years ago by mmarco

  • Cc vbraun sydahmad vdelecroix jhpalmieri tjolivet rbeezer dimpase dshurbert added

comment:3 Changed 8 years ago by mmarco

  • Owner changed from joyner to mmarco

comment:4 Changed 8 years ago by mmarco

  • Priority changed from minor to major

comment:5 Changed 7 years ago by jdemeyer

  • Milestone changed from sage-5.11 to sage-5.12

comment:6 Changed 7 years ago by vbraun_spam

  • Milestone changed from sage-6.1 to sage-6.2

comment:7 Changed 7 years ago by vbraun_spam

  • Milestone changed from sage-6.2 to sage-6.3

comment:8 Changed 6 years ago by vbraun_spam

  • Milestone changed from sage-6.3 to sage-6.4

comment:9 Changed 6 years ago by vdelecroix

  • Branch set to public/14684
  • Commit set to b2d253d9feeab81f73eaab3e484c6acbe7d34144
  • Status changed from needs_review to needs_info

Hello,

I created a branch from the ticket with sage -dev. The review can starts from there.

What's the point of the following code in _element_constructor_?

if hasattr(P, '_freegroup_'):
    if P.FreeGroup() is self:
        return self.element_class(self, x.Tietze(), **kwds)

As far as I looked, there is no object in Sage with a _freegroup_ attribute.

Vincent


New commits:

b2d253dTrac #14684: make conversion between free groups aware of generator names

comment:10 Changed 6 years ago by mmarco

It is an error. It should be _free_group (finitely presented groups have that attribute, that contains the free group after which they are defined).

Apparently it works even without that because the element_class init first tries to get the Tietze list anyways.

comment:11 Changed 6 years ago by vdelecroix

So please, fix that!

comment:12 Changed 6 years ago by vdelecroix

  • Status changed from needs_info to needs_work

comment:13 Changed 6 years ago by mmarco

  • Branch changed from public/14684 to u/mmarco/ticket/14684
  • Created changed from 06/04/13 01:11:06 to 06/04/13 01:11:06
  • Modified changed from 08/25/14 14:44:52 to 08/25/14 14:44:52

comment:14 Changed 6 years ago by mmarco

  • Branch changed from u/mmarco/ticket/14684 to public/14684

Fixed.

comment:15 Changed 6 years ago by vdelecroix

  • Branch changed from public/14684 to u/mmarco/ticket/14684
  • Commit changed from b2d253d9feeab81f73eaab3e484c6acbe7d34144 to 4a479edb0db34d4d9d956dd2a1c306d93a00c7e1
  • Status changed from needs_work to needs_review

Thanks. If it is, your commit should appear on this page... and it does not. I only see your commit at u/mmarco/ticket/14684 (public/14684 is one commit back). I switch back to the name of the branch that you used. If you want to commit to a specific branch use git push trac HEAD:public/14684.

Vincent


New commits:

4a479edRemved unnecessary check for _freegroup_

comment:16 Changed 6 years ago by vdelecroix

  • Reviewers set to Vincent Delecroix
  • Status changed from needs_review to positive_review

Perfect!

Vincent

comment:17 Changed 6 years ago by vbraun

  • Status changed from positive_review to needs_work

Author name should be real name, not trac username

comment:18 Changed 6 years ago by mmarco

  • Authors changed from mmarco to Miguel Marco

Sorry, i always forget those details.

comment:19 Changed 6 years ago by vbraun

  • Status changed from needs_work to positive_review

comment:20 Changed 6 years ago by vbraun

  • Branch changed from u/mmarco/ticket/14684 to 4a479edb0db34d4d9d956dd2a1c306d93a00c7e1
  • Resolution set to fixed
  • Status changed from positive_review to closed
Note: See TracTickets for help on using tickets.