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

Make DirichletGroup a new-style parent #18540

Closed
pjbruin opened this issue May 28, 2015 · 17 comments
Closed

Make DirichletGroup a new-style parent #18540

pjbruin opened this issue May 28, 2015 · 17 comments

Comments

@pjbruin
Copy link
Contributor

pjbruin commented May 28, 2015

The purpose of this ticket is to upgrade DirichletGroup from an old-style ParentWithMultiplicativeAbelianGens to a proper Parent.

At the same time, we place DirichletGroup in the category of Abelian groups.

Component: number theory

Keywords: Dirichlet group

Author: Peter Bruin

Branch/Commit: 3a2a89b

Reviewer: Jeroen Demeyer

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

@pjbruin pjbruin added this to the sage-6.8 milestone May 28, 2015
@pjbruin
Copy link
Contributor Author

pjbruin commented May 28, 2015

Commit: 5c32c32

@pjbruin
Copy link
Contributor Author

pjbruin commented May 28, 2015

Branch: u/pbruin/18540-DirichletGroup_Parent

@pjbruin
Copy link
Contributor Author

pjbruin commented May 29, 2015

Work Issues: unpickling of old instances

@sagetrac-git
Copy link
Mannequin

sagetrac-git mannequin commented May 29, 2015

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

1285b0eTrac 18540: implement `__setstate__` to fix unpickling of old instances

@sagetrac-git
Copy link
Mannequin

sagetrac-git mannequin commented May 29, 2015

Changed commit from 5c32c32 to 1285b0e

@pjbruin
Copy link
Contributor Author

pjbruin commented May 29, 2015

Changed work issues from unpickling of old instances to none

@tscrim
Copy link
Collaborator

tscrim commented May 30, 2015

comment:5

A couple of comments:

  • Is Groups().Commutative() the best category? The list function seems like they should be in finite groups and that they are is finitely generated. I would say the category should be Groups().Commutative().Finite().FinitelyGenerated() (or at least a join with EnumeratedSets).

  • While I doubt it was used, the __cmp__ did put a total ordering on the parents which I think we should keep by implementing a __lt__ (and using @total_ordering).

Looks good otherwise.

@sagetrac-git
Copy link
Mannequin

sagetrac-git mannequin commented Jun 1, 2015

Changed commit from 1285b0e to b92b5b0

@sagetrac-git
Copy link
Mannequin

sagetrac-git mannequin commented Jun 1, 2015

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

b92b5b0Trac 18540: refine category of Dirichlet group if possible

@pjbruin
Copy link
Contributor Author

pjbruin commented Jun 1, 2015

comment:7

Replying to @tscrim:

A couple of comments:

  • Is Groups().Commutative() the best category? The list function seems like they should be in finite groups and that they are is finitely generated. I would say the category should be Groups().Commutative().Finite().FinitelyGenerated() (or at least a join with EnumeratedSets).

Done, but only if we know that the group of n-th roots of unity in the base ring is finite. This is currently still the case for all Dirichlet groups that we can construct, but in the future we may admit base rings where this is not the case (the profinite completion of Z, for example).

  • While I doubt it was used, the __cmp__ did put a total ordering on the parents which I think we should keep by implementing a __lt__ (and using @total_ordering).

I don't like this very much. First, the previous implementation actually does not make sense since it depends on a total ordering of all rings. Second, I cannot imagine why one would like to totally order all Dirichlet groups over all rings.

@jdemeyer
Copy link

Reviewer: Jeroen Demeyer

@jdemeyer
Copy link

comment:8
  1. In the docstring of DirichletGroup_class, could you replace
Group of Dirichlet characters modulo `N` over a ring `R`.

by

Group of Dirichlet characters modulo `N` with values in a ring `R`.

(or something similar)

  1. In the check
if isinstance(x, (int, rings.Integer)) and x == 1:

I think it is better to remove isinstance(x, (int, rings.Integer)) and allow any kind of 1 (but then you will probably need to add a try/except in case that x == 1 fails).

@jdemeyer
Copy link

comment:9

I have no further comments. If you make the above changes and doctests still pass, you can set this to positive_review.

@jdemeyer
Copy link

comment:10

Additional remark: it would be good to fix these pyflakes warnings:

$ pyflakes src/sage/modular/dirichlet.py
src/sage/modular/dirichlet.py:550: 'latex' imported but unused
src/sage/modular/dirichlet.py:800: local variable 'R' is assigned to but never used
src/sage/modular/dirichlet.py:1691: local variable 'R' is assigned to but never used
src/sage/modular/dirichlet.py:2312: local variable 'n' is assigned to but never used
src/sage/modular/dirichlet.py:2314: local variable 'p' is assigned to but never used
src/sage/modular/dirichlet.py:2376: local variable 'one' is assigned to but never used
src/sage/modular/dirichlet.py:2377: local variable 'zeta' is assigned to but never used

@sagetrac-git
Copy link
Mannequin

sagetrac-git mannequin commented Jun 22, 2015

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

3a2a89bTrac 18540: reviewer comments

@sagetrac-git
Copy link
Mannequin

sagetrac-git mannequin commented Jun 22, 2015

Changed commit from b92b5b0 to 3a2a89b

@vbraun
Copy link
Member

vbraun commented Jun 22, 2015

Changed branch from u/pbruin/18540-DirichletGroup_Parent to 3a2a89b

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