Products
  • Wolfram|One

    The definitive Wolfram Language and notebook experience

  • Mathematica

    The original technical computing environment

  • Notebook Assistant + LLM Kit

    All-in-one AI assistance for your Wolfram experience

  • Compute Services
  • System Modeler
  • Finance Platform
  • Wolfram|Alpha Notebook Edition
  • Application Server
  • Enterprise Private Cloud
  • Wolfram Engine
  • Wolfram Player
  • Wolfram Cloud App
  • Wolfram Player App

More mobile apps

Core Technologies of Wolfram Products

  • Wolfram Language
  • Computable Data
  • Wolfram Notebooks
  • AI & Linguistic Understanding

Deployment Options

  • Wolfram Cloud
  • wolframscript
  • Wolfram Engine Community Edition
  • Wolfram LLM API
  • WSTPServer
  • Wolfram|Alpha APIs

From the Community

  • Function Repository
  • Community Paclet Repository
  • Example Repository
  • Neural Net Repository
  • Prompt Repository
  • Wolfram Demonstrations
  • Data Repository
  • Group & Organizational Licensing
  • All Products
Consulting & Solutions

We deliver solutions for the AI era—combining symbolic computation, data-driven insights and deep technical expertise

  • Data & Computational Intelligence
  • Model-Based Design
  • Algorithm Development
  • Wolfram|Alpha for Business
  • Blockchain Technology
  • Education Technology
  • Quantum Computation

Wolfram Consulting

Wolfram Solutions

  • Data Science
  • Artificial Intelligence
  • Biosciences
  • Healthcare Intelligence
  • Sustainable Energy
  • Control Systems
  • Enterprise Wolfram|Alpha
  • Blockchain Labs

More Wolfram Solutions

Wolfram Solutions For Education

  • Research Universities
  • Colleges & Teaching Universities
  • Junior & Community Colleges
  • High Schools
  • Educational Technology
  • Computer-Based Math

More Solutions for Education

  • Contact Us
Learning & Support

Get Started

  • Wolfram Language Introduction
  • Fast Intro for Programmers
  • Fast Intro for Math Students
  • Wolfram Language Documentation

More Learning

  • Highlighted Core Areas
  • Demonstrations
  • YouTube
  • Daily Study Groups
  • Wolfram Schools and Programs
  • Books

Grow Your Skills

  • Wolfram U

    Courses in computing, science, life and more

  • Community

    Learn, solve problems and share ideas.

  • Blog

    News, views and insights from Wolfram

  • Resources for

    Software Developers

Tech Support

  • Contact Us
  • Support FAQs
  • Support FAQs
  • Contact Us
Company
  • About Wolfram
  • Career Center
  • All Sites & Resources
  • Connect & Follow
  • Contact Us

Work with Us

  • Student Ambassador Initiative
  • Wolfram for Startups
  • Student Opportunities
  • Jobs Using Wolfram Language

Educational Programs for Adults

  • Summer School
  • Winter School

Educational Programs for Youth

  • Middle School Camp
  • High School Research Program
  • Computational Adventures

Read

  • Stephen Wolfram's Writings
  • Wolfram Blog
  • Wolfram Tech | Books
  • Wolfram Media
  • Complex Systems

Educational Resources

  • Wolfram MathWorld
  • Wolfram in STEM/STEAM
  • Wolfram Challenges
  • Wolfram Problem Generator

Wolfram Initiatives

  • Wolfram Science
  • Wolfram Foundation
  • History of Mathematics Project

Events

  • Stephen Wolfram Livestreams
  • Online & In-Person Events
  • Contact Us
  • Connect & Follow
