UnitaryMatrixQ
Details and Options
 A p×q matrix m is unitary if p≥q and ConjugateTranspose[m].m is the q×q identity matrix, or p≤q and m.ConjugateTranspose[m] is the p×p identity matrix.
 UnitaryMatrixQ works for symbolic as well as numerical matrices.
 The following options can be given:

Normalized True test if matrix columns are normalized SameTest Automatic function to test equality of expressions Tolerance Automatic tolerance for approximate numbers  For exact and symbolic matrices, the option SameTest>f indicates that two entries a_{ij} and b_{ij} are taken to be equal if f[a_{ij},b_{ij}] gives True.
 For approximate matrices, the option Tolerance>t can be used to indicate that the norm γ=m.m^{}I_{n}_{∞} satisfying γ≤t is taken to be zero where I_{n} is the identity matrix.
Examples
open allclose allBasic Examples (2)
Scope (14)
Basic Uses (6)
Test if a real matrix is unitary:
A real unitary matrix is also orthogonal:
Test if a complex matrix is unitary:
Test if an exact matrix is unitary:
Use UnitaryMatrixQ with an arbitraryprecision matrix:
A random matrix is typically not unitary:
Use UnitaryMatrixQ with a symbolic matrix:
The matrix becomes unitary when and :
UnitaryMatrixQ works efficiently with large numerical matrices:
Special Matrices (4)
Use UnitaryMatrixQ with sparse matrices:
Use UnitaryMatrixQ with structured matrices:
The identity matrix is unitary:
HilbertMatrix is not unitary:
Rectangular Semiunitary Matrices (4)
Test if a rectangular matrix is semiunitary:
As there are more columns than rows, this indicates that the rows are orthonormal:
The columns are not orthonormal:
Test a matrix with more rows than columns:
The columns of the matrix are orthonormal:
Generate a random unitary matrix:
Any subset of its rows forms a rectangular semiunitary matrix:
Options (4)
Normalized (2)
Symbolic unitary matrix columns are often not normalized to 1:
Avoid testing if the columns are normalized:
Multiply the second column of a unitary matrix by 2:
UnitaryMatrixQ with NormalizedFalse will still give True for m:
However, it will not give true for ConjugateTranspose[m]:
SameTest (1)
This matrix is unitary for a positive real , but UnitaryMatrixQ gives False:
Use the option SameTest to get the correct answer:
Applications (9)
Sources of Unitary Matrices (4)
Any orthonormal basis for forms a unitary matrix:
Putting the basis vectors in rows of a matrix forms a unitary matrix:
Putting them in columns also gives a unitary matrix:
Orthogonalize applied to linearly independent, complex vectors generates a unitary matrix:
The matrix does not need to be square, in which case the resulting matrix is semiunitary:
But the starting matrix must have full rank:
Any permutation matrix is unitary:
Matrices drawn from CircularUnitaryMatrixDistribution are unitary:
So are matrices drawn from CircularOrthogonalMatrixDistribution:
As are matrices from CircularSymplecticMatrixDistribution:
Uses of Unitary Matrices (5)
Unitary matrices preserve the standard inner product on . In other words, if is unitary and and are vectors, then :
This means the angles between the vectors are unchanged:
Since the norm is derived from the inner product, norms are preserved as well:
Unitary matrices play an important role in many matrix decompositions:
The matrix is always unitary for any nonzero vector :
is called a Householder reflection; as a pure reflection, its determinant is :
It represents a reflection through a plane perpendicular to , sending to :
Any vector perpendicular to is unchanged by :
In matrix computations, is used to set to zero selected components of a given column vector :
In quantum mechanics, time evolution is represented by a 1parameter family of unitary matrices . times the logarithmic derivative of is a Hermitian matrix called the Hamiltonian or energy operator . Its eigenvalues represent the possible energies of the system. For the following time evolution, compute the Hamiltonian and possible energies:
First, verify the matrices are, in fact, unitary:
Compute the logarithmic derivative:
Verify that the matrix is Hermitian:
Its real eigenvalues represent the possible energies:
The exponential MatrixExp[v] of an antihermitian matrix is unitary. Define a matrix function through its differential equation with initial value and show that the solution is unitary:
Solve and check that the resulting matrix is unitary at each time:
With default settings, you get approximately unitary matrices:
Properties & Relations (14)
A matrix is unitary if m.ConjugateTranspose[m]IdentityMatrix[n]:
For an approximate matrix, the identity is approximately true:
The inverse of a unitary matrix is its conjugate transpose:
Thus, the inverse, transpose, conjugate and conjugate transpose are all unitary matrices as well:
A unitary matrix preserves the standard inner product of vectors in :
As a consequence, unitary matrices preserve norms as well:
Any realvalued orthogonal matrix is unitary:
But a complex unitary matrix is typically not orthogonal:
Products of unitary matrices are unitary:
Unitary matrices have eigenvalues that lie on the unit circle:
Use Eigenvalues to find eigenvalues:
Verify they lie on the unit circle:
Unitary matrices have a complete set of eigenvectors:
As a consequence, they must be diagonalizable:
Use Eigenvectors to find eigenvectors:
The singular values are all 1 for a unitary matrix:
The absolute value of the determinant of a unitary matrix is 1:
The 2norm of a unitary matrix is always 1:
Real powers of unitary matrices are unitary:
MatrixExp[I h] is unitary for any Hermitian matrix h:
UnitaryMatrix can be used to explicitly construct unitary matrices:
These satisfy UnitaryMatrixQ:
Text
Wolfram Research (2014), UnitaryMatrixQ, Wolfram Language function, https://reference.wolfram.com/language/ref/UnitaryMatrixQ.html.
CMS
Wolfram Language. 2014. "UnitaryMatrixQ." Wolfram Language & System Documentation Center. Wolfram Research. https://reference.wolfram.com/language/ref/UnitaryMatrixQ.html.
APA
Wolfram Language. (2014). UnitaryMatrixQ. Wolfram Language & System Documentation Center. Retrieved from https://reference.wolfram.com/language/ref/UnitaryMatrixQ.html