# Expected value in a VQE qiskit

I'm learning VQE(variational quantum eigensolver) of qiskit, but I have a question about how it measures the expected value of the energy ($$\left \langle H \right \rangle$$). I saw in other question and they comment that qiskit use $$\left \langle H \right \rangle = \langle \psi | H |\psi \rangle = \sum_{i} \lambda_{i} P_{i}$$ where $$P_{i}=|\langle \phi_{i}|\psi \rangle|^2$$. But my question is if qiskit needs the eigenvector of the operator, why does it use a VQE? Is qiskit has the diagonal representation already or how does qiskit do to measure the energy in a simulator and real device?

This output has the form of a number, so this can de draw from a few measurements, or we are only focusing on part of the information the quantum state contains. This feature helps us to reduce the resource requirement significantly if we need to know the detailed state vector of the state the technique we need is the quantum state tomography(an expensive technique). For example, for a $$n$$-qubit state, mathematically it can be described by a $$2^n$$ dimensional normed-one vector, and what state tomography do is to extract all these, say numbers.