({{, (RefLink[NormalMatrixQ, paclet:ref/NormalMatrixQ])[m] 
 gives (RefLink[True, paclet:ref/True]) if m is an explicitly normal matrix, and (RefLink[False, paclet:ref/False]) otherwise.}})

OpenersNotesSection(Spacer1)Details and Options

A matrix m is normal if m.(RefLink[ConjugateTranspose, paclet:ref/ConjugateTranspose])[m]==(RefLink[ConjugateTranspose, paclet:ref/ConjugateTranspose])[m].m.

(RefLink[NormalMatrixQ, paclet:ref/NormalMatrixQ]) works for symbolic as well as numerical matrices.

The following options can be given:

For exact and symbolic matrices, the option (RefLink[SameTest, paclet:ref/SameTest])->f indicates that two entries (Subscript[a, ij]) and (Subscript[b, ij]) are taken to be equal if f[(Subscript[a, ij]),(Subscript[b, ij])] gives (RefLink[True, paclet:ref/True]) where a=m.(m^†) and b=(m^†).m.

For approximate matrices, the option (RefLink[Tolerance, paclet:ref/Tolerance])->t can be used to indicate that the norm γ=(Subscript[‖m.(m^†)-(m^†).m‖, ∞]) satisfying γ≤t (Subscript[γ, ∞]) is taken to be zero where (Subscript[γ, ∞]) is the infinity norm of the matrix m.

OpenersPrimaryExamplesSection(Spacer1)Examples  (19)

OpenersExampleSection0(Spacer1)Basic Examples  (1)

Test if a matrix is normal:

NormalMatrixQ[{{1,2,-1},{-1,1,2},{2,-1,1}}]

OpenersExampleSection1(Spacer1)Scope  (5)

A real matrix:

NormalMatrixQ[{{3,-1},{1,3}}]

A complex matrix:

NormalMatrixQ[{{5+I,-2I},{2,4+2I}}]

A sparse matrix:

s = SparseArray[{i_, j_}->(i - j)^2/(i + j)^2,{5,5}]

NormalMatrixQ[s]

An approximate (RefLink[MachinePrecision, paclet:ref/MachinePrecision]) matrix:

NormalMatrixQ[{{1.,3.,-1.},{-1.,1.,3.},{3.,-1.,1.}}]

An approximate arbitrary-precision matrix:

m=N[{{E,Pi,-1},{-1,E,Pi},{Pi,-1,E}},20]

NormalMatrixQ[m]

A matrix with exact numeric entries:

NormalMatrixQ[{{-1,Sqrt[2],Sqrt[2]/2},{Sqrt[2],0,1},{-Sqrt[2]/2,-1,1}}]

A matrix with symbolic entries:

NormalMatrixQ[{{a,b,1},{1,a,b},{b,1,a}}]

OpenersExampleSection2(Spacer1)Options  (2)

OpenersExampleSubsection0(Spacer1)SameTest  (1)

This matrix is normal for a positive real x, but (RefLink[NormalMatrixQ, paclet:ref/NormalMatrixQ]) gives (RefLink[False, paclet:ref/False]):

m={{2Log[x],2,1},{1,Log[x^2],2},{2,1,2Log[x]}};

NormalMatrixQ[m]

Use the option (RefLink[SameTest, paclet:ref/SameTest]) to get the correct answer:

