# ditadivisor.py -- bistochastic forms of the Dita products H (x)_Q F_N, with H Hadamard of order M dividing N, and # Q in M_{M x N}(T) arbitrary: (H (x)_Q F_N)_{sa,jt} = Q_st H_sj (F_N)_at. Writing t = p + M u, with 0 <= p < M, the # column (j,t) is multiplied by conj(H_pj) g_u / Q_pt, with g a Chu sequence of length L = N/M, so that F_L g has # constant modulus sqrt(L). The row (s,a) sum is then M w^(as) (F_L g)_a, of modulus sqrt(MN), with w = exp(2 pi i/N). # Checked for random Q and for H a Fourier matrix, scrambled by phases and permutations, or a Walsh matrix. import numpy as np rng=np.random.default_rng(1) F=lambda n: np.exp(2j*np.pi*np.outer(range(n),range(n))/n) def walsh(n): W=np.array([[1.]]) while len(W)