Documentation Index
Fetch the complete documentation index at: https://docs.haiqu.ai/llms.txt
Use this file to discover all available pages before exploring further.
Haiqu.observable_backpropagation(circuit, observables, max_qwc_groups=50, max_error_total=0.05, max_error_per_slice=0.005, log=True)
Optimize the observables for a circuit with observable backpropagation. This method wraps the Qiskit Operator Backpropagation (OBP) functionality to preprocess your circuits and observables for efficient execution.- Parameters:
- circuit (QuantumCircuit | CircuitModel) — The quantum circuit to optimize.
- observables (SparsePauliOp | list *(*SparsePauliOp )) — The observable(s) to optimize. Can be a single
SparsePauliOpor list ofSparsePauliOp. The order of Pauli terms follows the Qiskit reversed-order convention. - max_qwc_groups (int) — Maximum number of qubit-wise commuting groups to create. Defaults to 50. Treat with caution as increasing this value may lead to SIGNIFICANTLY higher computational costs!
- max_error_total (float) — Maximum error allowed for the entire circuit. Defaults to 0.05.
- max_error_per_slice (float) — Maximum error allowed per slice of the circuit. Defaults to 0.005.
- log (bool) — If
True(default), logs the reduced circuits to the Haiqu cloud.
- Returns: A list of reduced circuits and a list of backpropagated observables.
- Return type: tuple[list, list]