The Hadamard transform (also known as the Walsh–Hadamard transform, Hadamard–Rademacher–Walsh transform, Walsh transform, or Walsh–Fourier transform) is an example of a generalized class of Fourier transforms. It performs an orthogonal, symmetric, involutive, linear operation on a tuple of 2m numbers. The Hadamard transform can be regarded as being built out of size-2 discrete Fourier transforms (DFTs), and is in fact equivalent to a multidimensional DFT of size 2 × 2 × ⋯ × 2 × 2. It decomposes an arbitrary input vector into a superposition of Walsh functions. The transform is named for the French mathematician Jacques Hadamard (French: [adamaʁ]), the German-American mathematician Hans Rademacher, and the American mathematician Joseph L. Walsh.
Definition The Hadamard transform Hm is a 2m × 2m matrix, the Hadamard matrix (scaled by a normalization factor), that transforms 2m real numbers xn into 2m real numbers Xk. The Hadamard transform can be defined in two ways: recursively, or by using the binary (base-2) representation of the indices n and k. Recursively, we define the 1 × 1 Hadamard transform H0 by the identity H0 = 1, and then define Hm for m > 0 by: Hm=12m/2(Hm−1Hm−1Hm−1−Hm−1) where the division by 2m/2 is a normalization that is sometimes omitted. For m > 1, we can also define Hm by: Hm=H1⊗Hm−1 where ⊗ represents the Kronecker product. Thus, other than this normalization factor, the Hadamard matrices are made up entirely of 1 and −1. Equivalently, we can define the Hadamard matrix by its (k, n)-th entry by writing k=∑j=0m−1kj2j=km−12m−1+km−22m−2+⋯+k12+k0n=∑j=0m−1nj2j=nm−12m−1+nm−22m−2+⋯+n12+n0 where the kj and nj are the bit elements (0 or 1) of k and n, respectively. Note that we index from 0, the element in the top left corner has k=n=0. The (k, n)-th entry of the (normalized) Hadamard matrix is then as follows: (Hm)k,n=12m/2(−1)∑j=0m−1kjnj This is exactly the multidimensional 2×2×⋯×2×2 DFT, normalized to be unitary, if the inputs and outputs are regarded as multidimensional arrays indexed by the nj and kj, respectively. H1 can also be regarded as the Fourier transform on the two-element additive group of Z/(2). The sum ∑j=0m−1kjnj can be thought of as the bitwise dot product k⋅n of the binary representations of n and k. For example, withm≥2, the (3, 2) component is computed like so:(Hm)3,2=(−1)3⋅2=(−1)(1,1)⋅(1,0)=(−1)1+0=(−1)1=−1 Some examples of the Hadamard matrices follow. H0=+(1)H1=12(111−1)H2=12(11111−11−111−1−11−1−11)H3=123/2(111111111−11−11−11−111−1−111−1−11−1−111−1−111111−1−1−1−11−11−1−11−1111−1−1−1−1111−1−11−111−1)The rows of the Hadamard matrices are the Walsh functions.
Relation to Fourier transform The Hadamard transform is equivalent to a multidimensional DFT of size 2 × 2 × ⋯ × 2 × 2. Formally, the Hadamard transform is a Fourier transform on the Boolean group (ℤ/2ℤ)n. Using the Fourier transform on finite (abelian) groups, the Fourier transform of a function f:(ℤ/2ℤ)n→ℂ is the function f^ defined by f^(χ)=∑a∈(ℤ/2ℤ)nf(a)χ¯(a) where χ is a character of (ℤ/2ℤ)n. Each character has the form χr(a)=(−1)a⋅r for some r∈(ℤ/2ℤ)n, where the multiplication is the Boolean dot product on bit strings, so we can identify the input to f^ with r∈(ℤ/2ℤ)n (Pontryagin duality) and define f^:(ℤ/2ℤ)n→ℂ by f^(r)=∑a∈(ℤ/2ℤ)nf(a)(−1)r⋅a This is the Hadamard transform of f, considering the input to f and f^ as Boolean strings. In terms of the above formulation where the Hadamard transform multiplies a vector of 2n complex numbers v on the left by the Hadamard matrix Hn the equivalence is seen by taking f to take as input the bit string corresponding to the index of an element of v, and having f output the corresponding element of v. The usual discrete Fourier transform, applied to a vector v of 2n complex numbers, instead uses characters of the cyclic group ℤ/2nℤ. Consequently the DFT requires substantially more complicated arithmetic than the Hadamard transform. Unlike the DFT, the Hadamard transform is purely real, and in fact requires no multiplication, only sign flips.
Computational complexity In the classical domain, the Hadamard transform can be computed in nlogn operations (n=2m), using the fast Hadamard transform algorithm. In the quantum domain, the Hadamard transform can be computed in O(1) time, as it is a quantum logic gate that can be parallelized.
Quantum computing applications The Hadamard transform is used extensively in quantum computing. The 2 × 2 Hadamard transform H1 is the quantum logic gate known as the Hadamard gate, and the application of a Hadamard gate to each qubit of an n-qubit register in parallel is equivalent to the Hadamard transform Hn.
Hadamard gate
In quantum computing, the Hadamard gate is a one-qubit rotation, mapping the qubit-basis states |0⟩ and |1⟩ to two superposition states with equal weight of the computational basis states |0⟩ and |1⟩. Usually the phases are chosen so that H=|0⟩+|1⟩2⟨0|+|0⟩−|1⟩2⟨1| in Dirac notation. This corresponds to the transformation matrix H1=12(111−1) in the |0⟩,|1⟩ basis, also known as the computational basis. The states |0⟩+|1⟩2 and |0⟩−|1⟩2 are known as |+⟩ and |−⟩ respectively, and together constitute the polar basis in quantum computing.
Hadamard gate operations H(|0⟩)=12|0⟩+12|1⟩=:|+⟩H(|1⟩)=12|0⟩−12|1⟩=:|−⟩H(|+⟩)=H(12|0⟩+12|1⟩)=12(|0⟩+|1⟩)+12(|0⟩−|1⟩)=|0⟩H(|−⟩)=H(12|0⟩−12|1⟩)=12(|0⟩+|1⟩)−12(|0⟩−|1⟩)=|1⟩ One application of the Hadamard gate to either a 0 or 1 qubit will produce a quantum state that, if observed, will be a 0 or 1 with equal probability (as seen in the first two operations). This is exactly like flipping a fair coin in the standard probabilistic model of computation. However, if the Hadamard gate is applied twice in succession (as is effectively being done in the last two operations), then the final state is always the same as the initial state.
… excerpt ends here. Continue reading the full article.

 × H(8) = (4, 2, 0, −2, 0, 2, 0, 2)](https://thumb.wikimedia.org/wikipedia/commons/thumb/a/aa/1010_0110_Walsh_spectrum_%28single_row%29.svg/330px-1010_0110_Walsh_spectrum_%28single_row%29.svg.png?utm_source=en.wikipedia.org&utm_campaign=parser&utm_content=thumbnail)

