# Eigenvalue Problem - Nullspace Basis

I need to solve an eigenvalue problem where some of the eigenvalues are 0. Due to the fact that I just need the eigenvectors associated to the 0-eigenvalues in some cases I'd just like to calculate the Nullspace Basis of the matrix itself instead of the whole eigenvalue problem.

My problem however is that this approach is just working for smaller matrices. If the matrices are getting bigger the basis calculated via NullSpace[] differes from the "original" eigenvectors.

Here the result from solving the eigenvalue problem:

SeedRandom[123];

TestMat = {{1, 2, 3, 4}, {2, 4, 6, 8}, {3, 6, 9, 12}, {1, 0, 0, 1}};
Eigenvectors[TestMat] // N

{{13.3007, 26.6015, 39.9022, 1.}, {-0.300735, -0.601471, -0.902206, 1.}, {-2., -3., 0., 2.}, {0., -3., 2., 0.}}


Here the approach with NullSpace[]:

NullSpace[TestMat]

{{-2, -3, 0, 2}, {0, -3, 2, 0}}


If I try the same approach with a bigger matrix the procedure fails to compute the eigenvectors from the eigenvalue problem associated with the eigenvalue 0.

TestMat2 =
Join[#*Range[100] & /@ Range[10],
ResourceFunction["RandomMatrix"][
Real, {0, 100}, {90, 100}]];

EV = Eigenvectors[TestMat2];
EV0Sep = NullSpace[TestMat2];

Norm[Abs@EV0Sep[[#]] - Abs@EV[[91 + #]]]/Norm[EV[[91 + #]]] & /@
Range[Length@EV0Sep]

{0.909716, 0.903307, 0.807493, 0.764305, 0.665924, 0.634019, 0.776413, 0.815826, 0.634899}


TestMat2 is just a random matrix with nine linear dependant columns so I end up getting nine 0-eigenvalues. As you can see in the last calculation there is a significant difference between the eigenvectors calculated with Eigenvectors[TestMat2] and NullSpace[TestMat2].

Did I make a mistake or is there a possibility to calculate the NullSpace manually? (LinearSolve[TestMat2,ConstantArray[0,Length@TestMat2]] does not work unfortunatly)

• The eigenvector directions are not unique when the eigenspace has dimension larger than one. Commented Oct 23, 2023 at 21:25
• Thanks, I totally forgot about that. Commented Oct 24, 2023 at 5:29

From Help SingularValueDecomposition

       TestMat2 =  Join[#*Range[100] & /@ Range[10],
ResourceFunction["RandomMatrix"][
Real, {0, 100}, {90, 100}]];

{u, \[Sigma], v} = SingularValueDecomposition[TestMat2];

u . \[Sigma] . Transpose[v] - TestMat2 //Chop//Flatten//Union
{0}


It suffices to calculate the null space of the two right factors

        ns = NullSpace[\[Sigma] . Transpose[v]];

Dimensions[TestMat2]
{100,100}

Dimensions[ns]
{9,100}


The basis of the nullspace is orthnormal

        ns . (ns\[Transpose]) // Chop
IdentityMatrix[9]


numerical errors are of order of $MachinePrecision 10^-14  TestMat2 . (ns \[Transpose]) // Chop // Flatten // Union {0}  • Thanks for your contribution but unfortunately this does not fix my problem. The approach by using NullSpace[] yields the same result as your approach with the SVD since NullSpace[] also gives a orthonormal basis for the nullspace. My goal was to calculate the eigenvectors associated with the 0-eigenvalue from the EWP due to the fact that they span the nullspace of the matrix but as Daniel already mentioned in the comments: the direction of the eigenvectors are not unique if the eigenspace has a dimension larger than one. But thanks again for your help. Commented Oct 24, 2023 at 6:07 • Sorry, but I don't understand your problem, The kernel of a linear map is a vector space, given by a basis. as in any case with degenerate eigenvalues The choice of the basis for that subspace is algorithm-dependent. In a physical problem, the choice of the basis of a degeneration subspace is given by a disturbing additional matrix, that lifts the degeneration, ega small external field or the pair interaction between particle partitions of the dimensions in vectors of three coordinates. Commented Oct 24, 2023 at 10:17 • Can this additional matrix then be used to transform the basis given by NullSpace[] or SingularValueDecomposition[] to the eigenvectors associated with the eigenvalue 0? Commented Oct 26, 2023 at 6:20 • Degenerate nullspaces are a topic of topology. In physics they arise eg, if the manifold carrrying the model allows of linear independent constant vector fields in the kernel of the$\nabla$operator. Degeneration of non-null energy levels of a matrix approximation of the$H=-Laplacian+V$circus in a given truncated basis is simply done by series expansions of eigenvalues in terms of a small, asymmetric disturbation$V\to V + \epsilon $\delta V$ . This is the hell of the calculation of perturbations, a bookkeepers or tensor space adminstrators profession. Commented Oct 26, 2023 at 7:01