@@ -4541,34 +4541,35 @@ def __init__(self, parent, growth, coefficient, valid_from):
4541
4541
4542
4542
sage: G = MonomialGrowthGroup(ZZ, 'x');
4543
4543
sage: BT_QQ = TermMonoid('B', G, QQ)
4544
- sage: BT_QQ(x^3, 3, valid_from={'m': 20})
4544
+ sage: BT_QQ(x^3, coefficient= 3, valid_from={'m': 20})
4545
4545
Traceback (most recent call last):
4546
4546
...
4547
4547
ValueError: B-Term has valid_from variables defined which do
4548
4548
not occur in the term.
4549
- sage: BT_QQ(x^3, 0, valid_from={'x': 20})
4549
+ sage: BT_QQ(x^3, coefficient= 0, valid_from={'x': 20})
4550
4550
Traceback (most recent call last):
4551
4551
...
4552
4552
ZeroCoefficientError: Zero coefficient 0 is not allowed in
4553
4553
B-Term Monoid x^ZZ with coefficients in Rational Field.
4554
4554
4555
4555
sage: BT_ZZ = TermMonoid('B', G, ZZ)
4556
- sage: BT_ZZ(x, 1/2, valid_from={'x': 20})
4556
+ sage: BT_ZZ(x, coefficient= 1/2, valid_from={'x': 20})
4557
4557
Traceback (most recent call last):
4558
4558
...
4559
- ValueError: 1/2 is not a coefficient in B-Term Monoid x^ZZ with
4560
- coefficients in Integer Ring.
4559
+ ValueError: Cannot create BTerm(x) since given coefficient 1/2 is not
4560
+ valid in B-Term Monoid x^ZZ with coefficients in Integer Ring.
4561
+ > *previous* TypeError: no conversion of this rational to integer
4561
4562
sage: B = GrowthGroup('x^ZZ * y^ZZ');
4562
4563
sage: x, y = B('x'), B('y')
4563
4564
sage: BT_ZZ = TermMonoid('B', B, ZZ)
4564
- sage: BT_ZZ(x^3, 42, valid_from={'x': 10})
4565
+ sage: BT_ZZ(x^3, coefficient= 42, valid_from={'x': 10})
4565
4566
B(42*x^3, x >= 10)
4566
- sage: BT_ZZ(x^3, 42, valid_from={'x': 10, 'y': 20})
4567
+ sage: BT_ZZ(x^3, coefficient= 42, valid_from={'x': 10, 'y': 20})
4567
4568
B(42*x^3, x >= 10, y >= 20)
4568
- sage: BT_ZZ(x^3*y^2, 42, valid_from={'x': 10})
4569
+ sage: BT_ZZ(x^3*y^2, coefficient= 42, valid_from={'x': 10})
4569
4570
Traceback (most recent call last):
4570
4571
ValueError: B-Term has not defined all variables which occur in the term in valid_from.
4571
- sage: BT_ZZ(x^3, 42, valid_from={'x': 10, 'z': 20})
4572
+ sage: BT_ZZ(x^3, coefficient= 42, valid_from={'x': 10, 'z': 20})
4572
4573
Traceback (most recent call last):
4573
4574
...
4574
4575
ValueError: B-Term has valid_from variables defined which do not occur in the term.
@@ -4603,12 +4604,12 @@ def _repr_(self, latex=False):
4603
4604
4604
4605
sage: G = MonomialGrowthGroup(ZZ, 'x');
4605
4606
sage: BT_QQ = TermMonoid('B', G, QQ)
4606
- sage: BT_QQ(x^3, 3, valid_from={'x': 20})
4607
+ sage: BT_QQ(x^3, coefficient= 3, valid_from={'x': 20})
4607
4608
B(3*x^3, x >= 20)
4608
4609
sage: B = GrowthGroup('x^ZZ * y^ZZ');
4609
4610
sage: x, y = B('x'), B('y')
4610
4611
sage: BT_ZZ = TermMonoid('B', B, ZZ)
4611
- sage: BT_ZZ(x^2, 4, valid_from={'x': 10, 'y': 15})
4612
+ sage: BT_ZZ(x^2, coefficient= 4, valid_from={'x': 10, 'y': 15})
4612
4613
B(4*x^2, x >= 10, y >= 15)
4613
4614
"""
4614
4615
if latex :
@@ -4634,11 +4635,11 @@ def _latex_(self):
4634
4635
sage: from sage.rings.asymptotic.term_monoid import DefaultTermMonoidFactory as TermMonoid
4635
4636
sage: G = GrowthGroup('x^ZZ'); x = G.gen()
4636
4637
sage: T = TermMonoid('B', G, QQ)
4637
- sage: latex(T(x, 5, valid_from={'x': 3}))
4638
+ sage: latex(T(x, coefficient= 5, valid_from={'x': 3}))
4638
4639
B_{x \ge 3}\left(5 x\right)
4639
- sage: latex(T(x^2, 3, valid_from={'x': 5}))
4640
+ sage: latex(T(x^2, coefficient= 3, valid_from={'x': 5}))
4640
4641
B_{x \ge 5}\left(3 x^{2}\right)
4641
- sage: latex(T(x^3, 6, valid_from={'x': 10}))
4642
+ sage: latex(T(x^3, coefficient= 6, valid_from={'x': 10}))
4642
4643
B_{x \ge 10}\left(6 x^{3}\right)
4643
4644
"""
4644
4645
return self ._repr_ (latex = True )
@@ -4668,9 +4669,9 @@ def can_absorb(self, other):
4668
4669
sage: from sage.rings.asymptotic.growth_group import GrowthGroup
4669
4670
sage: from sage.rings.asymptotic.term_monoid import DefaultTermMonoidFactory as TermMonoid
4670
4671
sage: BT = TermMonoid('B', GrowthGroup('x^ZZ'), QQ)
4671
- sage: t1 = BT(x^3, 3, valid_from={'x': 20})
4672
- sage: t2 = BT(x^2, 1, valid_from={'x': 10})
4673
- sage: t3 = BT(x^3, 10, valid_from={'x': 10})
4672
+ sage: t1 = BT(x^3, coefficient= 3, valid_from={'x': 20})
4673
+ sage: t2 = BT(x^2, coefficient= 1, valid_from={'x': 10})
4674
+ sage: t3 = BT(x^3, coefficient= 10, valid_from={'x': 10})
4674
4675
sage: t1.can_absorb(t2)
4675
4676
True
4676
4677
sage: t2.can_absorb(t1)
@@ -4680,7 +4681,7 @@ def can_absorb(self, other):
4680
4681
sage: t3.can_absorb(t1)
4681
4682
True
4682
4683
sage: ET = TermMonoid('exact', GrowthGroup('x^ZZ'), QQ)
4683
- sage: t4 = ET(x^3, 5)
4684
+ sage: t4 = ET(x^3, coefficient= 5)
4684
4685
sage: t1.can_absorb(t4)
4685
4686
True
4686
4687
@@ -4691,9 +4692,9 @@ def can_absorb(self, other):
4691
4692
4692
4693
sage: G = MonomialGrowthGroup(ZZ, 'x')
4693
4694
sage: BT = TermMonoid('B', G, QQ)
4694
- sage: t1 = BT(x, 3, valid_from={'x': 20})
4695
- sage: t2 = BT(x^3, 5, valid_from={'x': 5})
4696
- sage: t3 = BT(x^3, 10, valid_from={'x': 10})
4695
+ sage: t1 = BT(x, coefficient= 3, valid_from={'x': 20})
4696
+ sage: t2 = BT(x^3, coefficient= 5, valid_from={'x': 5})
4697
+ sage: t3 = BT(x^3, coefficient= 10, valid_from={'x': 10})
4697
4698
sage: t2.absorb(t1)
4698
4699
B(2003/400*x^3, x >= 20)
4699
4700
sage: t2.absorb(t3)
@@ -4721,7 +4722,7 @@ def _absorb_(self, other):
4721
4722
4722
4723
sage: G = MonomialGrowthGroup(ZZ, 'x')
4723
4724
sage: BT = TermMonoid('B', G, QQ)
4724
- sage: t1 = BT(x^3, 4, valid_from={'x': 10}); t2 = BT(x, 5, valid_from={'x': 20})
4725
+ sage: t1 = BT(x^3, coefficient= 4, valid_from={'x': 10}); t2 = BT(x, coefficient= 5, valid_from={'x': 20})
4725
4726
sage: t1
4726
4727
B(4*x^3, x >= 10)
4727
4728
sage: t1.can_absorb(t2)
@@ -4733,7 +4734,7 @@ def _absorb_(self, other):
4733
4734
...
4734
4735
ArithmeticError: B(5*x, x >= 20) cannot absorb B(4*x^3, x >= 10)
4735
4736
sage: ET = TermMonoid('exact', GrowthGroup('x^ZZ'), QQ)
4736
- sage: t4 = ET(x^3, 5)
4737
+ sage: t4 = ET(x^3, coefficient= 5)
4737
4738
sage: t1.absorb(t4) # not tested, see #32229
4738
4739
"""
4739
4740
if not (self .growth >= other .growth ):
@@ -4834,9 +4835,9 @@ def _create_element_(self, growth, coefficient, valid_from):
4834
4835
4835
4836
sage: G = MonomialGrowthGroup(ZZ, 'x')
4836
4837
sage: BT = TermMonoid('B', G, QQ)
4837
- sage: BT(x^3, 4, valid_from={'x': 10})
4838
+ sage: BT(x^3, coefficient= 4, valid_from={'x': 10})
4838
4839
B(4*x^3, x >= 10)
4839
- sage: BT(x^3, 4, valid_from=10)
4840
+ sage: BT(x^3, coefficient= 4, valid_from=10)
4840
4841
Traceback (most recent call last):
4841
4842
...
4842
4843
AttributeError: 'sage.rings.integer.Integer' object has no attribute 'keys'
0 commit comments