Skip to main content

ket_quantum_execution_batch

Function ket_quantum_execution_batch 

Source
#[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, ) -> i32
Expand 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-owned CBatchExecution struct. The struct is cloned; the caller retains ownership of the original.
  • native_gate_set: Pointer to a caller-owned CNativeGateSet struct, or NULL to use identity translation (no decomposition into native gates).
  • gradient: If true, enables parameter-shift rule gradient computation during execution.
  • coupling_graph_json: A null-terminated JSON string that is either null (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 allocated QuantumExecution object. Ownership is transferred to the caller.

§Returns

0 on success, non-zero error code on failure.