De Seitn is no ned ibersetzt worn. Sie schaung de englische Originalversion o.
Ansaetze and variational forms
At the heart of all variational algorithms lies the key idea of analyzing the differences between states, which are conveniently related through some well-behaved mapping (for example, continuous, differentiable) from a set of parameters or variables — hence the name.
First, we'll explore how to construct parameterized circuits by hand. We'll use these circuits to define a variational form that represents a collection of parameterized states for our variational algorithm to explore. Then, we'll construct our ansatz by applying this variational form to our reference state.
We'll also explore how to trade off speed versus accuracy while exploring this search space.
Parameterized Quantum Circuits
Variational algorithms operate by exploring and comparing a range of quantum states , which depend on a finite set of parameters . These states can be prepared using a parametrized quantum circuit, where gates are defined with tunable parameters. It is possible to create this parametrized circuit without binding specific angles yet:
# Added by doQumentation — required packages for this notebook
!pip install -q qiskit rustworkx
from qiskit.circuit import QuantumCircuit, Parameter
theta = Parameter("θ")
qc = QuantumCircuit(3)
qc.rx(theta, 0)
qc.cx(0, 1)
qc.x(2)
qc.draw("mpl")
from math import pi
angle_list = [pi / 3, pi / 2]
circuits = [qc.assign_parameters({theta: angle}) for angle in angle_list]
for circuit in circuits:
display(circuit.draw("mpl"))
Variational Form and Ansatz
To iteratively optimize from a reference state to a target state , we need to define a variational form that represents a collection of parametrized states for our variational algorithm to explore: