Skip to main content
. 2022 Oct 8;24(10):1428. doi: 10.3390/e24101428
Algorithm 4 QAOA solving optimization.
  • Input: 

    the problem Hamiltonian HC, the mixing Hamiltonian HM.

  • Output: 

    the ground state |ΨC of HC.

  •  1:

    Prepare the quantum register into |Ψ0=|+m.

  •  2:

    Choose the initial parameters γ, β. Perform HC and HM alternately and obtain |Ψ(γ,β).

  •  3:

    Measure the quantum registers and calculate the cost function.

  •  4:

    Repeat Step 2 and Step 3 several times and calculate the expectation value of the cost function.

  •  5:

    Pass the expectation value and parameters (γ,β) to a classical optimizer. Update the parameters (γ,β).

  •  6:

    Repeat Steps 2–5 until the result meets a fixed threshold and the parameters are updated to (γ,β).

  •  7:

    return |ΨC=|Ψ(γ,β)