Wolfram|Alpha
  • Your Account
  • User Portal
  • Wolfram Cloud
  • Products
    • Wolfram|One
    • Mathematica
    • Notebook Assistant + LLM Kit
    • Compute Services
    • System Modeler
    • Finance Platform
    • Wolfram|Alpha Notebook Edition
    • Application Server
    • Enterprise Private Cloud
    • Wolfram Engine
    • Wolfram Player
    • Wolfram Cloud App
    • Wolfram Player App

    More mobile apps

    • Core Technologies
      • Wolfram Language
      • Computable Data
      • Wolfram Notebooks
      • AI & Linguistic Understanding
    • Deployment Options
      • Wolfram Cloud
      • wolframscript
      • Wolfram Engine Community Edition
      • Wolfram LLM API
      • WSTPServer
      • Wolfram|Alpha APIs
    • From the Community
      • Function Repository
      • Community Paclet Repository
      • Example Repository
      • Neural Net Repository
      • Prompt Repository
      • Wolfram Demonstrations
      • Data Repository
    • Group & Organizational Licensing
    • All Products
  • Consulting & Solutions

    We deliver solutions for the AI era—combining symbolic computation, data-driven insights and deep technical expertise

    WolframConsulting.com

    Wolfram Solutions

    • Data Science
    • Artificial Intelligence
    • Biosciences
    • Healthcare Intelligence
    • Sustainable Energy
    • Control Systems
    • Enterprise Wolfram|Alpha
    • Blockchain Labs

    More Wolfram Solutions

    Wolfram Solutions For Education

    • Research Universities
    • Colleges & Teaching Universities
    • Junior & Community Colleges
    • High Schools
    • Educational Technology
    • Computer-Based Math

    More Solutions for Education

    • Contact Us
  • Learning & Support

    Get Started

    • Wolfram Language Introduction
    • Fast Intro for Programmers
    • Fast Intro for Math Students
    • Wolfram Language Documentation

    Grow Your Skills

    • Wolfram U

      Courses in computing, science, life and more

    • Community

      Learn, solve problems and share ideas.

    • Blog

      News, views and insights from Wolfram

    • Resources for

      Software Developers
    • Tech Support
      • Contact Us
      • Support FAQs
    • More Learning
      • Highlighted Core Areas
      • Demonstrations
      • YouTube
      • Daily Study Groups
      • Wolfram Schools and Programs
      • Books
    • Support FAQs
    • Contact Us
  • Company
    • About Wolfram
    • Career Center
    • All Sites & Resources
    • Connect & Follow
    • Contact Us

    Work with Us

    • Student Ambassador Initiative
    • Wolfram for Startups
    • Student Opportunities
    • Jobs Using Wolfram Language

    Educational Programs for Adults

    • Summer School
    • Winter School

    Educational Programs for Youth

    • Middle School Camp
    • High School Research Program
    • Computational Adventures

    Read

    • Stephen Wolfram's Writings
    • Wolfram Blog
    • Wolfram Tech | Books
    • Wolfram Media
    • Complex Systems
    • Educational Resources
      • Wolfram MathWorld
      • Wolfram in STEM/STEAM
      • Wolfram Challenges
      • Wolfram Problem Generator
    • Wolfram Initiatives
      • Wolfram Science
      • Wolfram Foundation
      • History of Mathematics Project
    • Events
      • Stephen Wolfram Livestreams
      • Online & In-Person Events
    • Contact Us
    • Connect & Follow
  • Wolfram|Alpha
  • Wolfram Cloud
  • Your Account
  • User Portal
Wolfram Language & System Documentation Center
IndefiniteMatrixQ
  • See Also
    • PositiveDefiniteMatrixQ
    • NegativeDefiniteMatrixQ
    • PositiveSemidefiniteMatrixQ
    • NegativeSemidefiniteMatrixQ
    • HermitianMatrixQ
    • SymmetricMatrixQ
    • Eigenvalues
    • SquareMatrixQ
  • Related Guides
    • Matrix Predicates
    • See Also
      • PositiveDefiniteMatrixQ
      • NegativeDefiniteMatrixQ
      • PositiveSemidefiniteMatrixQ
      • NegativeSemidefiniteMatrixQ
      • HermitianMatrixQ
      • SymmetricMatrixQ
      • Eigenvalues
      • SquareMatrixQ
    • Related Guides
      • Matrix Predicates

