intvert.select_coeffs_2D
- select_coeffs_2D(M, N, Ls=[])
Selects a set of DFT coefficient frequencies.
Constructs a dictionary mapping divisors of M and N to sets of equivalent DFT coefficient frequencies for an (M,N) integer matrix. The pair of divisors (d1, d2) is mapped to a set of frozensets of DFT frequencies. Each frozenset contains equivalent frequencies pairs (k, l) where the greatest common divisor of k with M is d1 and the greatest common divisor of l with N is d2. The number of frequencies in each frozen set is determined by Ls. If Ls is an integer, the number of frequencies in set of frequencies will be at most Ls. If Ls is a list, Ls[i] is the maximum number of frequencies in selected[d1, d2] if (d1, d2) generates a cyclic subgroup at the i’th level of the cyclic subgroup lattice of \(\mathbb{Z}_M\times\mathbb{Z}_N\).
- Parameters:
- Returns:
selected – Dictionary of selected coefficients.
- Return type:
See also
get_coeff_classes_2Dstructure of full DFT coefficient equivalence classes
sample_2Duse the selected coefficients to sample an integer matrix
select_coeffs_1Danalogous 1D function
Examples
By default, get 1 element of each coefficient class:
>>> intvert.select_coeffs_2D(2, 10) {(2, 10): {frozenset({(0, 0)})}, (2, 1): {frozenset({(0, 1)})}, (2, 2): {frozenset({(0, 2)})}, (2, 5): {frozenset({(0, 5)})}, (1, 10): {frozenset({(1, 0)})}, (1, 1): {frozenset({(1, 1)})}, (1, 2): {frozenset({(1, 2)})}, (1, 5): {frozenset({(1, 5)})}}
If Ls is an integer, there are up to Ls generators in every lattice class:
>>> intvert.select_coeffs_2D(2, 10, 2) {(2, 10): {frozenset({(0, 0)})}, (2, 1): {frozenset({(0, 1), (0, 3)})}, (2, 2): {frozenset({(0, 2), (0, 4)})}, (2, 5): {frozenset({(0, 5)})}, (1, 10): {frozenset({(1, 0)})}, (1, 1): {frozenset({(1, 1), (1, 3)})}, (1, 2): {frozenset({(1, 2), (1, 4)})}, (1, 5): {frozenset({(1, 5)})}}
This is realized for the classes generated by (0, 1), (0, 2), (1, 1), and (1, 2). However, there is only one generator (accounting for real DFT symmetry) for the other classes.
If Ls is a list of length 1, all classes on the top level of the lattice may have up to two generators:
>>> intvert.select_coeffs_2D(2, 10, [2]) {(2, 10): {frozenset({(0, 0)})}, (2, 1): {frozenset({(0, 1), (0, 3)})}, (2, 2): {frozenset({(0, 2)})}, (2, 5): {frozenset({(0, 5)})}, (1, 10): {frozenset({(1, 0)})}, (1, 1): {frozenset({(1, 1), (1, 3)})}, (1, 2): {frozenset({(1, 2), (1, 4)})}, (1, 5): {frozenset({(1, 5)})}}