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=4t=1.0trotter_steps=2shots=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
hamiltonianandhf_statesystem_qubitsdefaults to thehf_statelength when omitted, but cannot be smaller than the Hamiltonian wire countprebuilt-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 settingsfor finite-shot QPE,
seedis 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