HadamardMatrix

HadamardMatrix[n]

returns an n×n Hadamard matrix.

Details and Options

  • Each entry Hrs of the Hadamard matrix is by default defined as , where , is the ^(th) 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 Automaticspecify 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.
  • HadamardMatrix[,TargetStructure] specifies the structure of the returned matrix. Possible settings for TargetStructure include:
  • Automaticautomatically 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
  • HadamardMatrix[,TargetStructureAutomatic] is equivalent to HadamardMatrix[,TargetStructure"Dense"].

Examples

open allclose all

Basic Examples  (1)

A Hadamard matrix:

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:

Wolfram Research (2012), HadamardMatrix, Wolfram Language function, https://reference.wolfram.com/language/ref/HadamardMatrix.html (updated 2024).

Text

Wolfram Research (2012), HadamardMatrix, Wolfram Language function, https://reference.wolfram.com/language/ref/HadamardMatrix.html (updated 2024).

CMS

Wolfram Language. 2012. "HadamardMatrix." Wolfram Language & System Documentation Center. Wolfram Research. Last Modified 2024. https://reference.wolfram.com/language/ref/HadamardMatrix.html.

APA

Wolfram Language. (2012). HadamardMatrix. Wolfram Language & System Documentation Center. Retrieved from https://reference.wolfram.com/language/ref/HadamardMatrix.html

BibTeX

@misc{reference.wolfram_2024_hadamardmatrix, author="Wolfram Research", title="{HadamardMatrix}", year="2024", howpublished="\url{https://reference.wolfram.com/language/ref/HadamardMatrix.html}", note=[Accessed: 18-December-2024 ]}

BibLaTeX

@online{reference.wolfram_2024_hadamardmatrix, organization={Wolfram Research}, title={HadamardMatrix}, year={2024}, url={https://reference.wolfram.com/language/ref/HadamardMatrix.html}, note=[Accessed: 18-December-2024 ]}