Hadamard Transform

Hadamard transform 2m real numbers (or complex numbers, although the Hadamard matrices themselves are purely real). Not

Views 101 Downloads 4 File size 158KB

Report DMCA / Copyright

DOWNLOAD FILE

Recommend stories

Citation preview

Hadamard transform 2m real numbers (or complex numbers, although the Hadamard matrices themselves are purely real).

Not to be confused with Walsh matrix. The Hadamard transform (also known as

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.[2] It decomposes an arbitrary input vector into a superposition of Walsh functions. The transform is named for the French mathematician Jacques Hadamard, the German-American mathematician Hans Rademacher, and the American mathematician Joseph L. Walsh.

1 Definition The product of a Boolean function and a Walsh 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 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 H 0 by the identity H 0 = 1, and then define Hm for m > 0 by:

Hm

( 1 Hm−1 √ = 2 Hm−1

Hm−1 −Hm−1

)

where the 1/√2 is a normalization that is sometimes omitted.

Fast Walsh–Hadamard transform This is a faster way to calculate the Walsh spectrum of (1,0,1,0,0,1,1,0).

For m > 1, we can also define Hm by: Hm = H1 ⊗ Hm−1 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

The original function can be expressed by means of its Walsh spectrum as an arithmetical polynomial.

k=

m−1 ∑

ki 2i = km−1 2m−1 +km−2 2m−2 +· · ·+k1 2+k0

i=0

the Walsh–Hadamard transform, Hadamard– and Rademacher–Walsh transform, Walsh transform, or Walsh–Fourier transform) is an example of a m−1 ∑ generalized class of Fourier transforms. It performs an n = ni 2i = nm−1 2m−1 +nm−2 2m−2 +· · ·+n1 2+n0 orthogonal, symmetric, involutive, linear operation on i=0 1

2

3 QUANTUM COMPUTING APPLICATIONS

where the kj and nj are the binary digits (0 or 1) of k and n, respectively. Note that for the element in the top left corner, we define: k = n = 0 . In this case, we have:

3 Quantum computing applications Further information: Quantum gate § Hadamard gate

(Hm )k,n =

∑ 1 j kj nj m (−1) 22

In quantum information processing the Hadamard transformation, more often called Hadamard gate in this This is exactly the multidimensional 2 × 2 × ··· × 2 × 2 DFT, context (cf. quantum gate), is a one-qubit rotation, mapnormalized to be unitary, if the inputs and outputs are ping the qubit-basis states |0⟩ and |1⟩ to two superposition regarded as multidimensional arrays indexed by the nj and states with equal weight of the computational basis states |0⟩ and |1⟩ . Usually the phases are chosen so that we kj, respectively. have Some examples of the Hadamard matrices follow.

H0 = + 1 ( 1 1 H1 = √ 2 1

H= 1 −1

)

|0⟩ + |1⟩ |0⟩ − |1⟩ √ ⟨0| + √ ⟨1| 2 2

in Dirac notation. This corresponds to the transformation matrix

(This H 1 is precisely the size-2 DFT. It can also be re( garded as the Fourier transform on the two-element ad1 1 √ H = ditive group of Z/(2).) 1 2 1 

1 1 1 1 −1 H2 =  1 2 1 1 −1  1 1  1 −1   1 1  1  1 −1 H3 = 3  1 22   1  1 −1   1 1 1 −1 1 (Hn )i,j = n (−1)i·j 22

1 −1   −1  1

1 1 −1 −1 1 1 −1 −1

1 −1 −1 1 1 −1 −1 1

1 1 1 1 −1 −1 −1 −1

)

in the |0⟩, |1⟩ basis.



1 1 −1 −1

1 −1

1 −1 1 −1 −1 1 −1 1

1 1 −1 −1 −1 −1 1 1

Many quantum algorithms use the Hadamard transform as an initial step, since it maps n qubits initialized with |0⟩ to a superposition of all 2n orthogonal states in the |0⟩, |1⟩ basis  with equal weight. 1 It is useful to note that computing the quantum Hadamard  −1  transform is simply the application of a Hadamard gate  −1  qubit individually because of the tensor product to each 1   structure of the Hadamard transform. This simple result  −1  the quantum Hadamard transform requires n opmeans 1   compared to the classical case of n log n operaerations, 1  tions. −1

3.1 Hadamard gate operations

where i · j is the bitwise dot product of the binary repre- H(|1⟩) = √1 |0⟩ − √1 |1⟩ 2 2 sentations of the numbers i and j. For example, if n≥2 , then (Hn )3,2 = (−1)3·2 = (−1)(1,1)·(1,0) = (−1)1+0 = (−1)1 = 1 1 −1 , agreeing with the above (ignoring the overall con- H(|0⟩) = √ |0⟩ + √ |1⟩ 2 2 stant). Note that the first row, first column of the matrix ( ) 1 1 1 1 is denoted by (Hn )0,0 . H √ |0⟩ + √ |1⟩ = (|0⟩+|1⟩)+ (|0⟩−|1⟩) = |0⟩ 2 2 2 2 The rows of the Hadamard matrices are the Walsh func( ) tions. 1 1 1 1 H √ |0⟩ − √ |1⟩ = (|0⟩+|1⟩)− (|0⟩−|1⟩) = |1⟩ 2 2 2 2 One application of the Hadamard gate to either a 0 or 1 qubit will produce a quantum state that, if observed, will 2 Computational complexity 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 The Hadamard transform can be computed in n log n op- standard probabilistic model of computation. However, erations (n = 2m ), using the fast Hadamard transform al- if the Hadamard gate is applied twice in succession (as gorithm. is effectively being done in the last two operations), then

3 the final state is always the same as the initial state. This would be like taking a fair coin that is showing heads, flipping it twice, and it always [ ]landing on heads after the 1 second flip. The ket |0⟩ = 0 [ ] 0 and the ket |1⟩ = . 1

4

Other applications

The Hadamard transform is also used in data encryption, as well as many signal processing and data compression algorithms, such as JPEG XR and MPEG-4 AVC. In video compression applications, it is usually used in the form of the sum of absolute transformed differences. It is also a crucial part of Grover’s algorithm and Shor’s algorithm in quantum computing. The Hadamard transform is also applied in scientific methods such as NMR, mass spectroscopy and crystallography

5

See also • Fast Walsh-Hadamard transform • Pseudo-Hadamard transform • Haar transform • Generalized Distributive Law

6

External links • Ritter, Terry (August 1996). “Walsh-Hadamard Transforms: A Literature Survey”. • Akansu, A.N.; Poluri, R. (July 2007). “WalshLike Nonlinear Phase Orthogonal Codes for Direct Sequence CDMA Communications” (PDF). IEEE Trans. on Signal Processing 55 (7): 3800–6. doi:10.1109/TSP.2007.894229. • Pan, Jeng-shyang Data Encryption Method Using Discrete Fractional Hadamard Transformation (May 28, 2009) • Beddard, Godfrey; Yorke, Briony A. (January 2011). “Pump-probe Spectroscopy using Hadamard Transforms” (PDF). • Yorke, Briony A.; Beddard, Godfrey; Owen, Robin L.; Pearson, Arwen R. (September “Time-resolved crystallography using 2014). the Hadamard transform” (HTML). Nature Methods. doi:10.1038/nmeth.3139.

7 References [1] Compare Figure 1 in Townsend, W. J.; Thornton, M. A. “Walsh Spectrum Computations Using Cayley Graphs”. CiteSeerX: 10.1.1.74.8029. [2] Kunz, H.O. (1979). “On the Equivalence Between One-Dimensional Discrete Walsh-Hadamard and Multidimensional Discrete Fourier Transforms”. IEEE Transactions on Computers 28 (3): 267–8. doi:10.1109/TC.1979.1675334.

4

8 TEXT AND IMAGE SOURCES, CONTRIBUTORS, AND LICENSES

8

Text and image sources, contributors, and licenses

8.1

Text

• Hadamard transform Source: https://en.wikipedia.org/wiki/Hadamard_transform?oldid=713458654 Contributors: Stevertigo, Michael Hardy, Karada, Stevenj, AugPi, Charles Matthews, Reina riemann, Phil Boswell, Sanders muc, RedWolf, Giftlite, BenFrantzDale, Eequor, CSTAR, Urhixidur, Andreas Kaufmann, Bender235, Remuel, Dark Shikari, Algocu, Isnow, Lovro, SmackBot, RDBrown, Oli Filth, Nbarth, BlindWanderer, Lotte Monz, Harish victory, Jqshenker, JaGa, LordAnubisBOT, McSly, Ahshabazz, Redtigerxyz, GirasoleDE, Cnotgate, Mild Bill Hiccup, Watchduck, Timato, Bender2k14, Addbot, TutterMouse, Hatom, Matěj Grabovský, Yobot, Ptbotgourou, Citation bot, Chjoaygame, John85, MastiBot, Christoph hausner, Episanty, ArchivalDad66, DustinIngram, SrijitaK, Kushalsatrasala, Pawel Lachowicz, BowlAndSpoon and Anonymous: 50

8.2

Images

• File:1010_0110_Walsh_spectrum_(fast_WHT).svg Source: https://upload.wikimedia.org/wikipedia/commons/5/58/1010_0110_ Walsh_spectrum_%28fast_WHT%29.svg License: Public domain Contributors: Own work Original artist: Lipedia • File:1010_0110_Walsh_spectrum_(polynomial).svg Source: https://upload.wikimedia.org/wikipedia/commons/5/5d/1010_0110_ Walsh_spectrum_%28polynomial%29.svg License: Public domain Contributors: Own work Original artist: Watchduck (a.k.a. Tilman Piesk) • File:1010_0110_Walsh_spectrum_(single_row).svg Source: https://upload.wikimedia.org/wikipedia/commons/a/aa/1010_0110_ Walsh_spectrum_%28single_row%29.svg License: Public domain Contributors: Own work Original artist: Lipedia

8.3

Content license

• Creative Commons Attribution-Share Alike 3.0