# Qiskit implementation for projecting a hermitian operator and finding its eigenvalues

I'm brand new to quantum computing and have been learning Qiskit for a few weeks now. I am attempting to find the number of 0 eigenvalues of the following operator: $$T = PHP$$ where $$P$$ is a projection operator and $$H$$ is hermitian. For example, the projector operator can look like this: $$\begin{pmatrix} 0 & 0 & 0 & 0\\ 0 & 1 & 0 & 0\\ 0 & 0 & 1 & 0\\ 0 & 0 & 0 & 0\\ \end{pmatrix}.$$ Particularly, $$P$$ can be constructed by preparing the state $$|\psi\rangle = |01\rangle + |10\rangle$$ (omitting the constant in front). Using CNOTs to copy $$|\psi\rangle$$ into another register of qubits to make $$|\psi\rangle|\psi\rangle$$, I can trace out the first register and have the operator $$P = \left| 01\rangle\langle 01\right| + \left| 10\rangle\langle 10\right|$$. (Please correct me if this is incorrect).

I also have $$H$$ written down as a Hermitian matrix. What I'm struggling with is a Qiskit implementation that addresses the following:

1. How to apply the projector to $$H$$ from both sides to obtain $$T$$?
2. How to retrieve the eigenvalues of $$T$$ (specifically, I need the algebraic multiplicity of 0-eigenvalues)?

If it helps, $$H$$ is always real and a $$2\times2$$ version looks like $$\begin{pmatrix} 0 & 1 & 1 & 0\\ 1 & 0 & 0 & 1\\ 1 & 0 & 0 & -1\\ 0 & 1 & -1 & 0\\ \end{pmatrix}.$$ To be clear, I'm looking to do all the above inside of the quantum circuit. So I can't make the operator $$P$$ and the operator $$H$$ using something like numpy, multiply them together as matrices, and then put the result into a quantum circuit to find the eigenvalues. Everything needs to happen within in the circuit.