## `linalg::isUnitary` -- test whether a matrix is unitary

#### Introduction

`linalg::isUnitary` tests whether the matrix A is a unitary matrix. An n x n matrix A is unitary, if A * transpose(conjugate(A)) = I, where I is the n x n identity matrix.

#### Call(s)

`linalg::isUnitary(A)`

#### Parameters

`A` | - | a square matrix of a domain of category `Cat::Matrix`

#### Returns

either `TRUE`, `FALSE`, or `UNKNOWN`.

#### Related Functions

`linalg::orthog`, `linalg::scalarProduct`

#### Details

- The square matrix `A` is a unitary matrix, if and only if the columns of `A` form an orthonormal basis with respect to the scalar product `linalg::scalarProduct` of two vectors.
- The correctness of the result `FALSE` of `linalg::isUnitary` can only be guaranteed if the elements of the component ring R of the matrix `A` are canonically represented, i.e., if each element of R has only one unique representation.
- The axiom `Ax::canonicalRep` states that a domain has this property. Hence, `linalg::isUnitary` returns `FALSE` or `UNKNOWN`, respectively, depending on whether the component ring of `A` has the axiom `Ax::canonicalRep`.
- If the component ring of `A` does not define the method `"conjugate"` then it is checked whether `A` is an orthogonal matrix such that A*transpose(A)=En, where En is the n x n identity matrix.

#### Example 1

The following matrix is unitary:

    >> A := 1/sqrt(5) * matrix([[1, 2], [2, -1]])

                               +-                -+
                               |    1/2      1/2  |
                               |   5      2 5     |
                               |   ----,  ------  |
                               |    5       5     |
                               |                  |
                               |     1/2     1/2  |
                               |  2 5       5     |
                               |  ------, - ----  |
                               |    5        5    |
                               +-                -+

    >> linalg::isUnitary(A)

                                       TRUE

#### Changes

- used to be called `linalg::isOrthogonal`

Do you have questions or comments?
Copyright © SciFace Software GmbH & Co. KG 2000