#[unsafe(no_mangle)]pub extern "C" fn ket_quantum_execution_batch(
num_qubits: usize,
batch: &CBatchExecution,
native_gate_set: *const CNativeGateSet,
decompose: bool,
gradient: bool,
coupling_graph_json: *const c_char,
exp_value_strategy_json: *const c_char,
qpu_config: &mut *mut QPUConfig,
) -> i32Expand description
Creates a batch-mode QuantumExecution backed by the provided callback tables.
In batch mode the full compiled circuit is handed to the backend in a
single call when ket_process_execute is invoked. The native_gate_set
callback table is used during the decomposition and routing passes to
translate abstract gates into hardware-native instructions.
§Parameters
batch: Pointer to a caller-ownedCBatchExecutionstruct. The struct is cloned; the caller retains ownership of the original.native_gate_set: Pointer to a caller-ownedCNativeGateSetstruct, orNULLto use identity translation (no decomposition into native gates).gradient: Iftrue, enables parameter-shift rule gradient computation during execution.coupling_graph_json: A null-terminated JSON string that is eithernull(no connectivity constraint) or a JSON array of[usize, usize]edge pairs describing the QPU coupling graph used for qubit routing.quantum_execution: Output: receives the pointer to the newly allocatedQuantumExecutionobject. Ownership is transferred to the caller.
§Returns
0 on success, non-zero error code on failure.