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

Steps

  1. 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()
    )
    
  2. 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

See Also

Next Step

You can use the gate selector to build a VQE calculator: