QPE Workflows

Quantum Phase Estimation using shared Hamiltonians.

Canonical entrypoint:

from qpe.core import run_qpe

Basic QPE

qpe --molecule H2 --ancillas 4

Baseline defaults:

  • n_ancilla=4

  • t=1.0

  • trotter_steps=2

  • shots=1000

These defaults are calibrated against H2 and should be treated as baseline small-molecule settings, not universally optimized values for every chemistry problem.

Equivalent Python:

from common.hamiltonian import build_hamiltonian
from qpe.core import run_qpe

H, _, hf_state = build_hamiltonian("H2")

res = run_qpe(
    hamiltonian=H,
    hf_state=hf_state,
    n_ancilla=4,
)

print(res["energy"])

Expert-mode QPE also supports direct qubit-Hamiltonian input:

import pennylane as qml

from qpe.core import run_qpe

H_model = qml.Hamiltonian(
    [1.0, 0.5],
    [qml.PauliZ(0), qml.PauliX(0)],
)

res = run_qpe(
    hamiltonian=H_model,
    hf_state=[1],
    system_qubits=1,
    n_ancilla=4,
    shots=2000,
    plot=False,
)

Notes:

  • QPE expert mode requires both hamiltonian and hf_state

  • system_qubits defaults to the hf_state length when omitted, but cannot be smaller than the Hamiltonian wire count

  • prebuilt-Hamiltonian QPE runs use cache keys based on a canonical Pauli-term fingerprint, hf_state, system-qubit count, phase-estimation settings, seed, shots, and noise settings

  • for finite-shot QPE, seed is still meaningful because sampling is stochastic; in analytic mode (shots=None) it is effectively irrelevant


Noise

qpe \
  --molecule H2 \
  --noisy \
  --p-dep 0.05

Time evolution controls

qpe \
  --molecule H2 \
  --t 2.0 \
  --trotter-steps 4

Controls:

  • simulation time

  • Trotter depth

  • precision vs cost tradeoff