AntihermitianMatrixQ
Details and Options
- AntihermitianMatrixQ is also known as skew-Hermitian.
- A matrix m is antihermitian if m-ConjugateTranspose[m].
- AntihermitianMatrixQ works for symbolic as well as numerical matrices.
- The following options can be given:
-
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 mij and mkl are taken to be equal if f[mij,mkl] gives True.
- For approximate matrices, the option Tolerance->t can be used to indicate that all entries Abs[mij]≤t are taken to be zero.
- For matrix entries Abs[mij]>t, equality comparison is done except for the last
bits, where
is $MachineEpsilon for MachinePrecision matrices and
for matrices of Precision
.
Examples
open all close allBasic Examples (2)
Test if a 2×2 numeric matrix is explicitly antihermitian:
AntihermitianMatrixQ[(| | |
| -------- | ------- |
| I | 3 + 4 I |
| -3 + 4 I | 0 |)]Test if a 3×3 symbolic matrix is explicitly antihermitian:
AntihermitianMatrixQ[(| | | |
| ---- | ---- | -- |
| I | a | b |
| -a^ | 0 | c |
| -b^ | -c^ | -I |)]Scope (10)
Basic Uses (6)
Test if a real machine-precision matrix is antihermitian:
m = {{0, -2.3}, {2.3, 0}};AntihermitianMatrixQ[m]A real antihermitian matrix is also antisymmetric:
AntisymmetricMatrixQ[m]Test if a complex matrix is antihermitian:
m = {{I, 2 - 3I}, {-2 - 3I, -I}};AntihermitianMatrixQ[m]A complex antihermitian matrix has antisymmetric real part and symmetric imaginary part:
{AntisymmetricMatrixQ[Re[m]], SymmetricMatrixQ[Im[m]]}Test if an exact matrix is antihermitian:
m = (| | | |
| - | -- | -- |
| 4 | -5 | 2 |
| 3 | -3 | -3 |
| 5 | 5 | 5 |);AntihermitianMatrixQ[m]Make the matrix antihermitian:
AntihermitianMatrixQ[(m - m^/2)]Use AntihermitianMatrixQ with an arbitrary-precision matrix:
m = RandomReal[5, {3, 3}, WorkingPrecision -> 15]A random matrix is typically not antihermitian:
AntihermitianMatrixQ[m]Use AntihermitianMatrixQ with a symbolic matrix:
AntihermitianMatrixQ[{{a, b}, {c, d}}]The matrix becomes antihermitian when c=-b and the real part of a and d is zero:
Block[{c = -b^, a = I Re[e], d = I Re[f]}, AntihermitianMatrixQ[{{a, b}, {c, d}}]]AntihermitianMatrixQ works efficiently with large numerical matrices:
m = RandomReal[1, {1000, 1000}];AbsoluteTiming[AntihermitianMatrixQ[m]]a = m - m^;
AbsoluteTiming[AntihermitianMatrixQ[a]]Special Matrices (4)
Use AntihermitianMatrixQ with sparse matrices:
SparseArray[{i_, j_} -> i - j + (i + j)I, {5, 5}]AntihermitianMatrixQ[%]Use AntihermitianMatrixQ with structured matrices:
SymmetrizedArray[{{1, 2} -> 4, {3, 2} -> 5}, {3, 3}, Antisymmetric[All]]AntihermitianMatrixQ[%]Use with a QuantityArray structured matrix:
QuantityArray[{{1, 2}, {2, 5}}, "Meters"]AntihermitianMatrixQ[%]The identity matrix is not antihermitian:
AntihermitianMatrixQ[IdentityMatrix[3]]Make it antihermitian by multiplying with
:
AntihermitianMatrixQ[IdentityMatrix[3]I]HilbertMatrix is not antihermitian:
AntihermitianMatrixQ[HilbertMatrix[5]]Options (2)
SameTest (1)
This matrix is antihermitian for a positive real
, but AntihermitianMatrixQ gives False:
m = {{I, Exp[Log[I x]]}, {I x, 2I}};AntihermitianMatrixQ[m]Use the option SameTest to get the correct answer:
AntihermitianMatrixQ[m, SameTest -> (Simplify[#1 - #2, x > 0] == 0&)]Tolerance (1)
A complex-valued antihermitian matrix with some random perturbation of order
:
SeedRandom[56];
m = Block[{a = RandomComplex[1 + I, {3, 3}]}, a - a^];
m = m + 10^-14 RandomReal[10, {3, 3}];AntihermitianMatrixQ[m]Adjust the option Tolerance to accept this matrix as antihermitian:
AntihermitianMatrixQ[m, Tolerance -> 10 ^ -12]The norm of the difference between the matrix and its conjugate transpose with minus sign:
m + m^//NormApplications (6)
Any matrix generated from an antihermitian function
is antihermitian:
f[x_, y_] := Re[x]Re[y] IThe function is antihermitian:
Conjugate[f[y, x]] == -f[x, y]//SimplifyUsing Table generates an antihermitian matrix:
AntihermitianMatrixQ[Table[f[i, j], {i, 5}, {j, 5}]]SymmetrizedArray can generate matrices (and general arrays) with symmetries:
SymmetrizedArray[{{1, 2} -> a, {2, 3} -> b}, {3, 3}, Antihermitian[{1, 2}]]AntihermitianMatrixQ[%]Convert back to an ordinary matrix using Normal:
Normal[SymmetrizedArray[StructuredArray`StructuredData[{3, 3}, {{{1, 2} -> a, {2, 3} -> b},
Antihermitian[{1, 2}]}]]]Consider the family of rotation matrices corresponding to rotation by
in the plane:
r[θ_] := (| | |
| ------ | ------- |
| Cos[θ] | -Sin[θ] |
| Sin[θ] | Cos[θ] |)The logarithmic derivative
is antihermitian:
D[r[θ], θ].Inverse[r[θ]]//FullSimplifyAntihermitianMatrixQ[%]This will be true of any 1-parameter family of rotations:
rot = RotationMatrix[θ, RandomReal[1, 3, WorkingPrecision -> 5]];
AntisymmetricMatrixQ[D[rot, θ].Inverse[rot]]Stone's theorem says that any 1-parameter family of unitary matrices has an antihermitian logarithmic derivative. Verify the theorem for the following family of matrices:
u[t_] := (| | |
| -------- | -------- |
| Cos[t] | I Sin[t] |
| I Sin[t] | Cos[t] |)First, confirm the matrices are unitary under the assumption that
is real:
UnitaryMatrixQ[u[t], SameTest -> (Simplify[#1 - #2 == 0, t∈Reals] &)]Compute the logarithmic derivative:
u'[t].Inverse[u[t]]//FullSimplifyVerify the result is antihermitian:
AntihermitianMatrixQ[%]In quantum mechanics, time evolution is represented by a 1-parameter 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:
u[t_] := (| | | |
| ------------------------ | ---------------------- | ------------------------ |
| (1/2) + (1/2) Cos[t ω0] | -(I Sin[t ω0]/Sqrt[2]) | -(1/2) + (1/2) Cos[t ω0] |
| -(I Sin[t ω0]/Sqrt[2]) | Cos[t ω0] | -(I Sin[t ω0]/Sqrt[2]) |
| -(1/2) + (1/2) Cos[t ω0] | -(I Sin[t ω0]/Sqrt[2]) | (1/2) + (1/2) Cos[t ω0] |)First, verify the matrices are, in fact, unitary:
UnitaryMatrixQ[u[t], SameTest -> (Simplify[#1 - #2 == 0, {t, Subscript[ω, 0]}∈Reals] &)]Compute the logarithmic derivative:
u'[t].Inverse[u[t]]//FullSimplifyAntihermitianMatrixQ[%, SameTest -> (Simplify[#1 - #2 == 0, {Subscript[ω, 0]}∈Reals] &)]MatrixForm[ℋ = I ℏ %%]Verify that the matrix is Hermitian:
HermitianMatrixQ[ℋ, SameTest -> (Simplify[#1 - #2 == 0, {ℏ, Subscript[ω, 0]}∈Reals] &)]Its real eigenvalues represent the possible energies:
Eigenvalues[ℋ]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:
AntihermitianMatrixQ[v = (| | | |
| ------- | ----- | ------ |
| 2I | -0.5I | 1. - I |
| -0.5I | 0 | 1. |
| -1. - I | -1. | -I |)]Solve and check that the resulting matrix is unitary at each time:
mm = NDSolveValue[{m'[t] == v.m[t], m[0] == IdentityMatrix[3]}, m, {t, 0., 5.}]With default settings, you get approximately unitary matrices:
Table[UnitaryMatrixQ[mm[t], Tolerance -> 10 ^ -5], {t, 0., 5., 1.}]The matrix 2-norm of the solution is 1:
Table[Norm@mm[t], {t, 0., 5., 1.}]rows = Table[ParametricPlot3D[Abs[mm[t][[i]]], {t, 0., 5.}, PlotStyle -> ColorData[1, i]], {i, 3}]//Quiet;Each row lies on the unit sphere:
Show[Graphics3D[{Opacity[0.5], Sphere[]}], rows]Properties & Relations (15)
AntihermitianMatrixQ[x] trivially returns False for any x that is not a matrix:
AntihermitianMatrixQ[Sqrt[3]]A matrix is antihermitian if m==-ConjugateTranspose[m]:
m = (| | | |
| ------- | ------ | --- |
| 2I | 2 + 2I | -3I |
| -2 + 2I | -I | 4 |
| -3I | -4 | 0 |);{m == -ConjugateTranspose[m], AntihermitianMatrixQ[m]}An antihermitian matrix must have pure imaginary diagonal elements:
m = (| | |
| -------- | ------- |
| I | 2 + 2 I |
| -2 + 2 I | 0 |);AntihermitianMatrixQ[m]Use Diagonal to pick out the diagonal elements:
Diagonal[m]A real-valued antisymmetric matrix is antihermitian:
m = (| | |
| -- | - |
| 0 | 2 |
| -2 | 0 |);{AntisymmetricMatrixQ[m], AntihermitianMatrixQ[m]}But a complex-valued symmetric matrix may not be:
m = (| | |
| -------- | ------- |
| 0 | 2 + 2 I |
| -2 - 2 I | 0 |);{AntisymmetricMatrixQ[m], AntihermitianMatrixQ[m]}Use Symmetrize with the symmetry Antihermitian to compute the antihermitian part of a matrix:
m = RandomComplex[1 + I, {3, 3}];Symmetrize[m, Antihermitian[{1, 2}]]This equals the normalized difference between m and ConjugateTranspose[m]:
% == (m - m/2)Any matrix can be represented as the sum of its Hermitian and antihermitian parts:
m = RandomComplex[1 + I, {3, 3}];
{hr, ahr} = {(m + m^) / 2, (m - m^) / 2};m == hr + ahrUse HermitianMatrixQ to test whether a matrix is Hermitian:
{HermitianMatrixQ[hr], AntihermitianMatrixQ[ahr]}If
is a Hermitian matrix, then
is antihermitian:
m = Block[{a = RandomComplex[1 + I, {5, 5}]}, a + a^];{HermitianMatrixQ[m], AntihermitianMatrixQ[I m]}MatrixExp[m] for antihermitian m is unitary:
m = Block[{a = RandomComplex[1 + I, {5, 5}]}, a - a^];UnitaryMatrixQ[MatrixExp[m]]An antihermitian matrix is always a normal matrix:
m = Block[{a = RandomComplex[1 + I, {5, 5}]}, a - a^];Use NormalMatrixQ to test whether the matrix is normal:
{AntihermitianMatrixQ[m], NormalMatrixQ[m]}Antihermitian matrices have eigenvalues on the imaginary axis:
m = Block[{a = RandomComplex[1 + I, {4, 4}]}, a - a^];AntihermitianMatrixQ[m]Use Eigenvalues to find eigenvalues:
Eigenvalues[m]//ChopCharacteristicPolynomial[m,x] for antihermitian m alternates real and imaginary coefficients:
m = Block[{a = RandomComplex[1 + I, {4, 4}]}, a - a^];CharacteristicPolynomial[m, x]//ChopAntihermitian matrices have a complete set of eigenvectors:
m = Block[{a = RandomComplex[1 + I, {3, 3}]}, a - a^];AntihermitianMatrixQ[m]As a consequence, they must be diagonalizable:
DiagonalizableMatrixQ[m]Use Eigenvectors to find eigenvectors:
Eigenvectors[m]Det[m] for antisymmetric m of odd dimensions is imaginary:
m = Block[{a = RandomComplex[1 + I, {5, 5}]}, a - a^];{AntihermitianMatrixQ[m], Det[m]//Chop}If m has even dimensions, its determinant is real:
m = Block[{a = RandomComplex[1 + I, {4, 4}]}, a - a^];{AntihermitianMatrixQ[m], Det[m]//Chop}The inverse of an antihermitian matrix is antihermitian:
m = Block[{a = RandomComplex[1 + I, {3, 3}]}, a - a];AntihermitianMatrixQ[Inverse[m]]Odd powers of an antihermitian matrix are antihermitian:
m = Block[{a = RandomComplex[1 + I, {3, 3}]}, a - a];AntihermitianMatrixQ[MatrixPower[m, 9]]HermitianMatrixQ[MatrixPower[m, 8]]Related Guides
History
Text
Wolfram Research (2014), AntihermitianMatrixQ, Wolfram Language function, https://reference.wolfram.com/language/ref/AntihermitianMatrixQ.html.
CMS
Wolfram Language. 2014. "AntihermitianMatrixQ." Wolfram Language & System Documentation Center. Wolfram Research. https://reference.wolfram.com/language/ref/AntihermitianMatrixQ.html.
APA
Wolfram Language. (2014). AntihermitianMatrixQ. Wolfram Language & System Documentation Center. Retrieved from https://reference.wolfram.com/language/ref/AntihermitianMatrixQ.html
BibTeX
@misc{reference.wolfram_2026_antihermitianmatrixq, author="Wolfram Research", title="{AntihermitianMatrixQ}", year="2014", howpublished="\url{https://reference.wolfram.com/language/ref/AntihermitianMatrixQ.html}", note=[Accessed: 13-June-2026]}
BibLaTeX
@online{reference.wolfram_2026_antihermitianmatrixq, organization={Wolfram Research}, title={AntihermitianMatrixQ}, year={2014}, url={https://reference.wolfram.com/language/ref/AntihermitianMatrixQ.html}, note=[Accessed: 13-June-2026]}