Preparing the catalog and filters…Katalog ve filtreler hazırlanıyor…
Starter code
module rzz_vqe_ansatz;
use chemistry.h2_minimal;
fn main() {
let q: QReg<2> = qreg[2];
param theta: Angle[4] = [0.2, 0.1, 0.4, -0.2];
X(q[0]);
Ry(q[0], theta[0]);
Ry(q[1], theta[1]);
RZZ(q[0], q[1], theta[2]);
Ry(q[0], theta[3]);
let energy = expect H2Minimal;
return energy;
}Expected output
Angle[N] expands into theta_0, theta_1, theta_2, and theta_3
RZZ creates the interaction layer between q[0] and q[1]
Output reports the H2Minimal energy expectation
Resources include the two-qubit interaction gate used by the ansatz
Debugging checklist
Run the circuit and read the energy expectation in Output
Open the Circuit tab and find the RZZ interaction
Change theta[2] and compare the energy
Replace use chemistry.h2_minimal with an inline observable block
Explain which theta entry controls each ansatz layer
Extension challenge
Add another RZZ/Ry layer with theta[4] and theta[5], then compare the resource estimate and energy.