ket_process_apply_gate

Function ket_process_apply_gate 

Source
#[unsafe(no_mangle)]
pub extern "C" fn ket_process_apply_gate( process: &mut Process, gate: i32, angle: f64, use_param: bool, param_index: usize, target: usize, ) -> i32
Expand description

Applies a quantum gate to the target Qubit in the Process instance.

§Arguments

  • process - [in] A mutable reference to the Process instance.
  • gate - [in] An integer representing the gate type. See the function body for the mapping of gate values to gate types.
  • pi_fraction_top - [in] The numerator of the fraction part of the angle, used by certain gate types.
  • pi_fraction_bottom - [in] The denominator of the fraction part of the angle, used by certain gate types.
  • scalar - [in] A floating-point parameter value used by certain gate types.
  • target - [in] A reference to the target Qubit instance.

§Returns

An integer representing the error code. 0 indicates success.