Skip to main content

ket_quantum_execution_live

Function ket_quantum_execution_live 

Source
#[unsafe(no_mangle)]
pub extern "C" fn ket_quantum_execution_live( num_qubits: usize, live: &CLiveExecution, decompose: bool, native_gate_set: *const CNativeGateSet, qpu_config: &mut *mut QPUConfig, ) -> i32
Expand description

Creates a live-mode QuantumExecution backed by the provided callback table.

In live mode each gate is dispatched to the backend immediately as it is applied to the process. The decompose flag controls whether multi-qubit gates are decomposed into single-qubit and two-qubit native gates before being dispatched.

§Parameters

  • live: Pointer to a caller-owned CLiveExecution struct whose function pointers implement the backend. The struct is cloned; the caller retains ownership of the original.
  • decompose: If true, enables multi-qubit gate decomposition before dispatching each gate to the backend.
  • 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.