|
|
Line 1: |
Line 1: |
| {{distinguish|Walsh matrix}}
| | I am Isobel from Nieuwenhove. I love to play Bass Guitar. Other hobbies are Record collecting.<br><br>my webpage; [http://fishingrodbuilder.com/index.php?do=/profile-26061/info/ 4inkjets Coupon Code Free Shipping] |
| [[File:1010 0110 Walsh spectrum (single row).svg|thumb|300px|The [[matrix multiplication|product]] of a [[Boolean function]] and a [[Walsh matrix]] is its Walsh spectrum:<ref>Compare Figure 1 in {{cite paper | id = {{citeseerx|10.1.1.74.8029}} | title = Walsh Spectrum Computations Using Cayley Graphs | first1 = W. J. | last1 = Townsend | first2 = M. A. | last2 = Thornton }}</ref><br>(1,0,1,0,0,1,1,0) * H(8) = (4,2,0,−2,0,2,0,2)]]
| |
| [[File:1010 0110 Walsh spectrum (fast WHT).svg|thumb|300px|[[Fast Walsh–Hadamard transform]]<br>This is a faster way to calculate the Walsh spectrum of (1,0,1,0,0,1,1,0).]]
| |
| [[File:1010 0110 Walsh spectrum (polynomial).svg|thumb|300px|The original function can be expressed by means of its Walsh spectrum as an arithmetical polynomial.]]
| |
| 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 transform]]s. It performs an [[orthogonal matrix|orthogonal]], [[symmetric matrix|symmetric]], [[Involution (mathematics)|involutional]], [[linear operator|linear operation]] on <math>2^m</math> [[real number]]s (or [[complex number]]s, although the Hadamard matrices themselves are purely real).
| |
| | |
| The Hadamard transform can be regarded as being built out of size-2 [[discrete Fourier transform]]s (DFTs), and is in fact equivalent to a multidimensional DFT of size <math>2\times2\times\cdots\times2\times2</math>.<ref>{{cite journal |first=H.O. |last=Kunz |title=On the Equivalence Between One-Dimensional Discrete Walsh-Hadamard and Multidimensional Discrete Fourier Transforms |journal=IEEE Transactions on Computers |volume=28 |issue=3 |pages=267–8 |year=1979 |doi=10.1109/TC.1979.1675334 |url=http://doi.ieeecomputersociety.org/10.1109/TC.1979.1675334}}</ref> It decomposes an arbitrary input vector into a superposition of [[Walsh function]]s.
| |
| | |
| The transform is named for the [[France|French]] [[mathematician]] [[Jacques Hadamard]], the German-American mathematician [[Hans Rademacher]], and the American mathematician [[Joseph L. Walsh]].
| |
| ==Definition==
| |
| | |
| The Hadamard transform ''H''<sub>''m''</sub> is a 2<sup>''m''</sup> × 2<sup>''m''</sup> matrix, the [[Hadamard matrix]] (scaled by a normalization factor), that transforms 2<sup>''m''</sup> real numbers ''x''<sub>''n''</sub> into 2<sup>''m''</sup> real numbers ''X''<sub>''k''</sub>. The Hadamard transform can be defined in two ways: [[recursively]], or by using the [[binary numeral system|binary]] ([[base (exponentiation)|base]]-2) representation of the indices ''n'' and ''k''.
| |
| | |
| Recursively, we define the 1 × 1 Hadamard transform ''H''<sub>0</sub> by the [[identity matrix|identity]] ''H''<sub>0</sub> = 1, and then define ''H''<sub>''m''</sub> for ''m'' > 0 by:
| |
| | |
| :<math>H_m = \frac{1}{\sqrt2} \begin{pmatrix} H_{m-1} & H_{m-1} \\ H_{m-1} & -H_{m-1} \end{pmatrix}</math>
| |
| | |
| where the 1/√2 is a normalization that is sometimes omitted. 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
| |
| : <math>k = \sum^{m-1}_{i=0} {k_i 2^i} = k_{m-1} 2^{m-1} + k_{m-2} 2^{m-2} + \cdots + k_1 2 + k_0</math>
| |
| | |
| and
| |
| : <math>n = \sum^{m-1}_{i=0} {n_i 2^i} = n_{m-1} 2^{m-1} + n_{m-2} 2^{m-2} + \cdots + n_1 2 + n_0</math>
| |
| | |
| where the ''k''<sub>''j''</sub> and ''n''<sub>''j''</sub> are the binary digits (0 or 1) of ''k'' and ''n'', respectively. Note that for the element in the top left corner, we define: <math>k = n = 0</math>. In this case, we have:
| |
| :<math>\left( H_m \right)_{k,n} = \frac{1}{2^\frac{m}{2}} (-1)^{\sum_j k_j n_j}</math>
| |
| | |
| This is exactly the multidimensional <math>\scriptstyle 2 \,\times\, 2 \,\times\, \cdots \,\times\, 2 \,\times\, 2</math> DFT, normalized to be [[unitary operator|unitary]], if the inputs and outputs are regarded as multidimensional arrays indexed by the ''n''<sub>''j''</sub> and ''k''<sub>''j''</sub>, respectively.
| |
| | |
| Some examples of the Hadamard matrices follow.
| |
| :<math>\begin{align}
| |
| H_0 = &+1\\
| |
| H_1 = \frac{1}{\sqrt2}
| |
| &\begin{pmatrix}\begin{array}{rr}
| |
| 1 & 1\\
| |
| 1 & -1
| |
| \end{array}\end{pmatrix}
| |
| \end{align}</math>
| |
| | |
| (This ''H''<sub>1</sub> is precisely the size-2 DFT. It can also be regarded as the [[Fourier transform]] on the two-element ''additive'' group of '''Z'''/(2).)
| |
| :<math>\begin{align}
| |
| H_2 = \frac{1}{2}
| |
| &\begin{pmatrix}\begin{array}{rrrr}
| |
| 1 & 1 & 1 & 1\\
| |
| 1 & -1 & 1 & -1\\
| |
| 1 & 1 & -1 & -1\\
| |
| 1 & -1 & -1 & 1
| |
| \end{array}\end{pmatrix}\\
| |
| H_3 = \frac{1}{2^{\frac{3}{2}}}
| |
| &\begin{pmatrix}\begin{array}{rrrrrrrr}
| |
| 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 & 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\\
| |
| 1 & -1 & -1 & 1 & -1 & 1 & 1 & -1
| |
| \end{array}\end{pmatrix}\\
| |
| (H_n)_{i,j} = \frac{1}{2^{\frac{n}{2}}} &(-1)^{i \cdot j}
| |
| \end{align}</math>
| |
| | |
| where <math> i \cdot j </math> is the bitwise dot product of the binary representations of the numbers i and j. For example, if <math>\scriptstyle n \geq 2 </math>, then <math>\scriptstyle ({H_n})_{3,2} \;=\; (-1)^{3 \cdot 2} \;=\; (-1)^{(1,1) \cdot (1,0)} \;=\; (-1)^{1+0} \;=\; (-1)^1 \;=\; -1</math>, agreeing with the above (ignoring the overall constant). Note that the first row, first column of the matrix is denoted by <math>\scriptstyle ({H_n})_{0,0} </math>.
| |
| | |
| The rows of the Hadamard matrices are the [[Walsh function]]s.
| |
| | |
| ==Quantum computing applications==
| |
| In [[quantum information processing]] the Hadamard transformation, more often called '''Hadamard gate''' in this context (cf. [[quantum gate]]), is a one-[[qubit]] [[rotation]], mapping the qubit-basis states <math>|0 \rangle </math> and <math>|1 \rangle </math> to two superposition states with equal weight of the computational basis states <math>|0 \rangle </math> and <math>|1 \rangle </math>. Usually the phases are chosen so that we have
| |
| :<math>H=\frac{|0\rangle+|1\rangle}{\sqrt{2}}\langle0|+\frac{|0\rangle-|1\rangle}{\sqrt{2}}\langle1|</math>
| |
| | |
| in [[Dirac notation]]. This corresponds to the [[transformation matrix]]
| |
| :<math>H_1=\frac{1}{\sqrt{2}}\begin{pmatrix} 1 & 1 \\ 1 & -1 \end{pmatrix}</math>
| |
| | |
| in the <math>|0 \rangle , |1 \rangle </math> basis.
| |
| | |
| Many [[quantum algorithm]]s use the Hadamard transform as an initial step, since it maps ''n'' qubits initialized with <math>|0 \rangle</math> to a superposition of all 2<sup>''n''</sup> orthogonal states in the <math> |0 \rangle , |1 \rangle </math> basis with equal weight.
| |
| | |
| ===Hadamard gate operations===
| |
| :<math>H(|1\rangle) = \frac{1}{\sqrt{2}}|0\rangle-\frac{1}{\sqrt{2}}|1\rangle</math>
| |
| | |
| :<math>H(|0\rangle) = \frac{1}{\sqrt{2}}|0\rangle+\frac{1}{\sqrt{2}}|1\rangle</math>
| |
| | |
| :<math>H\left( \frac{1}{\sqrt{2}}|0\rangle-\frac{1}{\sqrt{2}}|1\rangle \right)= \frac{1}{2}( |0\rangle+|1\rangle) - \frac{1}{2}( |0\rangle - |1\rangle) = |1\rangle</math>
| |
| | |
| :<math>H\left( \frac{1}{\sqrt{2}}|0\rangle+\frac{1}{\sqrt{2}}|1\rangle \right)= \frac{1}{\sqrt{2}} \frac{1}{\sqrt{2}}(|0\rangle + |1\rangle) + \frac{1}{\sqrt{2}} \frac{1}{\sqrt{2}}\left( |0\rangle-|1\rangle\right)= |0\rangle</math>
| |
| | |
| 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 Turing machine|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. This would be like taking a fair coin that is showing heads, flipping it twice, and it always landing on heads after the second flip.
| |
| | |
| ==Computational complexity==
| |
| The Hadamard transform can be computed in ''n'' log ''n'' operations (''n'' = 2<sup>''m''</sup>), using the [[fast Hadamard transform]] algorithm.
| |
| | |
| ==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 [[H.264/MPEG-4 AVC|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.
| |
| | |
| ==See also==
| |
| * [[Fast Walsh-Hadamard transform]]
| |
| * [[Pseudo-Hadamard transform]]
| |
| * [[Haar transform]]
| |
| * [[Generalized distributive law|Generalized Distributive Law]]
| |
| | |
| ==External links==
| |
| *{{cite web |first=Terry |last=Ritter |title=Walsh-Hadamard Transforms: A Literature Survey |date=August 1996 |url=http://www.ciphersbyritter.com/RES/WALHAD.HTM}}
| |
| *{{cite journal |first1=A.N. |last1=Akansu |first2=R. |last2=Poluri |title=Walsh-Like Nonlinear Phase Orthogonal Codes for Direct Sequence CDMA Communications |journal=IEEE Trans. on Signal Processing |volume=55 |issue=7 |pages=3800–6 |date=July 2007 |doi=10.1109/TSP.2007.894229 |url=http://web.njit.edu/~akansu/PAPERS/Akansu-Poluri-WALSH-LIKE2007.pdf |format=PDF}}
| |
| * Pan, Jeng-shyang [http://www.freepatentsonline.com/y2009/0136023.html Data Encryption Method Using Discrete Fractional Hadamard Transformation] (May 28, 2009)
| |
| *{{cite web |first=Godfrey |last=Beddard |title=Pump-probe Spectroscopy using Hadamard Transforms |date=January 2011 |url=http://www1.chem.leeds.ac.uk/People/GSB/Hadamard_for_web.pdf |format=PDF}}
| |
| | |
| ==References==
| |
| {{reflist}}
| |
| | |
| {{DEFAULTSORT:Hadamard Transform}}
| |
| [[Category:Quantum algorithms]]
| |
| [[Category:Transforms]]
| |