Skip to content

Commit

Permalink
Fix error in optimize_parameters example
Browse files Browse the repository at this point in the history
  • Loading branch information
EnBr55 committed Apr 21, 2022
1 parent a760b75 commit 7192b24
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions doc/source/qip-vqa.rst
Original file line number Diff line number Diff line change
Expand Up @@ -106,9 +106,9 @@ Below, we run an optimization on a toy circuit, tuning a parameterized :math:`x`

>>> circ.add_block(VQABlock(sigmax() / 2))

We can now try to find a minimum in our cost function using the SciPy in-built BFGS method. We set bounds to limit the method to parameters :math:`0 \leq t \leq 4`.
We can now try to find a minimum in our cost function using the SciPy in-built BFGS method.

>>> result = circ.optimize_parameters(method="BFGS", use_jac=True, bounds=[0, 4])
>>> result = circ.optimize_parameters(method="BFGS", use_jac=True)

Accessing `result.res.x`, we have the array of parameters found during optimization. In our case, we only had one free parameter, so we examine the first element of this array.

Expand Down

0 comments on commit 7192b24

Please sign in to comment.