Create a ADAPT Gate Selector
Goal
Construct an ADAPT gate selector for adaptive/iterative VQE, optionally configuring its estimator and shot number. See Gate Selection to learn more about gate selection.
Prerequisites
(Optional) An estimator (see Create an Estimator)
Steps
Quick start: default ADAPT gate selector
If nothing else is specified, the default metric is the heuristic gradient.
import qrunch as qc gate_selector = ( qc.gate_selector_creator() .adapt() .create() )
Provide an estimator
You can provide an estimator and the number of shots that will be used to evaluate the commutator expectation values in the ADAPT scheme.
import qrunch as qc gate_selector = ( qc.gate_selector_creator() .adapt() .with_estimator(user_estimator) .with_shots(shots=1000) # finite-shots sampling .create() )See Create an Estimator for how to create an estimator.
Note
with_shots(shots=None)is only valid with a state-vector simulator (no sampling noise). For hardware-like runs, use a positive integer.
Verify the Result
The variable
gate_selectoris a configured ADAPT gate selector instance suitable for iterative VQE.Integrate it into a VQE calculator explained in Build a VQE Calculator with calculator_creator
See Also
Next Step
You can use the gate selector to build a VQE calculator: