[−][src]Function dqcsim::bindings::dqcs_gm_detect
#[no_mangle]pub extern "C" fn dqcs_gm_detect(
gm: dqcs_handle_t,
gate: dqcs_handle_t,
key_data: *mut *const c_void,
qubits: *mut dqcs_handle_t,
param_data: *mut dqcs_handle_t
) -> dqcs_bool_return_t
Uses a gate map object to convert an incoming DQCsim gate to the plugin's representation. >
gm
must be a handle to a gate map object (dqcs_mm_new()
).gate
must be a handle to a gate. The handle is borrowed; it is not mutated or deleted.key_data
serves as an optional return value; if non-NULL and a match is found, thekey_data
specified when the respective detector was added is returned here as aconst void *
. If no match is found,*key_data
is not assigned.qubits
serves as an optional return value; if non-NULL and a match is found, it is set to a handle to a newQubitSet
object representing the gate's qubits. Ownership of this handle is passed to the user, so it is up to the user to eventually delete it. If no match is found,*qubits
is set to 0.param_data
serves as an optional return value; if non-NULL and a match is found, it is set to a handle to a newArbData
object representing the gate's parameters. Ownership of this handle is passed to the user, so it is up to the user to eventually delete it. If no match is found,*param_data
is set to 0.This function returns
DQCS_TRUE
if a match was found,DQCS_FALSE
if no match was found, orDQCS_BOOL_FAILURE
if an error occurs.