-
Notifications
You must be signed in to change notification settings - Fork 2
extend to non prime power modulus #16
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
compute a cyclic subgroup C of the multiplicative group of Z/NZ such that n divides the order of C.
the root of unity needs to satisfy a summation condition. since there are zero divisors in this ring, it is now possible that omega-1 is a zero divisor.
now for each factor in the mult. group, compute a divisor d of the order phi by using the gcd. ensure that the product of these divisors is n. then compute elements of order d for each factor, pull them back along the CRT isomorphism, and take their product mod modulus.
given a list of integers [phi_i], we want to compute a list of divisors d_i such that lcm({d_i}) = n.
omega(modulus,n) will now compute an element that is a primitive nth root of unity mod all prime factors of n
remove unnecessary functions and assert omega is square
rather than checking that the sums sum_{j=0}^{n-1} omega^{jk} = 0 for 1 \le k < n, we can simplify this to just omega^{n/2} == -1 (mod N).
add some more test cases to the non prime power modulus case
|
it is necessary and sufficient for n to divide each totient phi(p^k) for each prime factor of the modulus N. this allows us to find an n^th root of unity for each multiplicative factor of order phi(p^k). using the Chinese remainder theorem, we can pullback each of these n^th roots to obtain an n^th mod N omega which satisfies the additional condition omega^{n/2} == -1 (mod N). this ensures that the sums sum_{j=0}^{n-1} omega^{jk} == 0 for all 1 \le k < n. since n is a power of 2, and we need gcd(n,N) == 1 for n to be invertible, we can assume N is odd. thus each prime factor p is odd, and so the condition on the modulus becomes that n|p_i - 1 for each prime factor p_i of the modulus. |
when N is odd and n is a power of 2, we can sometimes find a cyclic subgroup C of the multiplicative group (Z/NZ)* such that n | |C|. in this case, we are able to compute an n^th root of unity by finding a generator g of C, and computing omega = g^{|C|/n}.
note such a subgroup is not guaranteed to exist. for example, when N=45, \phi(45) = 24. we might hope for subgroups of size 1, 2, 4, 8. however, (Z/45Z)* \cong (Z/9Z)* x (Z/5Z)* \cong Z/6Z x Z/4Z, which does not have a subgroup of order 8.
by using the Chinese remainder theorem and finding generators of factors, we can compute such a cyclic subgroup.