Skip to content

Commit 707bc44

Browse files
Merge branch 'dsg_ticket2' into dynamical_semigroup
2 parents 8a09e04 + 0e91599 commit 707bc44

File tree

1 file changed

+10
-10
lines changed

1 file changed

+10
-10
lines changed

src/sage/dynamics/arithmetic_dynamics/dynamical_semigroup.py

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -400,10 +400,10 @@ def __call__(self, input):
400400
...
401401
TypeError: unable to convert {(4 : 1), (2 : 1)} to an element of Rational Field
402402
"""
403-
result = []
403+
result = set()
404404
for ds in self.defining_systems():
405-
result.append(ds(self.domain()(input)))
406-
return set(result)
405+
result.add(ds(self.domain()(input)))
406+
return result
407407

408408
def base_ring(self):
409409
r"""
@@ -496,10 +496,10 @@ def defining_polynomials(self):
496496
sage: f.defining_polynomials()
497497
{(x, y), (x^2, y^2)}
498498
"""
499-
result = []
499+
result = set()
500500
for ds in self.defining_systems():
501-
result.append(ds.defining_polynomials())
502-
return set(result)
501+
result.add(ds.defining_polynomials())
502+
return result
503503

504504
def defining_systems(self):
505505
r"""
@@ -604,13 +604,13 @@ def nth_iterate(self, p, n):
604604
raise TypeError(str(n) + " must be an integer")
605605
if n < 0:
606606
raise ValueError(str(n) + " must be a nonnegative integer")
607-
result = (self.domain()(p),)
607+
result = {self.domain()(p)}
608608
for i in range(1, n + 1):
609-
next_iteration = []
609+
next_iteration = set()
610610
for point in result:
611-
next_iteration.extend(self(point))
611+
next_iteration.update(self(point))
612612
result = next_iteration
613-
return set(result)
613+
return result
614614

615615
def orbit(self, p, n):
616616
r"""

0 commit comments

Comments
 (0)