sagemath / sage

Main repository of SageMath
https://www.sagemath.org
Other
1.44k stars 481 forks source link

asymptotic rings involving monomial non-growth groups #32452

Open mezzarobba opened 3 years ago

mezzarobba commented 3 years ago

Trying to create an asymptotic ring involving a monomial non-growth group fails with:

sage: AsymptoticRing('n^(RBF*I)', ZZ)
AttributeError: 'ImaginaryGroup_with_category' object has no attribute 'one'

Adding

    def gens_monomial(self):
        return tuple()

to MonomialNonGrowthGroup seems to be enough to make it work, but I am not sure at all if it is correct.

CC: @cheuberg @behackl @dkrenn

Component: asymptotic expansions

Author: Marc Mezzarobba

Branch/Commit: u/mmezzarobba/32452-asy-monomial_non_growth @ 0b439d2

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

mezzarobba commented 3 years ago

Commit: 0b439d2

mezzarobba commented 3 years ago

New commits:

0b439d2Asy: fix(?) support for monomial non-growth groups
mezzarobba commented 3 years ago

Branch: u/mmezzarobba/32452-asy-monomial_non_growth

mezzarobba commented 3 years ago

Author: Marc Mezzarobba

mezzarobba commented 3 years ago

Description changed:

--- 
+++ 
@@ -4,20 +4,10 @@
 sage: AsymptoticRing('n^(RBF*I)', ZZ)
 AttributeError: 'ImaginaryGroup_with_category' object has no attribute 'one'

-The following change seems to be enough to make it work, but I am not sure at all if it is correct. +Adding

-diff --git a/src/sage/rings/asymptotic/growth_group.py b/src/sage/rings/asymptotic/growth_group.py
-index 4b8d43438e..7432faa022 100644
---- a/src/sage/rings/asymptotic/growth_group.py
-+++ b/src/sage/rings/asymptotic/growth_group.py
-@@ -5214,6 +5214,9 @@ def construction(self):
-         """
-         return MonomialNonGrowthGroupFunctor(self._var_), self.base()
-
-+    def gens_monomial(self):
-+        return tuple()
-+
-
- MonomialGrowthGroup._non_growth_group_class_ = MonomialNonGrowthGroup
+    def gens_monomial(self):
+        return tuple()

+to MonomialNonGrowthGroup seems to be enough to make it work, but I am not sure at all if it is correct.

mezzarobba commented 3 years ago
comment:2
sage: from sage.rings.asymptotic.growth_group import *
sage: Asy.<n> = AsymptoticRing('n^QQbar', ZZ)
sage: BGG = MonomialGrowthGroup.factory(RBF, 'n', extend_by_non_growth_group=True)
sage: BAsy = AsymptoticRing(BGG, ZZ)
sage: BAsy
Asymptotic Ring <n^RBF * n^(RBF*I)> over Integer Ring
sage: BAsy(n^(QQbar(-1)^(1/3)))
n^([0.500000000000000 +/- 1.95e-16])

(probably the same issue as #34064)