Accelerating the pace of engineering and science

# linalg::isUnitary

Test whether a matrix is unitary

### Use only in the MuPAD Notebook Interface.

This functionality does not run in MATLAB.

## Syntax

```linalg::isUnitary(A)
```

## Description

linalg::isUnitary tests whether the matrix A is a unitary matrix. An n×n matrix A is unitary, if , where In is the n×n identity matrix.

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 AAt = En, where En is the n×n identity matrix.

## Examples

### Example 1

The following matrix is unitary:

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

`linalg::isUnitary(A)`

## Parameters

 A A square matrix of a domain of category Cat::Matrix

## Return Values

Either TRUE, FALSE, or UNKNOWN.