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

Have GroupAlgebra(Q, R) and G.algebra(R) return the same standard class for group algebras #18700

Closed
tscrim opened this issue Jun 14, 2015 · 101 comments

Comments

@tscrim
Copy link
Collaborator

tscrim commented Jun 14, 2015

Consider the following situation:

sage: P = RootSystem(['A',2,1]).weight_lattice()
sage: W = RootSystem(['A',2,1]).weight_space()
sage: W.has_coerce_map_from(P)
True
sage: PA = P.algebra(QQ)
sage: WA = W.algebra(QQ)
sage: WA.has_coerce_map_from(PA)
False

The last line should be True. This comes from the fact that GroupAlgebra implements some extra coercion logic and G.algebra(R) does not return an instance of this class.

To remedy this, we lift a good portion of the GroupAlgebra code to the appropriate categories, where we impose the restriction that a (Semi)Group.Algebra must have a basis indexed by elements of the (semi)group, and have all group algebras redirect to the now (lightweight) class GroupAlgebra_class in order to implement coercions.

Depends on #23000
Depends on #23211

CC: @sagetrac-sage-combinat @anneschilling @nthiery @bsalisbury1 @fchapoton

Component: coercion

Keywords: group algebras

Author: Travis Scrimshaw, Nicolas M. Thiéry

Branch/Commit: 3160e26

Reviewer: Ben Salisbury

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

@tscrim
Copy link
Collaborator Author

tscrim commented Jun 14, 2015

comment:1

Actually, GroupAlgebra already has this behavior. However algebra() does not return the group algebra by default. I think we need 2 changes:

1 - algebra() checks if self is a group (it already checks for inclusion in finite groups).
2 - We need a subclass of CombinatorialFreeModule which inherits the coercions in general, say a SemigroupAlgebra.

I think both changes are relatively easy since for the second we can canabalize a good part of the GroupAlgebra code. However if 2 is contraversal/harder-than-I-thought, then we should just do 1 here as we need this for #18453 and do a followup for 2.

@tscrim
Copy link
Collaborator Author

tscrim commented Jun 14, 2015

comment:2

Also as a little side bug:

sage: P.algebra(QQ)
Group algebra of the Weight lattice of the Root system of type ['A', 2, 1] over Rational Field
sage: _.category()
Category of root lattice realizations over Integer Rin algebras over Rational Field

Notice the missing g, same thing for W (except there it's ...Fiel algebras over...).

@tscrim
Copy link
Collaborator Author

tscrim commented May 1, 2017

comment:3

This goes through and redirects group algebra construction through GroupAlgebra, as well as cleans up how the categories are constructed.


New commits:

5e94208Standardizing group algebras through GroupAlgebra.

@tscrim
Copy link
Collaborator Author

tscrim commented May 1, 2017

Commit: 5e94208

@tscrim
Copy link
Collaborator Author

tscrim commented May 1, 2017

@tscrim tscrim modified the milestones: sage-6.8, sage-8.0 May 1, 2017
@bsalisbury1
Copy link
Contributor

comment:4

Hi Travis,

There are doctest failures in a lot of difference places. For example:

----------------------------------------------------------------------
sage -t --long src/sage/combinat/root_system/non_symmetric_macdonald_polynomials.py  # 94 doctests failed
sage -t --long src/sage/plot/plot.py  # 1 doctest failed
sage -t --long src/sage/plot/graphics.py  # 2 doctests failed
sage -t --long src/sage/misc/sagedoc.py  # 3 doctests failed
sage -t --long src/sage/combinat/crystals/littelmann_path.py  # 6 doctests failed
sage -t --long src/sage/combinat/rigged_configurations/rigged_configurations.py  # 13 doctests failed
sage -t --long src/sage/combinat/root_system/root_lattice_realization_algebras.py  # 89 doctests failed
sage -t --long src/sage/combinat/posets/posets.py  # 1 doctest failed
sage -t --long src/sage/combinat/root_system/hecke_algebra_representation.py  # 33 doctests failed
sage -t --long src/sage/categories/finite_dimensional_algebras_with_basis.py  # 2 doctests failed
sage -t --long src/sage/combinat/crystals/tensor_product.py  # 5 doctests failed
sage -t --long src/sage/repl/rich_output/pretty_print.py  # 1 doctest failed
sage -t --long src/doc/en/thematic_tutorials/lie/affine_finite_crystals.rst  # 1 doctest failed
sage -t --long src/sage/modules/with_basis/representation.py  # 13 doctests failed
sage -t --long src/sage/categories/sets_cat.py  # 4 doctests failed
sage -t --long src/sage/algebras/lie_algebras/lie_algebra.py  # 2 doctests failed
sage -t --long src/sage/categories/semisimple_algebras.py  # 1 doctest failed
----------------------------------------------------------------------

So many, in fact, that I'm wondering if I did something wrong! Did you get this same failures before you pushed the latest merge to the branch?

@tscrim
Copy link
Collaborator Author

tscrim commented May 4, 2017

comment:5

Those are probably trivial doctest failures because of the change in the how the group algebra elements are printed and I didn't test as well as I thought. I will fix them shortly.

@sagetrac-git
Copy link
Mannequin

sagetrac-git mannequin commented May 4, 2017

Changed commit from 5e94208 to 39800cc

@sagetrac-git
Copy link
Mannequin

sagetrac-git mannequin commented May 4, 2017

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

39800ccFixing doctests and some conversion behavior changes.

@tscrim
Copy link
Collaborator Author

tscrim commented May 4, 2017

comment:7

This should fix all of the doctest failures that were introduced on this ticket. I did a little bit of a hack for algebras of a module with a basis to wrap them as B[x + y]. Some of the other doctest failures I get on develop (in particular, the failure in posets.py) or cannot reproduce (e.g., the ones in plot).

@tscrim tscrim changed the title Group algebras should have a coercion inherited from coercions of the underlying groups Use GroupAlgebra as the standard class for group algebras May 4, 2017
@bsalisbury1
Copy link
Contributor

comment:8

Still getting a doctest failure...

sage -t src/sage/algebras/group_algebra.py
**********************************************************************
File "src/sage/algebras/group_algebra.py", line 696, in sage.algebras.group_algebra.GroupAlgebra._element_constructor_
Failed example:
    OG(2)
Exception raised:
    Traceback (most recent call last):
      File "/Users/Ben/sage-git/local/lib/python2.7/site-packages/sage/doctest/forker.py", line 509, in _run
        self.compile_and_execute(example, compiler, test.globs)
      File "/Users/Ben/sage-git/local/lib/python2.7/site-packages/sage/doctest/forker.py", line 872, in compile_and_execute
        exec(compiled, globs)
      File "<doctest sage.algebras.group_algebra.GroupAlgebra._element_constructor_[11]>", line 1, in <module>
        OG(Integer(2))
      File "sage/structure/parent.pyx", line 941, in sage.structure.parent.Parent.__call__ (/Users/Ben/sage-git/src/build/cythonized/sage/structure/parent.c:9839)
        return mor._call_(x)
      File "sage/structure/coerce_maps.pyx", line 110, in sage.structure.coerce_maps.DefaultConvertMap_unique._call_ (/Users/Ben/sage-git/src/build/cythonized/sage/structure/coerce_maps.c:4895)
        raise
      File "sage/structure/coerce_maps.pyx", line 105, in sage.structure.coerce_maps.DefaultConvertMap_unique._call_ (/Users/Ben/sage-git/src/build/cythonized/sage/structure/coerce_maps.c:4762)
        return C._element_constructor(x)
      File "/Users/Ben/sage-git/local/lib/python2.7/site-packages/sage/algebras/group_algebra.py", line 720, in _element_constructor_
        raise TypeError("do not know how to make x (= %s) an element of %s"%(x, self))
    TypeError: do not know how to make x (= 2) an element of Group algebra of General Linear Group of degree 2 over Finite Field of size 7 over Order in Number Field in sqrt5 with defining polynomial x^2 - 5
**********************************************************************
1 item had failures:
   1 of  16 in sage.algebras.group_algebra.GroupAlgebra._element_constructor_
    [132 tests, 1 failure, 6.13 s]

@sagetrac-git
Copy link
Mannequin

sagetrac-git mannequin commented May 4, 2017

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

2ef2208We have a unit, so we can use that in coercion.

@sagetrac-git
Copy link
Mannequin

sagetrac-git mannequin commented May 4, 2017

Changed commit from 39800cc to 2ef2208

@tscrim
Copy link
Collaborator Author

tscrim commented May 4, 2017

comment:10

This was me being stupid. Fixed.

@bsalisbury1
Copy link
Contributor

comment:11

All tests passed on my machine, the html doc builds, and so does the pdf doc. Moreover:

sage: P = RootSystem(['A',2,1]).weight_lattice()
sage: W = RootSystem(['A',2,1]).weight_space()
sage: W.has_coerce_map_from(P)
True
sage: PA = P.algebra(QQ)
sage: WA = W.algebra(QQ)
sage: WA.has_coerce_map_from(PA)
True

@bsalisbury1
Copy link
Contributor

Reviewer: Ben Salisbury

@nthiery
Copy link
Contributor

nthiery commented May 5, 2017

comment:12

Hi,

Sorry for the interuption; I'd like to have a look at this one. If you don't hear from me in the next day, please set it back to positive review.

@tscrim
Copy link
Collaborator Author

tscrim commented Jun 17, 2017

comment:70

This fixes the docbuild issues for me (plus a few other misc doc issues I noticed while trying to fix it).

@bsalisbury1
Copy link
Contributor

comment:71

Looks good now. Thanks!

@tscrim
Copy link
Collaborator Author

tscrim commented Jun 21, 2017

Changed author from TravisScrimshaw, Nicolas M. Thiéry to Travis Scrimshaw, Nicolas M. Thiéry

@vbraun
Copy link
Member

vbraun commented Jun 21, 2017

comment:73

Search for algerbas in the patch, obvious typo. There should be a test that catches that

sage -t --long --warn-long 67.9 src/sage/algebras/group_algebra.py
**********************************************************************
File "src/sage/algebras/group_algebra.py", line 138, in sage.algebras.group_algebra.GroupAlgebra_class._coerce_map_from_
Failed example:
    ZG.coerce_map_from(H)
Expected:
    Conversion map:
      From: Cyclic group of order 3 as a permutation group
      To:   Algebra of Dihedral group of order 6 as a permutation group over Integer Ring
Got:
    Coercion map:
      From: Cyclic group of order 3 as a permutation group
      To:   Algebra of Dihedral group of order 6 as a permutation group over Integer Ring

@sagetrac-git
Copy link
Mannequin

sagetrac-git mannequin commented Jun 21, 2017

Changed commit from c2e1c05 to a93b1e9

@sagetrac-git
Copy link
Mannequin

sagetrac-git mannequin commented Jun 21, 2017

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

6be53f3Move _is_coercion from DefaultConvertMap to Map and make it accurate
7dac7e2Fix doctest
9a9e437Print default "coerce" maps as "Coercion"
d8eec2dFixed doctests
2fa81a7Fix doctests to print exactly as they show up on screen
b483c8eMerge branch 'develop' into t/23211/mark_morphisms_as_coercions
78807fafix doctest errors
8c67163Merge branch 'u/saraedum/mark_morphisms_as_coercions' of git://trac.sagemath.org/sage into public/groups/standardize_group_algebras-18700
a93b1e9Fixing typo and rebasing over #23211.

@tscrim
Copy link
Collaborator Author

tscrim commented Jun 21, 2017

Changed dependencies from #23000 to #23000 #23211

@tscrim
Copy link
Collaborator Author

tscrim commented Jun 21, 2017

comment:76

I've fixed the typo, but we don't explicitly test register_unpickle_override anywhere else. The failure is from #23211, but it is good to know that we have a non-trivial rebase before the next beta round.

@tscrim
Copy link
Collaborator Author

tscrim commented Jun 23, 2017

comment:77

Perhaps we could sneak this into 8.0? This simplifies a lot of things when working with group algebras.

@sagetrac-git
Copy link
Mannequin

sagetrac-git mannequin commented Jun 24, 2017

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

70c7280Merge branch 'develop' into public/groups/standardize_group_algebras-18700
e613a51Merge branch 'public/groups/standardize_group_algebras-18700' of git://trac.sagemath.org/sage into public/groups/standardize_group_algebras-18700
a18c48cAdding test for old pickle.

@sagetrac-git
Copy link
Mannequin

sagetrac-git mannequin commented Jun 24, 2017

Changed commit from a93b1e9 to a18c48c

@sagetrac-git
Copy link
Mannequin

sagetrac-git mannequin commented Jun 24, 2017

Changed commit from a18c48c to 3160e26

@sagetrac-git
Copy link
Mannequin

sagetrac-git mannequin commented Jun 24, 2017

Branch pushed to git repo; I updated commit sha1. This was a forced push. New commits:

3160e26Adding test for old pickle.

@tscrim
Copy link
Collaborator Author

tscrim commented Jun 24, 2017

comment:80

I've added a test with an old pickle to make sure it works.

@nthiery
Copy link
Contributor

nthiery commented Jun 25, 2017

comment:82

Hi!

Could you update the title and summary to briefly describe what was actually implemented in this ticket?

Thanks,
Nicolas

@tscrim

This comment has been minimized.

@tscrim tscrim changed the title Use GroupAlgebra as the standard class for group algebras Have GroupAlgebra(Q, R) and G.algebra(R) return the same standard class for group algebras Jun 25, 2017
@vbraun
Copy link
Member

vbraun commented Jun 25, 2017

Changed branch from public/groups/standardize_group_algebras-18700 to 3160e26

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

5 participants