I am trying to obtain the expectation value of the S^2 operator with respect to VQE wave function in an older version of qiskit (0.26). To that end, I tried:
from qiskit.chemistry.results import *
a = EigenstateResult(results)
b = ElectronicStructureResult(a)
print(b.total_angular_momentum)
where
results = vqe.run(quantum_instance)
Unfortunately, I only got 'False' as my output, whereas I expected something like 'S^2: 0.000'. Can someone help me with where I'm going wrong?