0
$\begingroup$

I'm trying to understand, given a specific Hamiltonian, for example $H = Z\otimes Z+X\otimes Z$, does the VQE algorithm calculates the expectation value of $Z\otimes Z$ first or does it calculates the expectation value of $X\otimes Z$ first? couldn't understand it from the source code.

Thank you very much!

$\endgroup$
2
  • 1
    $\begingroup$ If you use IBM hardware, you can look at the order of the circuit being executed on the hardware and see which one is being executed first. $\endgroup$
    – KAJ226
    Commented Oct 15, 2020 at 17:00
  • 1
    $\begingroup$ I see you found your answer, but why would matter though which one it measure first? $\endgroup$
    – A. Jahin
    Commented Oct 15, 2020 at 18:15

2 Answers 2

1
$\begingroup$

For a VQE, the circuit applies $Z \otimes Z$ and $X \otimes Z$ on different iterations, and their expectation values are added classically. So, it doesn't really matter which is run first on a quantum computer - they're entirely different circuits.

$\endgroup$
0
$\begingroup$

Thank you for your answers. After a check it appears that the VQE algorithm processes first the rightmost expression and only then the leftmost. i.e. it first processes $X\otimes Z$ and then $Z\otimes Z$

$\endgroup$

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.