toqito.matrices.hadamard ======================== .. py:module:: toqito.matrices.hadamard .. autoapi-nested-parse:: Generates a Hadamard matrix. Module Contents --------------- .. py:function:: hadamard(n_param = 1) Produce a `2^{n_param}` dimensional Hadamard matrix [@WikiHadamard]. The standard Hadamard matrix that is often used in quantum information as a one-qubit quantum gate is defined as \[ H_1 = \frac{1}{\sqrt{2}} \begin{pmatrix} 1 & 1 \\ 1 & -1 \end{pmatrix} \] In general, the Hadamard matrix of dimension `2^{n_param}` may be defined as \[ \left( H_n \right)_{i, j} = \frac{1}{2^{\frac{n}{2}}} \left(-1\right)^{i \cdot j} \] .. rubric:: Examples The standard 1-qubit Hadamard matrix can be generated in `toqito` as ```python exec="1" source="above" from toqito.matrices import hadamard print(hadamard(1)) ```