IndefiniteMatrixQ[m]

gives True if m is explicitly indefinite, and False otherwise.

Details and Options
Details and Options Details and Options
Examples  
Basic Examples  
Scope  
Basic Uses  
Special Matrices  
Options  
Tolerance  
Applications  
The Geometry and Algebra of Positive Semidefinite Matrices  
Sources of Indefinite Matrices  
Uses of Indefinite Matrices  
Properties & Relations  
Possible Issues  
See Also
Related Guides
History
Cite this Page
BUILT-IN SYMBOL
  • See Also
    • PositiveDefiniteMatrixQ
    • NegativeDefiniteMatrixQ
    • PositiveSemidefiniteMatrixQ
    • NegativeSemidefiniteMatrixQ
    • HermitianMatrixQ
    • SymmetricMatrixQ
    • Eigenvalues
    • SquareMatrixQ
  • Related Guides
    • Matrix Predicates
    • See Also
      • PositiveDefiniteMatrixQ
      • NegativeDefiniteMatrixQ
      • PositiveSemidefiniteMatrixQ
      • NegativeSemidefiniteMatrixQ
      • HermitianMatrixQ
      • SymmetricMatrixQ
      • Eigenvalues
      • SquareMatrixQ
    • Related Guides
      • Matrix Predicates

IndefiniteMatrixQ

IndefiniteMatrixQ[m]

gives True if m is explicitly indefinite, and False otherwise.

Details and Options

  • A matrix m is indefinite if Re[Conjugate[x].m.x] achieves both positive and negative values.
  • IndefiniteMatrixQ works for symbolic as well as numerical matrices.
  • For approximate matrices, the option Tolerance->t can be used to indicate that all eigenvalues λ satisfying λ≤t λmax are taken to be zero where λmax is an eigenvalue largest in magnitude.
  • The option Tolerance has Automatic as its default value.

Examples

open all close all

Basic Examples  (2)

Test if a matrix is explicitly indefinite:

The quadratic form has positive and negative values for different vectors :

Test if a 3×3 Hermitian matrix is indefinite:

Scope  (10)

Basic Uses  (6)

Test if a real machine-precision matrix is explicitly indefinite:

Test if a complex matrix is indefinite:

Test if an exact matrix is indefinite:

Use IndefiniteMatrixQ with an arbitrary-precision matrix:

A random matrix is typically indefinite:

Use IndefiniteMatrixQ with a symbolic matrix:

The matrix becomes indefinite when b=-TemplateBox[{a}, Conjugate]:

IndefiniteMatrixQ works efficiently with large numerical matrices:

Special Matrices  (4)

Use IndefiniteMatrixQ with sparse matrices:

Use IndefiniteMatrixQ with structured matrices:

The identity matrix is not indefinite:

HilbertMatrix is not indefinite:

Options  (1)

Tolerance  (1)

Generate a real-valued diagonal matrix with some random perturbation of order :

If the element of order is a roundoff error, then the matrix is incorrectly considered as indefinite:

Adjust the option Tolerance to give a correct answer:

Applications  (16)

The Geometry and Algebra of Positive Semidefinite Matrices  (6)

Consider a real indefinite 2×2 matrix and its associated real quadratic q=TemplateBox[{x}, Transpose].m.x:

Because is indefinite, the level sets are hyperbolas:

The contour corresponding to zero gives the shared asymptotes of the hyperbolas:

The plot of will be a saddle-shaped hyperbolic paraboloid that has both positive and negative values:

For a real, indefinite matrix, the level sets are -hyperboloids:

Typically, the level sets will include both one-sheeted and two-sheeted hyperboloids:

The two types of hyperboloids are separated by the asymptotic double cone at :