NormalMatrixQ[m,SameTest->(FullSimplify[#1-#2,x>0]==0&)]

OpenersExampleSubsection1(Spacer1)Tolerance  (1)

Generate a normal complex-valued matrix with some random perturbation of order (10^(-14)):

SeedRandom[5];n=3;
q=Orthogonalize[RandomComplex[1+I,{n,n}]];
d=DiagonalMatrix[RandomComplex[1+I,n]];

m=q.d.ConjugateTranspose[q]+10^-14*RandomReal[1,{n,n}];

NormalMatrixQ[m]

m.(m^†)-(m^†).m is not exactly zero outside the main diagonal:

m.(m^\[ConjugateTranspose])-(m^\[ConjugateTranspose]).m//MatrixForm

Adjust the option (RefLink[Tolerance, paclet:ref/Tolerance]) for accepting a matrix as normal:

NormalMatrixQ[m,Tolerance->10^-13]

(RefLink[Tolerance, paclet:ref/Tolerance]) is applied to the following value:

Norm[m.(m^\[ConjugateTranspose])-(m^\[ConjugateTranspose]).m,∞]

OpenersExampleSection3(Spacer1)Applications  (2)

Generate a normal matrix by using the fact that any normal matrix can be represented in the form p.d.(ConjugateTranspose[p]) with p unitary and d diagonal:

RandomNormalMatrix[n_]:=
Block[{p=Orthogonalize[RandomComplex[1.+I,{n,n}]],d=DiagonalMatrix[RandomComplex[1.+I,{n}]]},p.d.(p^\[ConjugateTranspose])]

NormalMatrixQ[RandomNormalMatrix[3]]

In general, the matrix is not Hermitian, antihermitian, or unitary:

m=RandomNormalMatrix[3];

{HermitianMatrixQ[m],AntihermitianMatrixQ[m],UnitaryMatrixQ[m]}

(RefLink[SchurDecomposition, paclet:ref/SchurDecomposition]) for normal matrices is always equivalent to (RefLink[Eigensystem, paclet:ref/Eigensystem]):

m=Block[{p,d,n=100},
d=RandomComplex[1.+I,{n}];
p=Orthogonalize[RandomComplex[1.+I,{n,n}]];
p.DiagonalMatrix[d].(p^\[ConjugateTranspose])];
NormalMatrixQ[m]

The triangular matrix t is effectively diagonal, although it may contain roundoff errors:

{q,t}=SchurDecomposition[m];

MatrixPlot[Chop@t]

The off-diagonal elements of t are roundoff errors:

t-DiagonalMatrix[Diagonal[t]]//Norm

The eigenvalues on the diagonal of t are not sorted:

Eigenvalues[m]==Sort[Diagonal[t],Abs[#1]>Abs[#2]&]

OpenersExampleSection4(Spacer1)Properties & Relations  (9)

(RefLink[NormalMatrixQ, paclet:ref/NormalMatrixQ])[m] is effectively equivalent to m.(m^†)==(m^†).m:

m={{0.17010407671234692-0.816200574869689*I,-0.060605479676474415+0.5284126706678552*I},{0.5318722405249391-0.002212339967518099*I,0.12335549853833308-0.8683984367571865*I}};

NormalMatrixQ[m]

m.ConjugateTranspose[m]==ConjugateTranspose[m].m

Any symmetric matrix is normal:

m = Block[{a=RandomReal[1, {10,10}]},a+(a^\[Transpose])];

{SymmetricMatrixQ[m],NormalMatrixQ[m]}

Any Hermitian matrix is normal:

m = Block[{a=RandomComplex[1+I, {10,10}]},a+(a^\[ConjugateTranspose])];

{HermitianMatrixQ[m],NormalMatrixQ[m]}

Any antisymmetric matrix is normal:

m = Block[{a=RandomReal[1, {10,10}]},a-(a^\[Transpose])];

{AntisymmetricMatrixQ[m],NormalMatrixQ[m]}

Any antihermitian matrix is normal:

m = Block[{a=RandomComplex[1+I, {10,10}]},a-(a^\[ConjugateTranspose])];

{AntihermitianMatrixQ[m],NormalMatrixQ[m]}

For any normal matrix, (Subscript[‖m‖, F]^2)=(∑_i)((|(Subscript[λ, i])|)^2) where (Subscript[λ, i]) are eigenvalues of m:

m= {{1.,3.,-1.},{-1.,1.,3.},{3.,-1.,1.}};
NormalMatrixQ[m]

s=Eigenvalues[m];
((Norm[m,"Frobenius"])^2)==Apply[Plus,((Abs[s])^2)]

Absolute values of eigenvalues of a normal matrix are equal to singular values of the matrix:

m={{0.17010407671234692-0.816200574869689*I,-0.060605479676474415+0.5284126706678552*I},{0.5318722405249391-0.002212339967518099*I,0.12335549853833308-0.8683984367571865*I}};

NormalMatrixQ[m]

Abs[Eigenvalues[m]]==SingularValueList[m]

A normal matrix has a full set of eigenvectors:

m={{1.,3.,0.},{0.,1.,3.},{3.,0.,1.}};

NormalMatrixQ[m]

The eigenvectors are often complex valued for real-valued matrices:

v=Eigenvectors[m]

The eigenvectors v are orthogonal/unitary and therefore linearly independent:

UnitaryMatrixQ[v]

A normal matrix is always diagonalizable as tested with (RefLink[DiagonalizableMatrixQ, paclet:ref/DiagonalizableMatrixQ]):

DiagonalizableMatrixQ[{{1.,3.,0.},{0.,1.,3.},{3.,0.,1.}}]

({{DocumentationFooterIconsRelatedFunction.png, ({{See Also}, {(RefLink[HermitianMatrixQ, paclet:ref/HermitianMatrixQ])  ▪  (RefLink[SymmetricMatrixQ, paclet:ref/SymmetricMatrixQ])  ▪  (RefLink[AntihermitianMatrixQ, paclet:ref/AntihermitianMatrixQ])  ▪  (RefLink[AntisymmetricMatrixQ, paclet:ref/AntisymmetricMatrixQ])  ▪  (RefLink[PositiveSemidefiniteMatrixQ, paclet:ref/PositiveSemidefiniteMatrixQ])  ▪  (RefLink[ConjugateTranspose, paclet:ref/ConjugateTranspose])}})}})

({{DocumentationFooterIconsRelatedGuide.png, ({{Related Guides}, {▪(RefLinkPlain[Matrix Predicates, paclet:guide/MatrixPredicates])}})}})