### Navigation

- index
- modules |
- modules |
- next |
- previous |
- SciPy v0.12 Reference Guide (DRAFT) »
- Linear algebra (`scipy.linalg`) »

# scipy.linalg.hadamard

`scipy.linalg.``hadamard`(n, dtype=<type 'int'>)

  Construct a Hadamard matrix.

  Constructs an n-by-n Hadamard matrix, using Sylvester’s construction. n must be a power of 2.

  Parameters : | n : int The order of the matrix. n must be a power of 2. dtype : numpy dtype The data type of the array to be constructed.
  Returns : | H : (n, n) ndarray The Hadamard matrix.

  Notes

  New in version 0.8.0.

  Examples

      >>> from scipy.linalg import hadamard
      >>> hadamard(2, dtype=complex)
      array([[ 1.+0.j,  1.+0.j],
             [ 1.+0.j, -1.-0.j]])
      >>> hadamard(4)
      array([[ 1,  1,  1,  1],
             [ 1, -1,  1, -1],
             [ 1,  1, -1, -1],
             [ 1, -1, -1,  1]])

### Navigation

- index
- modules |
- modules |
- next |
- previous |
- SciPy v0.12 Reference Guide (DRAFT) »
- Linear algebra (`scipy.linalg`) »