In three dimensions, these can degenerate into cylinders over hyperbolas:

A Hermitian matrix defines a real-valued quadratic form by q=TemplateBox[{x}, ConjugateTranspose].m.x:

If is indefinite, achieves both positive and negative values:

Visualize for real-valued inputs:

For a real-valued matrix , only the symmetric part determines whether is indefinite. Write with symmetric and antisymmetric:

As is real and symmetric TemplateBox[{{(, {TemplateBox[{x}, ConjugateTranspose, SyntaxForm -> SuperscriptBox], ., s, ., x}, )}}, Conjugate]=TemplateBox[{{(, {TemplateBox[{x}, ConjugateTranspose, SyntaxForm -> SuperscriptBox], ., s, ., x}, )}}, ConjugateTranspose]=TemplateBox[{x}, ConjugateTranspose].TemplateBox[{s}, ConjugateTranspose].TemplateBox[{{(, TemplateBox[{x}, ConjugateTranspose, SyntaxForm -> SuperscriptBox], )}}, ConjugateTranspose]=TemplateBox[{x}, ConjugateTranspose].s.x, meaning TemplateBox[{x}, ConjugateTranspose].s.x is purely real:

Similarly, as is real and antisymmetric TemplateBox[{{(, {TemplateBox[{x}, ConjugateTranspose, SyntaxForm -> SuperscriptBox], ., a, ., x}, )}}, Conjugate]=-TemplateBox[{x}, ConjugateTranspose].a.x, or TemplateBox[{x}, ConjugateTranspose].a.x is pure imaginary:

Thus, Re(TemplateBox[{x}, ConjugateTranspose].m.x)=TemplateBox[{x}, ConjugateTranspose].s.x, so is indefinite if and only if is:

For a complex-valued matrix , only the Hermitian part determines whether is indefinite. Write with Hermitian and antihermitian:

As is Hermitian, TemplateBox[{{(, {TemplateBox[{x}, ConjugateTranspose], ., h, ., x}, )}}, Conjugate]=TemplateBox[{{(, {TemplateBox[{x}, ConjugateTranspose], ., h, ., x}, )}}, ConjugateTranspose]=TemplateBox[{x}, ConjugateTranspose].TemplateBox[{h}, ConjugateTranspose].TemplateBox[{{(, TemplateBox[{x}, ConjugateTranspose, SyntaxForm -> SuperscriptBox], )}}, ConjugateTranspose]=TemplateBox[{x}, ConjugateTranspose].h.x, meaning TemplateBox[{x}, ConjugateTranspose].h.x is purely real:

Similarly, as is antihermitian, TemplateBox[{{(, {TemplateBox[{x}, ConjugateTranspose, SyntaxForm -> SuperscriptBox], ., a, ., x}, )}}, Conjugate]=-TemplateBox[{x}, ConjugateTranspose].a.x, or TemplateBox[{x}, ConjugateTranspose].a.x is pure imaginary:

Thus, Re(TemplateBox[{x}, ConjugateTranspose].m.x)=TemplateBox[{x}, ConjugateTranspose].h.x, so is indefinite if and only if is:

By definition, a matrix is indefinite if Re(TemplateBox[{x}, ConjugateTranspose].m.x) achieves both positive and negative values:

Note that this does not necessarily mean that TemplateBox[{x}, ConjugateTranspose].m.x achieves both signs:

For this particular matrix, both Re(TemplateBox[{x}, ConjugateTranspose].m.x) and TemplateBox[{x}, ConjugateTranspose].m.x achieve positive values:

But only Re(TemplateBox[{x}, ConjugateTranspose].m.x) achieves a negative value:

Sources of Indefinite Matrices  (6)

The Pauli matrices are indefinite:

FourierMatrix[k] is indefinite for :

ToeplitzMatrix[k] is indefinite for :

The Redheffer matrix is a 0-1 indefinite matrix:

Many filter kernel matrices are indefinite, including CrossMatrix[k]:

