sagemath / sage

Main repository of SageMath. Now open for Issues and Pull Requests.
https://www.sagemath.org
Other
1.19k stars 411 forks source link

Periodic Proportion Homomorphism over Finite Fields #25745

Open d99bb657-85da-4e6a-9cf4-9041874f39c0 opened 6 years ago

d99bb657-85da-4e6a-9cf4-9041874f39c0 commented 6 years ago

Given a homormorphism, a prime p, and a degree n. Returns a table of the ratio of periodic points to the number of points in a field of size p^n, as it cycles through the range of n or through the primes up to p. One can organize table by ascending primes or by ascending degree. Skips the prime 2. Only works over finite fields.

        From paper by Zoë Bell, Karina Cho, Rebecca Lauren Miller, and Bianca Thompson.  Author Rebecca Lauren Miller. Implimented at
        Sage Days 94, Algorithm developed as part of Sage Days 90.

CC: @sagetrac-bthompson

Component: dynamics

Keywords: dynamical systems, sagedays90, days94, days90

Author: Rebecca Lauren Miller

Branch/Commit: u/rlmiller/bianca @ 32ffa30

Reviewer: Ben Hutz

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

d99bb657-85da-4e6a-9cf4-9041874f39c0 commented 6 years ago

Branch: u/rlmiller/bianca

d99bb657-85da-4e6a-9cf4-9041874f39c0 commented 6 years ago

New commits:

a7597f525745 periodic proportion hoomorphism
d99bb657-85da-4e6a-9cf4-9041874f39c0 commented 6 years ago

Commit: a7597f5

bhutz commented 6 years ago
comment:3

I can't look at this for a few days, so if someone else wants to review in the mean time go right ahead.

Just a couple quick comments

7ed8c4ca-6d56-4ae9-953a-41e42b4ed313 commented 6 years ago

Changed commit from a7597f5 to 32ffa30

7ed8c4ca-6d56-4ae9-953a-41e42b4ed313 commented 6 years ago

Branch pushed to git repo; I updated commit sha1. New commits:

32ffa3025745 updated tests and description
bhutz commented 6 years ago

Reviewer: Ben Hutz

bhutz commented 6 years ago
comment:5

I haven't built and checked values yet, since there are a bunch of things from looking through the code first:

f.periodic_proportion_table(p=[3,7,13],n=[1,3])

having the short cut

f.periodic_proportion_table(p=3, n=4)

mean all primes up to p and all exp up to n is fine

sage: f.periodic_proportion_table(n=4)
Traceback (most recent call last):
...
AttributeError: 'DynamicalSystem_projective' object has no attribute 'periodic_proportion_table'
if is_prime(p) == False:

should be

if not is_prime():
if n<=0 or not n in ZZ:

better as

n = ZZ(n)
if n <= 0:
sage: rows = [['a', 'b', 'c'], [100,2,3], [4,5,60]]
sage: table(rows)
NT. append([p, i+1, perRatio])
g=fp.cyclegraph()
PT. append([i, n, perRatio])

cyclegraph can handle indeterminacy, so I don't really understand why you need this block. The warning you have seems to say that having an indeterminancy is ok, so I'm not sure what you really want here since the docs say you want a morphism? In my opinion, you are writing a function that is just returning the values to fill out the table, whether those values having any meaning is not really your business, so if it works for rational maps as well as morphisms, I see no reason to restrict to morphisms.

Also, I see no reason this can't be made to work in higher dimensions (other than it will be slow). You just need to adjust the cardinality calculation.

comment::

test