The signature of a metric tensor (or more generally a nondegenerate symmetric bilinear form, thought of as quadratic form) is the number of positive and negative eigenvalues of the metric. That is, the corresponding real symmetric matrix is diagonalised, and the diagonal entries of each sign counted. If the matrix of the metric tensor is n×n, then the number of positive and negative eigenvalues p and q = n − p may take a pair of values from 0 to n. The signature may be denoted either by a pair of integers such as (p, −q) or (q, −p), or as an explicit list such as (+, −, −, −) or (−, +, +, +) , in this case (1,3) resp. (3,1).^{[1]}
The signature is said to be indefinite or mixed if both p and q are nonzero. A Riemannian metric is a metric with a (positive) definite signature. A Lorentzian metric is one with signature (p, −1) (or sometimes (1, −q)).
There is also another definition of signature which uses a single number s defined as the number p − q, where the p and q are the number of positive and negative eigenvalues of the metric tensor. Using the nondegenerate metric tensor from above, the signature is simply the sum of p and  q. For example, s = (1 − 3) = −2 for (+,−,−,−) and s = (3 − 1) = +2 for (−, +, +, +).
Contents 
Let A be a symmetric matrix of reals. More generally, the metric signature (i_{+},i_{−},i_{0}) of A is a group of three natural numbers can be defined as the number of positive, negative and zerovalued eigenvalues of the matrix counted with regard to their algebraic multiplicity. In the case i_{0} is nonzero, the matrix A called degenerate.
If φ is a scalar product on a finitedimensional vector space V, the signature of V is the signature of the matrix which represents φ with respect to a chosen basis. According to Sylvester's law of inertia, the signature does not depend on the basis.
Due to the spectral theorem a symmetric matrix of reals is always diagonalizable. Moreover, it has exactly n eigenvalues (counted according by their algebraic multiplicity). Thus i _{+} + i _{−} + i_{0} = n
According to Sylvester's law of inertia two scalar products are isometrical if and only if they have the same signature. This means that the signature is a complete invariante for scalar products on isometric transformations. In the same way two symmetric matrices are congruent if and only if they have the same signature.
The indices i _{+} and i _{−} are the dimensions of the two vector subspaces on which the scalar product is positivedefinite and negativedefinite respectively. And the i_{0} is the dimension of the radical of the scalar product φ or the null subspace of symmetric matrix A of the bilinear form. Thus a non degenerate scalar product has signature (i _{+} ,i _{−} ,0), with i _{−} = n − i _{+} . So the values i _{+} ,i _{−} and i_{0} are also called the dimensions of the positivedefinite, negativedefinite and null vector subspaces of the whole vector space V which correspond to the matrix A. The special cases (n,0,0) and (0,n,0) correspond to the two equivalent vector spaces on which the scalar product is positivedefinite and negativedefinite respectively, and can transform each other by multiplying 1 to their scalar product.
The signature of the identity matrix is (n,0,0). More generally, the signature of a diagonal matrix is the number of positive, negative and zero numbers on its main diagonal.
The following matrices have both the same signature (1,1,0), therefore they are congruent because of Sylvester's law of inertia:
The standard scalar product defined on has (n,0,0) signature. A scalar product has this signature if and only if it is a positive definite scalar product.
A negative definite scalar product has (0,n,0) signature. A semidefinite positive scalar product has (n,0,m) signature.
The Minkowski space is and has a scalar product defined by the matrix
and has signature (1,3,0). Sometimes it is used with the opposite signs, thus obtaining (3,1,0) signature.
There are some methods for computing the signature of a matrix.
In theoretical physics, spacetime is modeled by a pseudoRiemannian manifold. The signature counts how many timelike or spacelike characters in the spacetime, in the sense defined by special relativity.
The spacetimes with purely spacelike directions are said to have Euclidean signature, while the spacetimes with signature like (3,−1) are said to have Minkowskian signature. The more general signatures are often referred to as Lorentzian signature although this term is often used as a synonym of the Minkowskian signature.
