import pyLHD
pyLHD.sylvester(n=4)array([[ 1, 1, 1, 1],
[ 1, -1, 1, -1],
[ 1, 1, -1, -1],
[ 1, -1, -1, 1]])
hadamard.sylvester(n)
Hadamard matrix based on Sylvester’s construction
| Name | Type | Description | Default |
|---|---|---|---|
n |
int | The order of the matrix. n must be a power of 2. | required |
| Type | Description |
|---|---|
| ValueError | If n is not a positive integer and not a power of 2. |
| Type | Description |
|---|---|
| numpy.numpy.ndarray | The Hadamard matrix of order n. |
Examples:
array([[ 1, 1, 1, 1],
[ 1, -1, 1, -1],
[ 1, 1, -1, -1],
[ 1, -1, -1, 1]])