DiamondMatrix[k]:

And DiskMatrix[k] for :

DiskMatrix[1] is positive semidefinite:

Randomly generated matrices tend to be indefinite, with the probability of the matrix being indefinite rapidly increasing as the dimensions of the matrix increase. The following inputs estimate the probability of a matrix being indefinite for matrices from to . First, matrices whose entries are independently and uniformly drawn from the interval :

Matrices drawn from GaussianOrthogonalMatrixDistribution:

Matrices drawn from GaussianUnitaryMatrixDistribution:

Matrices drawn from CircularRealMatrixDistribution:

Uses of Indefinite Matrices  (4)

The second derivative test classifies critical points of a function as local minima if the Hessian is positive definite, local maxima if the Hessian is negative definite and saddle points if the Hessian is indefinite (the test fails if the Hessian is not one of these three types). Find the critical points of a function of two variables:

Compute the Hessian matrix :

The last of the three critical points is a saddle point:

The first two points are local minima:

Visualize the function. The red and blue points are minima and the green point is a saddle point:

Find the critical points of a function of three variables:

Compute the Hessian matrix of f:

The first two critical points are local minima:

The last three are saddle points:

For this function, any three of the critical points are linearly dependent, so they all lie in a single plane:

Compute the normal to that plane:

Visualize the function, with the minima green and the non-extreme critical points red:

Roughly half of three-dimensional rotation matrices are indefinite. This can be understood as vectors parallel to the axis of rotation being unchanged by the rotation, and vectors perpendicular to the axis being rotated by more than . For the former x.r.x=TemplateBox[{x}, Norm]^2>0, and for the latter . First, generate random rotation matrices:

Roughly half are indeed indefinite:

Compute the Schur decomposition of one randomly selected indefinite matrix:

The matrix defines a basis in which is represented by :

The action of on the standard unit vectors leaves one unchanged and rotates the others by more than :

A spacetime or pseudo-Riemannian metric is an invertible, real symmetric, indefinite matrix that becomes positive definite when restricted some three-dimensional subspace. It gives a notion of squared distance between events in spacetime via its associated quadratic form. Show that the standard or Minkowski metric is a spacetime metric:

The restriction of to the second through fourth standard basis elements is positive definite:

The event is separated from the origin by a positive squared distance, known as spacelike separation:

Thus, the events are simultaneous in some reference frame, and the distance in that frame is:

The event is separated from the origin by a negative squared distance, known as timelike separation:

They occur at the same point in some reference frame, one being the proper time after the other:

The event has zero squared distance, or lightlike separation, from the origin. Only light can reach both events:

Properties & Relations  (9)

IndefiniteMatrixQ[x] trivially returns False for any x that is not a matrix:

A matrix is indefinite if Re(TemplateBox[{x}, ConjugateTranspose].m.x) achieves both positive and negative values:

Note that this does not necessarily mean that TemplateBox[{x}, ConjugateTranspose].m.x achieves both signs:

A real matrix is indefinite if and only if its symmetric part is indefinite:

In general, a matrix is indefinite if and only if its Hermitian part is indefinite:

A real symmetric matrix is indefinite if and only if it has both positive and negative eigenvalues:

This statement is true of Hermitian matrices more generally:

A general matrix can be indefinite without having eigenvalues of both signs:

While both eigenvalues are positive, there are non-eigenvectors that make the quadratic form negative:

A diagonal matrix is indefinite if and only if diagonal elements have both positive and negative real parts:

An indefinite matrix has the general form , with a diagonal indefinite :

Split into its Hermitian and antihermitian parts:

By the spectral theorem, can be unitarily diagonalized using JordanDecomposition:

The matrix is diagonal with positive and negative diagonal entries:

The matrix is unitary:

Verify that m=u.d.TemplateBox[{u}, ConjugateTranspose]+a:

An indefinite matrix is neither positive semidefinite nor negative semidefinite:

