Skip to content

Commit ba7241c

Browse files
find homogenization error example, fix integers
1 parent bddcc5e commit ba7241c

File tree

1 file changed

+32
-5
lines changed

1 file changed

+32
-5
lines changed

src/sage/dynamics/arithmetic_dynamics/dynamical_semigroup.py

Lines changed: 32 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -656,6 +656,8 @@ def _mul_(self, other_dynamical_semigroup):
656656
...
657657
TypeError: can only multiply dynamical semigroups with other dynamical semigroups of the same type
658658
659+
::
660+
659661
sage: P.<x,y> = ProjectiveSpace(QQ, 1)
660662
sage: A.<z> = AffineSpace(QQ, 1)
661663
sage: f1 = DynamicalSystem_projective([x, y], P)
@@ -1011,6 +1013,21 @@ def dehomogenize(self, n):
10111013
Defn: Defined on coordinates by sending (y) to
10121014
(y^2)
10131015
1016+
::
1017+
1018+
sage: P.<x,y> = ProjectiveSpace(QQ, 1)
1019+
sage: f = DynamicalSystem([x, y], P)
1020+
sage: g = DynamicalSystem([x^2, y^2], P)
1021+
sage: d = DynamicalSemigroup((f, g))
1022+
sage: d.dehomogenize(1)
1023+
Dynamical semigroup over Affine Space of dimension 1 over Rational Field defined by 2 dynamical systems:
1024+
Dynamical System of Affine Space of dimension 1 over Rational Field
1025+
Defn: Defined on coordinates by sending (x) to
1026+
(x)
1027+
Dynamical System of Affine Space of dimension 1 over Rational Field
1028+
Defn: Defined on coordinates by sending (x) to
1029+
(x^2)
1030+
10141031
TESTS::
10151032
10161033
sage: P.<x,y> = ProjectiveSpace(QQ, 1)
@@ -1020,15 +1037,17 @@ def dehomogenize(self, n):
10201037
sage: d.dehomogenize((1, 0))
10211038
Traceback (most recent call last):
10221039
...
1023-
ValueError: Dynamical System of Projective Space of dimension 1 over Rational Field
1024-
Defn: Defined on coordinates by sending (x : y) to
1025-
(x : y) dehomogenized at (1, 0) is not a `DynamicalSystem_affine` object
1040+
ValueError: Scheme morphism:
1041+
From: Affine Space of dimension 1 over Rational Field
1042+
To: Affine Space of dimension 1 over Rational Field
1043+
Defn: Defined on coordinates by sending (x) to
1044+
(1/x) is not a `DynamicalSystem_affine` object
10261045
"""
10271046
new_systems = []
10281047
for ds in self.defining_systems():
10291048
new_system = ds.dehomogenize(n)
10301049
if not isinstance(new_system, DynamicalSystem_affine):
1031-
raise ValueError(str(ds) + " dehomogenized at " + str(n) + " is not a `DynamicalSystem_affine` object")
1050+
raise ValueError(str(new_system) + " is not a `DynamicalSystem_affine` object")
10321051
new_systems.append(new_system)
10331052
return DynamicalSemigroup_affine(new_systems)
10341053

@@ -1134,12 +1153,20 @@ def homogenize(self, n):
11341153
Dynamical System of Projective Space of dimension 1 over Rational Field
11351154
Defn: Defined on coordinates by sending (x0 : x1) to
11361155
(x1^2 : x0^2)
1156+
1157+
TESTS::
1158+
1159+
sage: A.<x,y,z> = AffineSpace(QQ, 3)
1160+
sage: f = DynamicalSystem([y^2, z^3, x^6], A)
1161+
sage: g = DynamicalSystem([1 + x^7, y + z^2, x + 9], A)
1162+
sage: d = DynamicalSemigroup((f, g))
1163+
sage: d.homogenize((0, 1))
11371164
"""
11381165
new_systems = []
11391166
for ds in self.defining_systems():
11401167
new_system = ds.homogenize(n)
11411168
if not isinstance(new_system, DynamicalSystem_projective):
1142-
raise ValueError(str(ds) + " homogenized at " + str(n) + " is not a `DynamicalSystem_projective` object")
1169+
raise ValueError(str(new_system) + " is not a `DynamicalSystem_projective` object")
11431170
new_systems.append(new_system)
11441171
return DynamicalSemigroup_projective(new_systems)
11451172

0 commit comments

Comments
 (0)