qdk_chemistry.algorithms.hamiltonian_unitary_builder.time_evolution.qdrift_error module

qDRIFT sample-count estimation for accuracy-aware parameterization.

Provides the Campbell (2019) bound for the minimum number of qDRIFT samples required to achieve a target accuracy:

\[N \geq \left\lceil \frac{2 \lambda^2 t^2}{\epsilon} \right\rceil, \quad \lambda = \sum_j |\alpha_j|.\]

References

Campbell, E. (2019). Random Compiler for Fast Hamiltonian Simulation. Physical Review Letters, 123(7), 070503. https://arxiv.org/abs/1811.08017

qdk_chemistry.algorithms.hamiltonian_unitary_builder.time_evolution.qdrift_error.qdrift_samples_campbell(hamiltonian, time, target_accuracy, *, weight_threshold=1e-12)[source]

Compute the number of qDRIFT samples using the Campbell (2019) bound.

\[N = \left\lceil \frac{2 \lambda^2 t^2}{\epsilon} \right\rceil, \quad \lambda = \sum_j |\alpha_j|\]

where the sum runs over the real coefficients of hamiltonian whose magnitudes exceed weight_threshold.

Parameters:
  • hamiltonian (QubitOperator) – The qubit Hamiltonian to simulate.

  • time (float) – The total evolution time t.

  • target_accuracy (float) – The target accuracy \(\epsilon > 0\).

  • weight_threshold (float) – Absolute threshold below which coefficients are discarded.

Returns:

The minimum number of qDRIFT samples (at least 1).

Raises:

ValueError – If target_accuracy is not positive.

Return type:

int