IsTotallyNonsingular

IsTotallyNonsingular is a function that determines whether or not a given matrix is totally nonsingular (i.e., all of its square submatrices are nonsingular). The input matrix can be either full or sparse.

Syntax

 * ITN = IsTotallyNonsingular(X)
 * ITN = IsTotallyNonsingular(X,SUB_SIZES)
 * ITN = IsTotallyNonsingular(X,SUB_SIZES,TOL)
 * [ITN,WIT] = IsTotallyNonsingular(X,SUB_SIZES,TOL)

Input arguments

 * X: A matrix.
 * SUB_SIZES (optional, default 1:min(size(X))): A vector specifying the sizes of submatrices to be checked for nonsingularity.
 * TOL</tt> (optional, default length(X)*eps(norm(X,'fro'))</tt>): The numerical tolerance used when determining nonsingularity.

Output arguments

 * ITN</tt>: A flag (either 1 or 0) indicating that X</tt> is or is not totally nonsingular.
 * WIT</tt> (optional): If ITN = 0</tt> then WIT</tt> specifies a submatrix of X</tt> that is singular. More specifically, WIT</tt> is a matrix with 2 rows such that X(WIT(1,:),WIT(2,:))</tt> is singular.

The Fourier matrix
A well-known result of Cebotarev says that the quantum Fourier matrix is totally nonsingular in prime dimensions, which we can verify in the 5-by-5 case as follows:

When the dimension is composite, the Fourier matrix is not totally nonsingular. For example, the following code shows in the 6-dimensional case a 2-by-2 submatrix of the Fourier matrix that is singular:

Almost all matrices are totally nonsingular
A randomly-chosen matrix will, with probability 1, be totally nonsingular: