[−][src]Function dqcsim::bindings::dqcs_gm_construct
#[no_mangle]pub extern "C" fn dqcs_gm_construct(
gm: dqcs_handle_t,
key_data: *const c_void,
qubits: dqcs_handle_t,
param_data: dqcs_handle_t
) -> dqcs_handle_t
Uses a gate map object to construct a multi-qubit DQCsim gate from 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
specifies the gate mapping key for the constructor to use. Note that the pointer must match exactly to what was specified when the mapping(s) was/were added.qubits
specifies the qubits arguments for the constructed gate. It is up to the constructor function to determine how to interpret these. The parameter is optional; passing 0 is equivalent to passing an empty qubit set. The handle is deleted if the function succeeds.param_data
specifies theArbData
object used to parameterize the gate. It is optional; if 0, an emptyArbData
is automatically constructed by DQCsim. The handle is deleted if the function succeeds.
This function returns the handle to the gate, or 0 to indicate failure. The qubit set and parameterization data (if specified) are consumed/deleted by this function if and only if it succeeds.