Choose an Initial Ansatz Builder
Goal
Select the initial state (reference circuit) that a VQE calculation starts from.
Overview
The initial ansatz is the circuit that prepares the reference state before the adaptive VQE
loop starts adding gates. It can be attached to a VQE calculator via the fluent step
.choose_initial_ansatz_builder() and then picking one initial ansatz.
import qrunch as qc
calculator = (
qc.calculator_creator()
.vqe()
.iterative()
.standard()
.choose_initial_ansatz_builder()
# .<pick-an-initial-ansatz>(...)
.create()
)
Available Initial Ansätze
Hartree-Fock (Default)
Uses the Hartree-Fock determinant as the initial state. This is the default reference state and a good choice for most standard problems.
calculator = (
qc.calculator_creator()
.vqe()
.iterative()
.standard()
.choose_initial_ansatz_builder()
.hartree_fock()
.create()
)
Møller-Plesset 2nd order (MP2)
Uses a circuit that mimics the Møller-Plesset 2nd order (MP2) wave function as the initial state. The MP2 wave function is the first-order correction to the Hartree-Fock wave function, so the MP2 ansatz starts the VQE from a state that already captures some electron correlation.
calculator = (
qc.calculator_creator()
.vqe()
.iterative()
.standard()
.choose_initial_ansatz_builder()
.moller_plesset_2()
.create()
)
Note
The MP2 initial ansatz is a circuit that mimics the MP2 wave function. It cannot be expected to reproduce the MP2 energy exactly, but it provides a starting state close to it.
When to use the MP2 initial ansatz
The MP2 initial ansatz is recommended whenever MP2 orbitals are used to define the problem, i.e.:
When MP2 is used as the
embedded_orbital_calculatorof a projective embedding calculation.When an MP2
molecular_orbital_calculatoris chosen for a standard ground-state problem, e.g.:problem_builder = ( qc.problem_builder_creator() .ground_state() .standard() .choose_molecular_orbital_calculator() .moller_plesset_2() .create() )
You can optionally forward MP2 and beam-search options, and set the amplitude threshold used
when constructing the MP2 wave function from the t2 amplitudes:
.choose_initial_ansatz_builder()
.moller_plesset_2(
mp2_options=my_mp2_options,
beam_search_options=my_beam_search_options,
amplitude_threshold=1e-8,
)