I'm a beginner in using Qiskit and my Computer Science background is not extensive. But I understand the Quantum Physics aspects of it relatively well.

I solved a QUBO problem in Qiskit using VQE (with CVaR), QAOA and Grover Optimizer, and got the correct results with all three and wish to compare the performance of each. I have already done that for execution time using time.process_time() for each and averaging over 15 runs, at relevant intervals.

I would also like to compare the state fidelities and memory used up by each (for space complexity), but don't know what to import and which function to execute from the qiskit library. I also am not sure how to call for the final state-vector results/density matrices that are stored in the result.

Can you please help me with this? Would also appreciate if you can tell me what other metrics exist that can help me compare the performance of each QA.


1 Answer 1


See the qiskit.quantum_info documentation and in particular the following documentations:

  1. state_fidelity method.
  2. Statevector class.
  3. DensityMatrix class.
  • $\begingroup$ I already saw these, but I still don't understand what to do with that. Would be helpful to see an example using code on how to initialize variables, etc. $\endgroup$ Sep 3, 2022 at 18:17

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.