A variational quantum circuit is usually constructed by accumulating layers of quantum circuits. Here, we construct an elementary quantum circuit layer to be used repeatedly later.
Evaluate the quantum circuit to express it in the vector form.
In[47]:=
EchoTiming[out=Matrix[try,SS];]
⌚
0.472176
Variational Solution in the Paramagnetic Phase
Now, we are ready to solve the variational problem by defining the objective function and minimizing the function over the variational parameter. Here, we first solve the problem in the paramagnetic phase.
Construct the objective function, which in this case is the expectation value of the Hamiltonian.