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

Class Function Partitions #30897

Open
tekaysquared mannequin opened this issue Nov 11, 2020 · 22 comments
Open

Class Function Partitions #30897

tekaysquared mannequin opened this issue Nov 11, 2020 · 22 comments

Comments

@tekaysquared
Copy link
Mannequin

tekaysquared mannequin commented Nov 11, 2020

The current output of SymmetricGroup(n).irreducible_characters() is a list of ClassFunction_libgap objects. It would be nice to take one of those class functions and instead of passing in a SymmetricGroup element, pass in a Partition of n since those represent the conjugacy classes.

This could be done by checking if the input to ClassFunction_libgap objects are Partitions, and if so using the default_representative of the partition.

CC: @slel

Component: group theory

Keywords: partition, symmetric group, character

Author: Trevor K. Karn

Branch/Commit: u/tkarn/class_funcion_partitions @ 0493345

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

@tekaysquared tekaysquared mannequin added this to the sage-9.3 milestone Nov 11, 2020
@tekaysquared
Copy link
Mannequin Author

tekaysquared mannequin commented Nov 11, 2020

Changed keywords from partition, symmetric group, charachter to partition, symmetric group, character

@trevorkarn
Copy link
Contributor

@trevorkarn
Copy link
Contributor

Changed branch from u/tkarn/partn-class-fn-libgap to none

@trevorkarn trevorkarn self-assigned this Nov 12, 2020
@trevorkarn
Copy link
Contributor

New commits:

3894d03Add ability of class function to take in a partition when G is the symmetric group
71d19b2Merge branch 'develop' into partition-libgap-class-fcn
05bb0a7Re order import statements so they make sense

@trevorkarn
Copy link
Contributor

Branch: u/tkarn/class_funcion_partitions

@trevorkarn
Copy link
Contributor

Commit: 05bb0a7

@slel

This comment has been minimized.

@embray
Copy link
Contributor

embray commented Feb 16, 2021

comment:8

Thanks for the patch. Hopefully someone with the necessary subject-matter background will be along to review it soon.

@darijgr
Copy link
Contributor

darijgr commented Feb 17, 2021

comment:9

Please fix the spacing in the doctest:

+            sage: h.cycle_type()
+            [2,1]
+			sage: triv(h.cycle_type())
+			1

It looks like a space/tab mismatch that might be invisible in your editor.

@darijgr
Copy link
Contributor

darijgr commented Feb 17, 2021

comment:10

Also, please check the empty partition [] and [3] too, just in case (ducktyping can often be fickle around such cases).

If this works: LGTM!

@darijgr
Copy link
Contributor

darijgr commented Feb 17, 2021

comment:11

Oh, and one more thing: I'm not sure any more, but there might be different implementations of symmetric groups in Sage. Does your code work with all of them? I think Permutations(n) is one thing worth trying, as is the Coxeter group of type A (don't remember how it is created).

EDIT: Not saying that it should work with all of them; probably best to document rather than fix.

@sagetrac-git
Copy link
Mannequin

sagetrac-git mannequin commented Feb 22, 2021

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

0a7675dMerge branch 'develop' into partitions
0745497Fix whitespace errors, add tests, and add assertion on size of group/size of partition. Also include disclaimer about CoxeterMatrixGroups and Permutations.

@sagetrac-git
Copy link
Mannequin

sagetrac-git mannequin commented Feb 22, 2021

Changed commit from 05bb0a7 to 0745497

@trevorkarn
Copy link
Contributor

comment:13

It turns out that the CoxeterMatrixGroup and Permutations classes don't have .irreducible_characters() method. It might be good to implement it eventually, but for now I just want to start by supporting the SymmetricGroup class.

@tscrim
Copy link
Collaborator

tscrim commented Mar 11, 2021

comment:14

Welcome to Sage development. So I have a few other additional comments for you to address:

  • Add your (real) name to the author field.

  • Instead of using an assert statement to check for valid input, you should instead raise a ValueError (or more generally whichever type of error is appropriate). This is a general convention we have taken across Sage (there is still some legacy code that does not do this).

  • I think the error message would be better as f"the size of the partition {g.size()} must equal {len(self._group.domain())}" as it is more concise and direct about what is needed.

  • It would be better to move the if isinstance(self._group, SymmetricGroup): first. This makes the code more clean and slightly faster for other groups.

  • These changes:

                 sage: chi([2,1])
    -            <BLANKLINE>
                 Traceback (most recent call last):
    -                ...
    +            ...
                 TypeError: Cyclic group of order 3 as a permutation group is not a SymmetricGroup. Give an element of Cyclic group of order 3 as a permutation group.

@trevorkarn
Copy link
Contributor

Author: Trevor K. Karn

@sagetrac-git
Copy link
Mannequin

sagetrac-git mannequin commented Mar 12, 2021

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

02cb2a2Change assertion to ValueError
e3f9cc2Reorder check for self._group being symmetric group. Change message on TypeError. Remove blankline so error tests pass.

@sagetrac-git
Copy link
Mannequin

sagetrac-git mannequin commented Mar 12, 2021

Changed commit from 0745497 to e3f9cc2

@sagetrac-git
Copy link
Mannequin

sagetrac-git mannequin commented Mar 14, 2021

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

0493345Reorder check for self._group being symmetric group. Change message on TypeError. Remove blankline so error tests pass.

@sagetrac-git
Copy link
Mannequin

sagetrac-git mannequin commented Mar 14, 2021

Changed commit from e3f9cc2 to 0493345

@mkoeppe
Copy link
Member

mkoeppe commented Mar 24, 2021

comment:18

Sage development has entered the release candidate phase for 9.3. Setting a new milestone for this ticket based on a cursory review of ticket status, priority, and last modification date.

@mkoeppe mkoeppe modified the milestones: sage-9.3, sage-9.4 Mar 24, 2021
@mkoeppe
Copy link
Member

mkoeppe commented Jul 19, 2021

comment:20

Setting a new milestone for this ticket based on a cursory review.

@mkoeppe mkoeppe modified the milestones: sage-9.4, sage-9.5 Jul 19, 2021
@mkoeppe mkoeppe modified the milestones: sage-9.5, sage-9.6 Dec 18, 2021
@mkoeppe mkoeppe modified the milestones: sage-9.6, sage-9.7 Apr 2, 2022
@mkoeppe mkoeppe modified the milestones: sage-9.7, sage-9.8 Sep 19, 2022
@mkoeppe mkoeppe removed this from the sage-9.8 milestone Jan 29, 2023
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

6 participants