{'fraction_non_alphanumeric': 0.03842318296474453, 'fraction_numerical': 0.009151170293893354, 'mean_word_length': 4.289481849208812, 'pattern_counts': {'":': 0, '<': 0, '<?xml version=': 0, '>': 0, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 10, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
Krawtchouk matrices from classical and quantum random walks

Krawtchouk's polynomials occur classically as orthogonal polynomials with respect to the binomial distribution. They may be also expressed in the form of matrices, that emerge as arrays of the values that the polynomials take. The algebraic properties of these matrices provide a very interesting and accessible example in the approach to probability theory known as quantum probability. First it is noted how the Krawtchouk matrices are connected to the classical symmetric Bernoulli random walk. And we show how to derive Krawtchouk matrices in the quantum probability context via tensor powers of the elementary Hadamard matrix. Then connections with the classical situation are shown by calculating expectation values in the quantum case.


Introduction
Some very basic algebraic rules can be expressed using matrices. Take, for example, (the expansion coefficients make up the columns of the matrix). In general, we make the definition: The N th -order Krawtchouk matrix K (N ) is an (N + 1) × (N + 1) matrix, the entries of which are determined by the expansion: The left-hand-side G(v) = (1 + v) N −j (1 − v) j is thus the generating function for the row entries of the j th column of K (N ) . Expanding gives an explicit expression: Here are the Krawtchouk matrices of order zero and one: More examples can be found in Table 1 of Appendix 1. In the remaining of the text, matrix indices run from 0 to N.
One may view the columns of Krawtchouk matrices as generalized binomial coefficients. The rows define Krawtchouk polynomials: for a fixed order N, the i-th Krawtchouk polynomial is the function that takes its corresponding values from the i-th row. One can easily show that K i (j, N) is indeed a polynomial of degree i in the variable j.
Historically, Krawtchouk's polynomials were introduced and studied by Mikhail Krawtchouk in the late 20's [12,13]. Since then, they have appeared in many areas of mathematics and applications. As orthogonal polynomials, they occur in the classic work by Szëgo [20]. They have been studied from the point of view of harmonic analysis and special functions, e.g., in work of Dunkl [6,7]. In statistical considerations, they arose in work of Eagleson [8] and later Vere-Jones [21]. They play various roles in coding theory and combinatorics, for example, in MacWilliams' theorem on weight enumerators [17,14], and in association schemes [3,4,5].
A classical probabilistic interpretation has been given in [10]. In the context of the classical symmetric random walk, it is recognized that Krawtchouk's polynomials are elementary symmetric functions in variables taking values ±1. Specifically, if ξ i are independent Bernoulli random variables taking values ±1 with probability 1 2 , then if j of the ξ i are equal to −1, the i th elementary symmetric function in the ξ i is equal to K (N ) ij . It turns out that the generating function (1) is a martingale in the parameter N. Details are in Section 3 below.
As matrices, they appeared in the 1985 work of N. Bose [1] on digital filtering, in the context of the Cayley transform on the complex plane. The symmetric version of the Krawtchouk matrices has been considered in [9].
Despite this wide research, the full potential, meaning and significance of Krawtchouk polynomials is far from being complete. In this paper we look at Krawtchouk matrices as operators and propose two new ways in which Krawtchouk matrices arise: via classical and quantum random walks. Especially the latter is of current interest. The starting idea is to represent the second Krawtchouk matrix (coinciding with the basic Hadamard matrix) as a sum of two operators Via the technique of tensor products of underlying spaces we obtain a relationship between Krawtchouk matrices and Sylvester-Hadamard matrices.
The reader should consult Parthasarathy's [18] for material on quantum probability. It contains the operator theory needed for the subject as well as showing the connections with classical probability theory.
For information on Hadamard matrices as they appear here, we recommend Yarlagadda and Hershey's work [22] which provides an overview of the subject of Sylvester-Hadamard matrices, indicating many interesting applications. For statisticians, they point out that in Yates' factorial analysis, the Hadamard transform provides a useful nonparametric test for association.
Yet another area of significance of this research lies in the quantum computing program [15,18]. Details on this connection will appear in an independent work.
This paper is organized as follows. In the next section, we review basic properties of Krawtchouk matrices. The identities presented, although basic, seem to be new and do not appear in the references cited. Section 3 presents the classical probability interpretation. It may be viewed as a warm-up leading to the quantum random walk introduced and studied in Section 4, and to the relationship between Krawtchouk matrices and Sylvester-Hadamard matrices. The generating function techniques used there are original with the present authors. In the last subsection, calculating expectation values in the quantum case shows how the quantum model is related to the classical random walk. Appendix 1 has examples of Krawtchouk and symmetric Krawtchouk matrices so that the reader may see concretely the subject(s) of our discussion. Appendices 2 (tensor products) and 3 (symmetric tensor spaces) are included to aid the reader as well as to clarify the notation.

Basic properties of Krawtchouk matrices
(1) The square of a Krawtchouk matrix is proportional to the identity matrix.
This remarkable property allows one to define a Fourier-like Krawtchouk transform on integer vectors.
(2) The top row is all 1's. The bottom row has ±1's with alternating signs, starting with +1. The leftmost entries are just binomial coefficients, The rightmost entries are binomial coefficients with alternating signs, K (3) There is a four-fold symmetry: |K Krawtchouk matrices generalize Pascal's triangle in the following sense: Visualize a stack of Krawtchouk matrices, the order N increasing downwards. Pascal's triangle is formed by the leftmost columns. It turns out that Pascal's identity holds for the other columns as well. Less obvious is another identity -call it dual Pascal.

(Cross identities)
The following mutually inverse relations (Pascal and dual Pascal) hold: 2. (Square identity) In a square of any four adjacent entries in a Krawtchouk matrix, the entry in the left-bottom corner is the sum of the other three, i.e., The inverse relations are immediate. The square identity follows from the observation (a + b) The square identity is useful in producing the entries of a Krawtchouk matrix: fill the top row with 1's, the right-most column with sign-alternating binomial coefficients. Then, apply the square identity to reproduce the matrix.
In summary, the identities considered above can be written as follows: Cross identities: Square identity: If each column of the matrix is multiplied by the corresponding binomial coefficient, the matrix becomes symmetric. Let B (N ) denote the (N + 1) × (N + 1) diagonal matrix with binomial coefficients as its non-zero entries. Then, for each N ≥ 0, one defines the symmetric Krawtchouk matrix as Example: For N = 3, we have Some symmetric Krawtchouk matrices are displayed in Table 2 of Appendix 1.

Krawtchouk matrices and classical random walk
In this section we will give a probabilistic meaning to the Krawtchouk matrices and some of their properties.
Let ξ i be independent symmetric Bernoulli random variables taking values ±1. Let X N = ξ 1 + · · · + ξ N be the associated random walk starting from 0. Now observe that the generating function of the elementary symmetric functions in the ξ i is a martingale, in fact a discrete exponential martingale: where α k denotes the k th elementary symmetric function. The martingale property is immediate since each ξ i has mean 0. Suppose that at time N, the number of the ξ i that are equal to −1 is j N , with the rest equal to +1. Then j N = (N − X N )/2 and M N can be expressed solely in terms of N and X N , or, equivalently, of N and j N From the generating function for the Krawtchouk matrices, (1), follows so that as functions on the Bernoulli space, each sequence of random variables K Now we can interpret two basic recurrences of Proposition 2.1. For a fixed column of K (N ) , the corresponding column in K (N +1) satisfies the Pascal triangle recurrence: K To see this in the probabilistic setting, write M N +1 = (1 + vξ N )M N . Observe that for j N to remain constant, ξ N must take the value +1 and expanding (1 + v)M N yields the Pascal recurrence as in the proof of Proposition 2.1. It is interesting how the martingale property comes into play. We have since half the time ξ N +1 is −1, increasing j N by 1, and half the time j N is unchanged. Thus, writing j for j N , Many further properties of Krawtchouk polynomials may be derived from their interpretation as elementary symmetric functions on the Bernoulli space with scope for probabilistic methods as well.

Krawtchouk matrices and quantum random walk
In quantum probability, random variables are modeled by self-adjoint operators on Hilbert spaces and independence by tensor products. We can model a symmetric Bernoulli random walk as follows. Consider a 2-dimensional Hilbert space V = R 2 and two special 2 × 2 operators, One can readily check that (use F 2 = G 2 = I). This, of course, can be viewed as the spectral decomposition of F and we can interpret the Hadamard matrix as a matrix reducing F to diagonal form.
where e 0 denotes the transpose of [1,0]. This coincides with the moment generating function for the symmetric Bernoulli random variable taking values ±1, showing that indeed we are dealing with the (quantum) generalization of the classical model.
The Hilbert space of states is represented by the N-th tensor product of the original space V , that is, by the 2 N -dimensional Hilbert space V ⊗N (see Appendix 2 for notation). Define the following linear operators, N in all, in V ⊗N each f i describing a flip at the i-th position. These are the quantum equivalents of the random walk variables from Section 3. We shall consider the superposition of these independent actions, setting Notation: For notational clarity, since N is fixed throughout the discussion, we drop the index N from the X's.
Analogously, we define: with X G = g 1 + · · · + g N . Finally, let us extend H to the N-fold tensor product, setting H N = H ⊗N . These are the well-known Sylvester-Hadamard matrices with the first few given here: etc., where, for typographical reasons, we use • for 1 and • for −1.
It turns out that our X-operators intertwine the Sylvester-Hadamard matrices. For illustration, consider a calculation for N = 3: where the relation F H = HG is used. This clearly generalizes to f k H N = H N g k and, by summing over k, yields an important relation: Now, we shall consider the symmetrized versions of the operators (the reader is referred to Appendix 3 for the theory and methods used here). Since products are preserved in the process of reduction to the symmetric tensor space, we get the bars indicating the corresponding induced maps. We know how to calculate H N from the action of H on polynomials in degree N. For symmetric tensors the components in degree N are Proof. Writing (x, y) for (x 0 , x 1 ), we have in degree N for the k th component: Scaling out x N and replacing v = y/x yields the generating function for the Krawtchouk matrices with the coefficient of v l equal to K lk . Thus the result. Now consider the generating function for the elementary symmetric functions in the quantum variables f j . This is the N-fold tensor power From (I + tF )H = H(I + tG) we have The difficulty is to calculate the action on the symmetric tensors for operators, such as X F , that are not pure tensor powers. However, from F N (t) and G N (t) we can recover X F and X G via with corresponding relations for the barred operators. Calculating on polynomials yields the desired results as follows.
In degree N, using x and y as variables, we get the k th component for X F and X G via and since I + tG is diagonal, For example, calculations for N = 4 result in Since X G is the result of diagonalizing X F , we observe that

Expectation values
To find the probability distributions associated to our X F operators, we must calculate expectation values, cf. Remark 4.1. In the present context, expectation values in two particular states are especially interesting. Namely, in the state e 0 and in the normalized trace, which is the uniform distribution on the spectrum. In the N-fold tensor product, we want to consider expectation values in the ground state | 000 . . . 0 and normalized traces. Then we can go to the symmetric tensors.
The scalar product on the tensor product space factors, corresponding to independence in classical probability. Thus, from (5) one obtains the expectation value of exp(zX F ) in the ground state | 000 . . . 0 to be (cosh z) N . Similarly, the trace of the tensor product of operators is the product of their traces. So, for the trace, tr exp(zF ) = 2 cosh z implies tr exp(zX F ) = 2 N (cosh z) N and, after normalizing, this yields (cosh z) N .
For the barred operators, we consider the symmetric trace. Here we use the symmetric trace theorem, detailed in Appendix 3. It tells us that the generating function for the symmetric traces of any operator A in the various degrees is det(I − tA) −1 . Taking A = exp(zF ), we have The latter is the generating function for Chebyshev polynomials of the second kind, U N , so that the normalized symmetric trace is which equals as well This corresponds to a uniform distribution on the support of the random walk at time N, namely, −N, 2 − N, . . . , N − 2, N.

Appendix 3: Symmetric tensor spaces
Here we review symmetric tensor spaces as spaces of polynomials in commuting variables. This material is presented with a view to the infinitedimensional case in [18], pp. 105ff., however we focus on the finite-dimensional context and include as well an important observation contained in Theorem 4.4.
The space V ⊗N can be mapped onto the space of symmetric tensors, V ⊗ S N by identifying basis vectors (in V ⊗N ) that are equivalent under all permutations. Alternatively, one can identify the basic tensor | n 1 n 2 . . . n N with the monomial x n 1 x n 2 · · · x n N in the commuting variables x 0 , . . . , x δ . Hence we have a linear map from tensor space into the space of polynomials, itself isomorphic to the space of symmetric tensors: In the symmetric tensor space, tensor labels need to count only occupancy, that is, the number of times a basis vector of V occurs in a given basic tensor of V ⊗N . We indicate occupancy by a multi-index which is the exponent of the corresponding monomial. The dimension of V ⊗ S N is thus that is, the number of monomials homogeneous of degree N.
Given an operator A on V , let A N = A ⊗N . Then A N induces an operator A N on V ⊗ S N from the action of A on polynomials, which we call the symmetric representation of A in degree N. For convenience we work dually with the tensor components rather with the action on the basis vectors. Denote the matrix elements of the action of A N by A mn . If A has matrix entries A ij , let Then the matrix elements of the symmetric representation are defined by the relation (expansion): A mn x n 0 0 · · · x n δ δ with multi-indices m and n.
Composition of A 1 with A 2 shows that mapping to the symmetric representation is an algebra homomorphism, i.e., Explicitly, in basis notation Define the symmetric trace in degree N of A as the trace of the matrix elements of A N , i.e., the sum of the diagonal matrix elements: with |m| denoting, as usual, the sum of the components of m. Observe that if A is upper-triangular, with eigenvalues λ 1 , . . . , λ d , then the trace of this action on the space of polynomials homogeneous of degree N is exactly h N (λ 1 , . . . , λ d ), the N th homogeneous symmetric function in the λ's.
We recall a useful theorem on calculating the symmetric trace. Since the mapping from A to A N is a homomorphism, a similarity transformation on A extends to one on A N thus preserving traces. Now, any matrix is similar to an upper-triangular one with the same eigenvalues, thus follows [19]: Proof. With {λ i } denoting the eigenvalues of A, as stated above.
Remark 4.5 Note that this result is equivalent to MacMahon's Master Theorem in combinatorics [16].
Remark 4.6 From another point of view, Chen and Louck [2], considering powers of the bilinear form i,j x i A ij y j rather than just the linear form as done here, study representation functions that are analogs of our symmetric Krawtchouk matrices. Their L α,β is our symmetric representation scaled by multinomial factors. In addition they suggest further interesting generalizations beyond symmetric tensors.