Question: Enforcing symmetry considerations in Eigenvector solver

I am making calculations on a block matrix of the form Matrix([[A,B],[-B,-A]])

with A real and symmetric and B real and antisymmetric. (For the physics savvy, this is the Bogoliubov-de Gennes form of the coefficient matrix for doing calculations.)

But this says if I have an eigenvector of the form (u,v) with eigenvalue E, then there is another eigenvector (v,u) with eigenvalue -E.

Now, my problem.. I have a problem that has two zero eigenvalues, but the numerical solver is giving one as zero and one as just very small. This is problematic because my eigenvectors don't have the symmetry that they should. For the non-zero eigenvectors, the error is small and doesn't matter so much. But the eigenvector corresponding to the zero eigenvalues are not guaranteed to be close.

Is there a way to demand my eigenvalues come in pairs for my matrices? Something that dependings on A,B being even or odd dimensional is fine. I care more about the symmetry than even/oddness.

Please Wait...