<s>
The	O
Hadamard	B-Algorithm
transform	I-Algorithm
(	O
also	O
known	O
as	O
the	O
Walsh	B-Algorithm
–	I-Algorithm
Hadamard	I-Algorithm
transform	I-Algorithm
,	O
Hadamard	O
–	O
Rademacher	O
–	O
Walsh	B-Algorithm
transform	I-Algorithm
,	O
Walsh	B-Algorithm
transform	I-Algorithm
,	O
or	O
Walsh	O
–	O
Fourier	B-Algorithm
transform	I-Algorithm
)	O
is	O
an	O
example	O
of	O
a	O
generalized	O
class	O
of	O
Fourier	B-Algorithm
transforms	I-Algorithm
.	O
</s>
<s>
It	O
performs	O
an	O
orthogonal	B-Algorithm
,	O
symmetric	B-Algorithm
,	O
involutive	B-Algorithm
,	O
linear	B-Architecture
operation	I-Architecture
on	O
real	O
numbers	O
(	O
or	O
complex	O
,	O
or	O
hypercomplex	O
numbers	O
,	O
although	O
the	O
Hadamard	O
matrices	O
themselves	O
are	O
purely	O
real	O
)	O
.	O
</s>
<s>
The	O
Hadamard	B-Algorithm
transform	I-Algorithm
can	O
be	O
regarded	O
as	O
being	O
built	O
out	O
of	O
size-2	O
discrete	B-Algorithm
Fourier	I-Algorithm
transforms	I-Algorithm
(	O
DFTs	O
)	O
,	O
and	O
is	O
in	O
fact	O
equivalent	O
to	O
a	O
multidimensional	O
DFT	O
of	O
size	O
.	O
</s>
<s>
The	O
Hadamard	B-Algorithm
transform	I-Algorithm
Hm	O
is	O
a	O
2m×2m	O
matrix	O
,	O
the	O
Hadamard	O
matrix	O
(	O
scaled	O
by	O
a	O
normalization	O
factor	O
)	O
,	O
that	O
transforms	O
2m	O
real	O
numbers	O
xn	O
into	O
2m	O
real	O
numbers	O
Xk	O
.	O
</s>
<s>
The	O
Hadamard	B-Algorithm
transform	I-Algorithm
can	O
be	O
defined	O
in	O
two	O
ways	O
:	O
recursively	O
,	O
or	O
by	O
using	O
the	O
binary	O
(	O
base-2	O
)	O
representation	O
of	O
the	O
indices	O
n	O
and	O
k	O
.	O
</s>
<s>
Recursively	O
,	O
we	O
define	O
the	O
1×1	O
Hadamard	B-Algorithm
transform	I-Algorithm
H0	O
by	O
the	O
identity	B-Algorithm
H0	O
=	O
1	O
,	O
and	O
then	O
define	O
Hm	O
for	O
m>0	O
by	O
:	O
</s>
<s>
This	O
is	O
exactly	O
the	O
multidimensional	O
DFT	O
,	O
normalized	O
to	O
be	O
unitary	B-Algorithm
,	O
if	O
the	O
inputs	O
and	O
outputs	O
are	O
regarded	O
as	O
multidimensional	O
arrays	O
indexed	O
by	O
the	O
nj	O
and	O
kj	O
,	O
respectively	O
.	O
</s>
<s>
It	O
can	O
also	O
be	O
regarded	O
as	O
the	O
Fourier	B-Algorithm
transform	I-Algorithm
on	O
the	O
two-element	O
additive	O
group	O
of	O
Z/	O
( 2	O
)	O
.	O
</s>
<s>
In	O
the	O
Walsh	B-Algorithm
transform	I-Algorithm
,	O
only	O
1	O
and	O
−1	O
will	O
appear	O
in	O
the	O
matrix	O
.	O
</s>
<s>
The	O
DFT	O
needs	O
irrational	O
multiplication	O
,	O
while	O
the	O
hadamard	B-Algorithm
transform	I-Algorithm
does	O
not	O
.	O
</s>
<s>
In	O
the	O
Walsh	B-Algorithm
transform	I-Algorithm
matrix	O
,	O
all	O
entries	O
in	O
the	O
first	O
row	O
(	O
and	O
column	O
)	O
are	O
equal	O
to	O
1	O
.	O
</s>
<s>
In	O
discrete	B-Algorithm
Fourier	I-Algorithm
transform	I-Algorithm
,	O
when	O
m	O
equal	O
to	O
zeros	O
(	O
mean	O
first	O
row	O
)	O
,	O
the	O
result	O
of	O
DFT	O
also	O
is	O
1	O
.	O
</s>
<s>
The	O
Hadamard	B-Algorithm
transform	I-Algorithm
is	O
in	O
fact	O
equivalent	O
to	O
a	O
multidimensional	O
DFT	O
of	O
size	O
.	O
</s>
<s>
Another	O
approach	O
is	O
to	O
view	O
the	O
Hadamard	B-Algorithm
transform	I-Algorithm
as	O
a	O
Fourier	B-Algorithm
transform	I-Algorithm
on	O
the	O
Boolean	O
group	O
.	O
</s>
<s>
This	O
is	O
the	O
Hadamard	B-Algorithm
transform	I-Algorithm
of	O
,	O
considering	O
the	O
input	O
to	O
and	O
as	O
boolean	O
strings	O
.	O
</s>
<s>
In	O
terms	O
of	O
the	O
above	O
formulation	O
where	O
the	O
Hadamard	B-Algorithm
transform	I-Algorithm
multiplies	O
a	O
vector	O
of	O
complex	O
numbers	O
on	O
the	O
left	O
by	O
the	O
Hadamard	O
matrix	O
the	O
equivalence	O
is	O
seen	O
by	O
taking	O
to	O
take	O
as	O
input	O
the	O
bit	O
string	O
corresponding	O
to	O
the	O
index	O
of	O
an	O
element	O
of	O
,	O
and	O
having	O
output	O
the	O
corresponding	O
element	O
of	O
.	O
</s>
<s>
Compare	O
this	O
to	O
the	O
usual	O
discrete	B-Algorithm
Fourier	I-Algorithm
transform	I-Algorithm
which	O
when	O
applied	O
to	O
a	O
vector	O
of	O
complex	O
numbers	O
instead	O
uses	O
characters	O
of	O
the	O
cyclic	O
group	O
.	O
</s>
<s>
In	O
the	O
classical	O
domain	O
,	O
the	O
Hadamard	B-Algorithm
transform	I-Algorithm
can	O
be	O
computed	O
in	O
operations	O
(	O
)	O
,	O
using	O
the	O
fast	B-Algorithm
Hadamard	I-Algorithm
transform	I-Algorithm
algorithm	O
.	O
</s>
<s>
In	O
the	O
quantum	O
domain	O
,	O
the	O
Hadamard	B-Algorithm
transform	I-Algorithm
can	O
be	O
computed	O
in	O
time	O
,	O
as	O
it	O
is	O
a	O
quantum	O
logic	O
gate	O
that	O
can	O
be	O
parallelized	O
.	O
</s>
<s>
The	O
Hadamard	B-Algorithm
transform	I-Algorithm
is	O
used	O
extensively	O
in	O
quantum	B-Architecture
computing	I-Architecture
.	O
</s>
<s>
In	O
quantum	B-Architecture
computing	I-Architecture
,	O
the	O
Hadamard	O
gate	O
is	O
a	O
one-qubit	O
rotation	O
,	O
mapping	O
the	O
qubit-basis	O
states	O
and	O
to	O
two	O
superposition	O
states	O
with	O
equal	O
weight	O
of	O
the	O
computational	O
basis	O
states	O
and	O
.	O
</s>
<s>
The	O
states	O
and	O
are	O
known	O
as	O
and	O
respectively	O
,	O
and	O
together	O
constitute	O
the	O
polar	O
basis	O
in	O
quantum	B-Architecture
computing	I-Architecture
.	O
</s>
<s>
Computing	O
the	O
quantum	O
Hadamard	B-Algorithm
transform	I-Algorithm
is	O
simply	O
the	O
application	O
of	O
a	O
Hadamard	O
gate	O
to	O
each	O
qubit	O
individually	O
because	O
of	O
the	O
tensor	O
product	O
structure	O
of	O
the	O
Hadamard	B-Algorithm
transform	I-Algorithm
.	O
</s>
<s>
This	O
simple	O
result	O
means	O
the	O
quantum	O
Hadamard	B-Algorithm
transform	I-Algorithm
requires	O
log	O
n	O
operations	O
,	O
compared	O
to	O
the	O
classical	O
case	O
of	O
nlogn	O
operations	O
.	O
</s>
<s>
Many	O
quantum	B-Device
algorithms	I-Device
use	O
the	O
Hadamard	B-Algorithm
transform	I-Algorithm
as	O
an	O
initial	O
step	O
,	O
since	O
it	O
maps	O
m	O
qubits	O
initialized	O
with	O
to	O
a	O
superposition	O
of	O
all	O
2m	O
orthogonal	B-Algorithm
states	O
in	O
the	O
basis	O
with	O
equal	O
weight	O
.	O
</s>
<s>
For	O
example	O
,	O
this	O
is	O
used	O
in	O
the	O
Deutsch	B-Algorithm
–	I-Algorithm
Jozsa	I-Algorithm
algorithm	I-Algorithm
,	O
Simon	B-Algorithm
's	I-Algorithm
algorithm	I-Algorithm
,	O
the	O
Bernstein	O
–	O
Vazirani	O
algorithm	O
,	O
and	O
in	O
Grover	B-Algorithm
's	I-Algorithm
algorithm	I-Algorithm
.	O
</s>
<s>
Note	O
that	O
Shor	B-Algorithm
's	I-Algorithm
algorithm	I-Algorithm
uses	O
both	O
an	O
initial	O
Hadamard	B-Algorithm
transform	I-Algorithm
,	O
as	O
well	O
as	O
the	O
quantum	B-Algorithm
Fourier	I-Algorithm
transform	I-Algorithm
,	O
which	O
are	O
both	O
types	O
of	O
Fourier	B-Algorithm
transforms	I-Algorithm
on	O
finite	O
groups	O
;	O
the	O
first	O
on	O
and	O
the	O
second	O
on	O
.	O
</s>
<s>
The	O
Hadamard	B-Algorithm
transform	I-Algorithm
can	O
be	O
used	O
to	O
estimate	O
phylogenetic	O
trees	O
from	O
molecular	O
data	O
.	O
</s>
<s>
A	O
Hadamard	B-Algorithm
transform	I-Algorithm
applied	O
to	O
a	O
vector	O
(	O
or	O
matrix	O
)	O
of	O
site	O
pattern	O
frequencies	O
obtained	O
from	O
a	O
DNA	O
multiple	O
sequence	O
alignment	O
can	O
be	O
used	O
to	O
generate	O
another	O
vector	O
that	O
carries	O
information	O
about	O
the	O
tree	O
topology	O
.	O
</s>
<s>
The	O
invertible	O
nature	O
of	O
the	O
phylogenetic	O
Hadamard	B-Algorithm
transform	I-Algorithm
also	O
allows	O
the	O
calculation	O
of	O
site	O
likelihoods	O
from	O
a	O
tree	O
topology	O
vector	O
,	O
allowing	O
one	O
to	O
use	O
the	O
Hadamard	B-Algorithm
transform	I-Algorithm
for	O
maximum	O
likelihood	O
estimation	O
of	O
phylogenetic	O
trees	O
.	O
</s>
<s>
However	O
,	O
the	O
invertible	O
nature	O
of	O
the	O
phylogenetic	O
Hadamard	B-Algorithm
transform	I-Algorithm
does	O
provide	O
an	O
elegant	O
tool	O
for	O
mathematic	O
phylogenetics	O
.	O
</s>
<s>
The	O
mechanics	O
of	O
the	O
phylogenetic	O
Hadamard	B-Algorithm
transform	I-Algorithm
involve	O
the	O
calculation	O
of	O
a	O
vector	O
that	O
provides	O
information	O
about	O
the	O
topology	O
and	O
branch	O
lengths	O
for	O
tree	O
using	O
the	O
site	O
pattern	O
vector	O
or	O
matrix	O
.	O
</s>
<s>
The	O
example	O
shown	O
in	O
this	O
table	O
uses	O
the	O
simplified	O
three	O
equation	O
scheme	O
and	O
it	O
is	O
for	O
a	O
four	O
taxon	O
tree	O
that	O
can	O
be	O
written	O
as	O
((A , B )	O
,	O
(	O
C	O
,	O
D	O
)	O
)	O
;	O
in	O
newick	B-Data_Structure
format	I-Data_Structure
.	O
</s>
<s>
This	O
particular	O
tree	O
has	O
two	O
long	O
terminal	O
branches	O
(	O
0.2	O
transversion	O
substitutions	O
per	O
site	O
)	O
,	O
two	O
short	O
terminal	O
branches	O
(	O
0.025	O
transversion	O
substitutions	O
per	O
site	O
)	O
,	O
and	O
a	O
short	O
internal	O
branch	O
(	O
0.025	O
transversion	O
substitutions	O
per	O
site	O
)	O
;	O
thus	O
,	O
it	O
would	O
be	O
written	O
as	O
( ( 	O
A:0.025	O
,	O
B:0.2	O
)	O
:0.025	O
,	O
(	O
C:0.025	O
,	O
D:0.2	O
)	O
)	O
;	O
in	O
newick	B-Data_Structure
format	I-Data_Structure
.	O
</s>
<s>
Obviously	O
,	O
the	O
invertible	O
nature	O
of	O
the	O
phylogenetic	O
Hadamard	B-Algorithm
transform	I-Algorithm
means	O
that	O
the	O
tree	O
vector	O
means	O
that	O
the	O
tree	O
vector	O
corresponds	O
to	O
the	O
correct	O
tree	O
.	O
</s>
<s>
The	O
Hadamard	B-Algorithm
transform	I-Algorithm
is	O
also	O
used	O
in	O
data	O
encryption	O
,	O
as	O
well	O
as	O
many	O
signal	O
processing	O
and	O
data	B-General_Concept
compression	I-General_Concept
algorithms	I-General_Concept
,	O
such	O
as	O
JPEG	B-Device
XR	I-Device
and	O
MPEG-4	B-Application
AVC	I-Application
.	O
</s>
<s>
In	O
video	O
compression	O
applications	O
,	O
it	O
is	O
usually	O
used	O
in	O
the	O
form	O
of	O
the	O
sum	B-Algorithm
of	I-Algorithm
absolute	I-Algorithm
transformed	I-Algorithm
differences	I-Algorithm
.	O
</s>
<s>
It	O
is	O
also	O
a	O
crucial	O
part	O
of	O
significant	O
number	O
of	O
algorithms	O
in	O
quantum	B-Architecture
computing	I-Architecture
.	O
</s>
<s>
The	O
Hadamard	B-Algorithm
transform	I-Algorithm
is	O
also	O
applied	O
in	O
experimental	O
techniques	O
such	O
as	O
NMR	O
,	O
mass	O
spectrometry	O
and	O
crystallography	O
.	O
</s>
<s>
It	O
is	O
additionally	O
used	O
in	O
some	O
versions	O
of	O
locality-sensitive	B-Algorithm
hashing	I-Algorithm
,	O
to	O
obtain	O
pseudo-random	O
matrix	O
rotations	O
.	O
</s>