A matrix is indefinite if and only if is also indefinite:

Possible Issues  (1)

IndefiniteMatrixQ gives False unless it can prove a symbolic matrix is indefinite:

Using a combination of Eigenvalues and Reduce can give more precise results:

See Also

PositiveDefiniteMatrixQ  NegativeDefiniteMatrixQ  PositiveSemidefiniteMatrixQ  NegativeSemidefiniteMatrixQ  HermitianMatrixQ  SymmetricMatrixQ  Eigenvalues  SquareMatrixQ

Related Guides

    ▪
  • Matrix Predicates

History

Introduced in 2014 (10.0)

Wolfram Research (2014), IndefiniteMatrixQ, Wolfram Language function, https://reference.wolfram.com/language/ref/IndefiniteMatrixQ.html.

Text

Wolfram Research (2014), IndefiniteMatrixQ, Wolfram Language function, https://reference.wolfram.com/language/ref/IndefiniteMatrixQ.html.

CMS

Wolfram Language. 2014. "IndefiniteMatrixQ." Wolfram Language & System Documentation Center. Wolfram Research. https://reference.wolfram.com/language/ref/IndefiniteMatrixQ.html.

APA

Wolfram Language. (2014). IndefiniteMatrixQ. Wolfram Language & System Documentation Center. Retrieved from https://reference.wolfram.com/language/ref/IndefiniteMatrixQ.html

BibTeX

@misc{reference.wolfram_2025_indefinitematrixq, author="Wolfram Research", title="{IndefiniteMatrixQ}", year="2014", howpublished="\url{https://reference.wolfram.com/language/ref/IndefiniteMatrixQ.html}", note=[Accessed: 01-May-2026]}

BibLaTeX

@online{reference.wolfram_2025_indefinitematrixq, organization={Wolfram Research}, title={IndefiniteMatrixQ}, year={2014}, url={https://reference.wolfram.com/language/ref/IndefiniteMatrixQ.html}, note=[Accessed: 01-May-2026]}

Top
Introduction for Programmers
Introductory Book
Wolfram Function Repository | Wolfram Data Repository | Wolfram Data Drop | Wolfram Language Products
Top
  • Products
  • Wolfram|One
  • Mathematica
  • Notebook Assistant + LLM Kit
  • Compute Services
  • System Modeler

  • Wolfram|Alpha Notebook Edition
  • Wolfram|Alpha Pro
  • Mobile Apps

  • Wolfram Engine
  • Wolfram Player

  • Volume & Site Licensing
  • Server Deployment Options
  • Consulting
  • Wolfram Consulting
  • Repositories
  • Data Repository
  • Function Repository
  • Community Paclet Repository
  • Neural Net Repository
  • Prompt Repository

  • Wolfram Language Example Repository
  • Notebook Archive
  • Wolfram GitHub
  • Learning
  • Wolfram U
  • Wolfram Language Documentation
  • Webinars & Training
  • Educational Programs

  • Wolfram Language Introduction
  • Fast Introduction for Programmers
  • Fast Introduction for Math Students
  • Books

  • Wolfram Community
  • Wolfram Blog
  • Public Resources
  • Wolfram|Alpha
  • Wolfram Problem Generator
  • Wolfram Challenges

  • Computer-Based Math
  • Computational Thinking
  • Computational Adventures

  • Demonstrations Project
  • Wolfram Data Drop
  • MathWorld
  • Wolfram Science
  • Wolfram Media Publishing
  • Customer Resources
  • Store
  • Product Downloads
  • User Portal
  • Your Account
  • Organization Access

  • Support FAQ
  • Contact Support
  • Company
  • About Wolfram
  • Careers
  • Contact
  • Events
Wolfram Community Wolfram Blog
Legal & Privacy Policy
WolframAlpha.com | WolframCloud.com
© 2026 Wolfram
© 2026 Wolfram | Legal & Privacy Policy |
English