# Details and Options

• Each entry Hrs of the Hadamard matrix is by default defined as , where , is the bit in the binary representation of the integer , and .
• must be a power of two.
• Rows or columns of the HadamardMatrix are basis sequences of the DiscreteHadamardTransform.
• The Hadamard matrix is symmetric and orthogonal and is thus its own inverse. »
• The following options are supported:
•  Method Automatic specify the sequency ordering method WorkingPrecision ∞ precision at which to create entries
• The setting of the Method option specifies the sequency ordering (number of zero crossings in the Hadamard basis sequences). Possible settings include:
•  "BitComplement" "GrayCode" Gray code reordering of "BitComplement" "Sequency" sequency increases with row and column index (default)
• The bit complement ordering is also known as the Sylvester ordering.
• The sequency ordering is also known as the Walsh ordering.
• The Gray code ordering is also known as the dyadic ordering or Paley ordering.
• specifies the structure of the returned matrix. Possible settings for TargetStructure include:
•  Automatic automatically choose the representation returned "Dense" represent the matrix as a dense matrix "Hermitian" represent the matrix as a Hermitian matrix "Orthogonal" represent the matrix as an orthogonal matrix "Symmetric" represent the matrix as a symmetric matrix "Unitary" represent the matrix as a unitary matrix

# Examples

open allclose all

## Basic Examples(1)

The Hadamard's basis sequences of length 128:

## Options(3)

### Method(1)

Detect sequency values of rows of a Hadamard matrix:

### TargetStructure(1)

Return the Hadamard matrix as a dense matrix:

Return the Hadamard matrix as a symmetric matrix:

Return the Hadamard matrix as an orthogonal matrix:

### WorkingPrecision(1)

By default, an exact matrix is computed:

Use machine precision:

Use arbitrary precision:

## Properties & Relations(4)

The discrete Hadamard transform of a vector is equivalent to multiplying the vector by the Hadamard matrix:

Sylvester's construction of a Hadamard matrix of order 4:

This corresponds to the bit complement sequency ordering:

The Hadamard matrix is symmetric and orthogonal:

Because of these properties, the Hadamard matrix is its own inverse:

Define the n×n "bit reversal" permutation matrix for n a power of 2:

Define the n×n Gray code permutation matrix for n a power of 2:

Generate Hadamard matrices with different sequency orderings:

The Hadamard matrix with Gray code ordering is equivalent to applying the Gray code permutation to the Hadamard matrix with bit-complement sequency ordering:

The Hadamard matrix with sequency ordering is equivalent to applying the bit-reversal permutation to the Hadamard matrix with Gray code ordering:

The Hadamard matrix with sequency ordering is equivalent to successively applying the bit-reversal permutation and Gray code permutation to the Hadamard matrix with bit-complement sequency ordering: