Skip to content

Conversation

@jacksonwalters
Copy link
Member

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.

compute a cyclic subgroup C of the multiplicative group of Z/NZ such that n divides the order of C.
@jacksonwalters jacksonwalters linked an issue Feb 12, 2025 that may be closed by this pull request
@jacksonwalters jacksonwalters changed the title extend to odd N when n divides cyclic subgroup of mult. group extend to non prime power modulus Feb 12, 2025
jacksonwalters and others added 9 commits February 13, 2025 14:08
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
@jacksonwalters
Copy link
Member Author

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.

@jacksonwalters jacksonwalters merged commit 3b581dc into main Feb 14, 2025
1 check passed
@jacksonwalters jacksonwalters deleted the extend_to_odd_N branch February 14, 2025 19:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

extend to non prime power moduli

3 participants