ArticleslgStudy

physics

Hadamard transform

Hadamard transform is a physics topic covered in the lgStudy science library. This page brings together a partial reference excerpt, illustrations, worked examples, real-world applications and a short study plan, so you can understand Hadamard transform rather than just read about it. In short: 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.

Hadamard transform — main illustration
Hadamard transform — illustration

Key takeaways

  • Hadamard transform belongs to physics; place it in that map before memorising details.
  • Learn the definition first, then one example that makes the definition concrete.
  • Connect Hadamard transform to a quantity you can measure, compute or draw — that is where exam questions come from.
  • Reproduce the core statement of Hadamard transform from memory before moving on to harder problems.

Reference excerpt

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 nlog⁡n 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.

Illustrations

Hadamard transform: The product of a Boolean function and a Hadamard matrix is its Walsh spectrum:[1](1, 0, 1, 0, 0, 1, 1, 0) × H(8) = (4, 2, 0, −2, 0, 2, 0, 2)
The product of a Boolean function and a Hadamard matrix is its Walsh spectrum:[1](1, 0, 1, 0, 0, 1, 1, 0) × H(8) = (4, 2, 0, −2, 0, 2, 0, 2)
Hadamard transform: Fast Walsh–Hadamard transform, a faster way to calculate the Walsh spectrum of (1, 0, 1, 0, 0, 1, 1, 0).
Fast Walsh–Hadamard transform, a faster way to calculate the Walsh spectrum of (1, 0, 1, 0, 0, 1, 1, 0).
Hadamard transform: The original function can be expressed by means of its Walsh spectrum as an arithmetical polynomial.
The original function can be expressed by means of its Walsh spectrum as an arithmetical polynomial.

Worked examples

Example 1 — a first encounter with Hadamard transform

Start with the simplest possible case. Write down what Hadamard transform claims or describes in one sentence, then invent the smallest concrete situation in which that sentence is true. In physics, the smallest case is usually a single object, a single equation or a single measurement. Check that every symbol or term in your sentence has a meaning in that case.

Example 2 — changing one variable

Take the situation from Example 1 and change exactly one quantity: double it, halve it, or set it to zero. Predict what should happen to Hadamard transform before you calculate. Comparing your prediction with the result is the fastest way to find out whether you understand the idea or only the words.

Example 3 — an exam-style question

Typical questions about Hadamard transform ask you to (a) state it precisely, (b) apply it to given data, and (c) explain a limitation. Practise writing all three answers in under five minutes; the third part is what separates a full-mark answer from an average one.

Applications of Hadamard transform

In research
Hadamard transform appears in physics research whenever the underlying quantities have to be modelled precisely. Papers usually cite it as a starting assumption and then explore where it breaks down.
In technology and industry
Engineering practice reuses Hadamard transform in design rules, simulations and safety margins. Knowing the idea lets you read a specification sheet and understand why the numbers look the way they do.
In the classroom
Hadamard transform is common in secondary-school and first-year university syllabi. It links to neighbouring topics Quantum algorithms, Transforms, so understanding it makes those chapters shorter.
In everyday life
Look for Hadamard transform outside the textbook — in sport, cooking, traffic, electronics or the sky above you. An example you found yourself is remembered far longer than one you were given.
Ask Teacher Smith questions about this articleOpens your AI tutor with a question about “Hadamard transform” →

How to study Hadamard transform in 20 minutes

  1. Read the reference excerpt below once, without taking notes.
  2. Close the page and write down what Hadamard transform means in your own words.
  3. Compare your version with the excerpt and mark what you missed.
  4. Work through the three examples above with pen and paper.
  5. Explain Hadamard transform out loud to somebody else — or to Teacher Smith in the lgStudy chat.

Frequently asked questions

What is Hadamard transform in simple terms?

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 numbe…

Why does Hadamard transform matter?

Because it connects several physics ideas at once: it gives you a definition you can apply, a quantity you can calculate, and a way to check whether a result is plausible.

How should I study Hadamard transform?

Read the excerpt, restate it from memory, then work through the examples and applications listed on this page. The five-step study plan above takes about twenty minutes.

What does this page cover?

It gives you a compact reference excerpt plus original lgStudy explanations, examples, applications and study material on Hadamard transform.

Tags

  • Quantum algorithms
  • Transforms

Keep exploring