0
$\begingroup$

Say I have a quantum circuit like this

Circuit

This is an ansatz for solving linear equation provided in the Qiskit's textbook

In the textbook, it was shown how to find the optimal parameters of this ansatz such that the cost function is minimized. I want to assign the array of optimal parameters to this ansatz. How do I do it?

$\endgroup$

1 Answer 1

0
$\begingroup$

You can use assign_parameters() method:

circ.assign_parameters(params, inplace=True)

where params is the array of optimal parameters.

$\endgroup$
0

Your Answer

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

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