qdk_chemistry.plugins.qiskit.energy_estimator module

QDK/Chemistry energy estimator module.

This module defines a custom EnergyEstimator class for evaluating expectation values of quantum circuits with respect to Hamiltonian. The estimator leverages Qiskit [JATK+24] backends to execute quantum circuits and collect bitstring outcomes.

Key Features:
  • Accepts a quantum circuit (as a Circuit) and observables (as a list of QubitHamiltonian).

  • Generates measurement circuits for each observable term.

  • Executes measurement circuits on a simulator backend with a specified number of shots.

  • Collects bitstring counts and computes expectation values and variances.

  • Supports noise simulations and classical error analysis.

class qdk_chemistry.plugins.qiskit.energy_estimator.QiskitEnergyEstimator(seed=42, backend_options=None, backend=None)[source]

Bases: EnergyEstimator

Custom Estimator to estimate expectation values of quantum circuits with respect to a given observable.

Parameters:
__init__(seed=42, backend_options=None, backend=None)[source]

Initialize the Estimator with a backend and optional transpilation settings.

Parameters:
  • seed (int) – Seed for the simulator to ensure reproducibility. Default is 42. This argument takes priority over the seed specified in the Backend configuration/options.

  • backend_options (dict[str, Any] | None) – Backend-specific configuration dictionary for Qiskit AerSimulator. Frequently used options include {"seed_simulator": int, "noise_model": NoiseModel, ...}. The backend option “seed_simulator” is overwritten by seed. The backend option “noise_model” is overwritten when a noise model is provided as argument in the run function. This keyword argument is not compatible with qdk_chemistry.algorithms.create.

  • backend (BackendV2 | None) – Backend simulator to run circuits. Defaults to Qiskit AerSimulator. backend and backend_options are mutually exclusive; provide only one. This keyword argument is not compatible with qdk_chemistry.algorithms.create.

References: Qiskit Aer Simulator.

name()[source]

Get the name of the estimator backend.

Return type:

str

class qdk_chemistry.plugins.qiskit.energy_estimator.QiskitEnergyEstimatorSettings[source]

Bases: Settings

Settings configuration for a QiskitEnergyEstimator.

QiskitEnergyEstimator-specific settings:

seed (int, default=42): Random seed for reproducibility.

__init__()[source]

Initialize QiskitEnergyEstimatorSettings.