Skip to main content

ket_process_alloc

Function ket_process_alloc 

Source
#[unsafe(no_mangle)]
pub extern "C" fn ket_process_alloc( process: &mut Process, qubit: &mut usize, ) -> i32
Expand description

Allocates a new logical qubit in the process.

Returns an error if the process is in a state that does not accept new qubits (e.g., ProcessTerminated) or if the QPU qubit limit has been reached (QubitLimitExceeded).

§Parameters

  • process: The process in which the qubit is allocated.
  • qubit: Output: receives the index of the newly allocated logical qubit.

§Returns

0 on success, non-zero error code on failure (including ProcessTerminated and QubitLimitExceeded).