matrix_props.is_orthonormal

Checks if the set of vectors are orthonormal.

Functions

is_orthonormal(vectors)

Check if the vectors are orthonormal.

Module Contents

matrix_props.is_orthonormal.is_orthonormal(vectors)

Check if the vectors are orthonormal.

Examples

The following vectors are an example of an orthonormal set of vectors in \(\mathbb{R}^3\).

\[\begin{split}\begin{pmatrix} 1 \\ 0 \\ 1 \end{pmatrix}, \quad \begin{pmatrix} 1 \\ 1 \\ 0 \end{pmatrix}, \quad \text{and} \quad \begin{pmatrix} 0 \\ 0 \\ 1 \end{pmatrix}\end{split}\]

To check these are a known set of orthonormal vectors:

>>> import numpy as np
>>> from toqito.matrix_props import is_orthonormal
>>> v_1 = np.array([1, 0, 0])
>>> v_2 = np.array([0, 1, 0])
>>> v_3 = np.array([0, 0, 1])
>>> v = np.array([v_1, v_2, v_3])
>>> is_orthonormal(v)
True
Parameters:

vectors (list[numpy.ndarray]) – A list of np.ndarray 1-by-n vectors.

Returns:

True if vectors are orthonormal; False otherwise.

Return type:

bool