-
-
Notifications
You must be signed in to change notification settings - Fork 409
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
Should the gens
of a group, ring, or ideal always be a tuple?
#34120
Labels
Comments
This comment has been minimized.
This comment has been minimized.
comment:4
I think the infinite iterators in |
comment:5
Also all |
comment:6
And +1 on changing all lists to tuples. |
comment:7
partly handled in #34500 |
Branch: public/ticket-34120 |
comment:8
here is some partial work on the case of rings/ New commits:
|
Commit: |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Looking at all occurrences of
def gens
in the sagemath source code reveals that the output of thegens
method is a tuple in the vast majority of cases (including for the classParentWithGens
insrc/sage/structure/parent_gens.pyx
). In fact, the final line of the source code of the method is usuallyreturn tuple( <something> )
. However, the search uncovered several exceptions that return a list:FiniteGCAlgebra
insrc/sage/algebras/finite_gca.py
AbstractLinearCodeNoMetric
insrc/sage/coding/linear_code_no_metric.py
PermutationGroup_generic
insrc/sage/groups/perm_gps/permgroup.py
-- the docstring says the method will return a tuple, and that seems to usually be the case, butSymmetricGroup(1).gens()
is a list (and the same if1
is replaced with some other number). This is clearly a bug, because the output type does not match the documentation.SemimonomialTransformationGroup
insrc/sage/semimonomial_transformations/semimonomial_transformation_group.py
-- the docstring says that the method will return a tuple, so this is another clear bug.MagmaElement
insrc/sage/interfaces/magma.py
mwrank_EllipticCurve
insrc/sage/eclib/interface.py
FiniteSubgroup
insrc/sage/modular/abvar/finite_subgroup.py
ModularFormsSpace
insrc/sage/modular/modform/space.py
QuasiModularForms
,QuasiCuspForms
,ModularForms
,CuspForms
, andZeroForm
insrc/sage/modular/modform_hecketriangle/space.py
SubSpaceForms
insrc/sage/modular/modform_hecketriangle/subspace.py
PollackStevensModularDomain
insrc/sage/modular/pollack_stevens/fund_domain.py
QuasiModularForms
insrc/sage/modular/quasimodform/ring.py
QuiverHomSpace
insrc/sage/quivers/homspace.py
QuiverRep_generic
insrc/sage/quivers/representation.py
UnsignedInfinityRing_class
andInfinityRing_class
insrc/sage/rings/infinite.py
InfinityRing_class
insrc/sage/rings/padics/padic_generic.py
MPolynomialIdeal
insrc/sage/rings/polynomial/mult_polynomial_ideal.py
-- the value is of typePolynomialSequence
, which seems to be an immutable list. Single-variable polynomials return a tuple, and it would be good for the two to be consistent, even if we do not change the others in this list. This was pointed out in #34105 comment:4.SymmetricReductionStrategy
insrc/sage/rings/polynomial/symmetric_reduction.pyx
RealIntervalField_class
insrc/sage/rings/real_mpfi.pyx
RealField_class
insrc/sage/rings/real_mpfr.pyx
EllipticCurve_number_field
insrc/sage/schemes/elliptic_curves/ell_number_field.py
EllipticCurve_rational_field
insrc/sage/schemes/elliptic_curves/ell_rational_field.py
SpecialCubicQuotientRing
insrc/sage/schemes/hyperelliptic_curves/monsky_washnitzer.py
Perhaps most (or all) of the above should be changed to a tuple.
An iterator or
Family
is returned in the following cases, but that makes sense because the set of generators may be infinite:SteenrodAlgebra_generic
insrc/sage/algebras/steenrod/steenrod_algebra.py
HeckeAlgebra_base
andHeckeAlgebra_anemic
insrc/sage/modular/hecke/algebra.py
OverconvergentModularFormsSpace
insrc/sage/modular/overconvergent/genus0.py
AlgebraicClosureFiniteField_generic
insrc/sage/rings/algebraic_closure_finite_field.py
This ticket arose from #34105 comment:4, which pointed out that multivariate polynomials behave differently than single-variable polynomials.
Related ticket: #33824 (make gens and orbits of
PermutationGroup
immutable)CC: @yyyyx4
Component: algebra
Keywords: gens, tuple, list
Branch/Commit: public/ticket-34120 @
52a359b
Issue created by migration from https://trac.sagemath.org/ticket/34120
The text was updated successfully, but these errors were encountered: