[][src]Function dqcsim::bindings::dqcs_gm_add_fixed_unitary

#[no_mangle]pub extern "C" fn dqcs_gm_add_fixed_unitary(
    gm: dqcs_handle_t,
    key_free: Option<extern "C" fn(key_data: *mut c_void)>,
    key_data: *mut c_void,
    matrix: dqcs_handle_t,
    num_controls: isize,
    epsilon: c_double,
    ignore_gphase: bool
) -> dqcs_return_t

Adds a unitary gate mapping for the given gate matrix to the given gate map. >

gm must be a handle to a gate map object (dqcs_gm_new()). key_free is an optional callback function used to free key_data when the gate map is destroyed, or when this function fails. key_data is the user-specified value used to identify this mapping. matrix must be passed a handle to the matrix to detect. It is consumed by this function. num_controls specifies the number of control qubits associated with this gate type. If negative, the gate can have any number of control qubits. If zero or positive, the number of control qubits must be as specified. epsilon specifies the maximum element-wise root-mean-square error between the incoming matrix and the to be detected matrix that results in a positive match. ignore_phase specifies whether the aforementioned check should ignore global phase or not when there are no explicit control qubits.

The parameterization ArbData object returned by detection and consumed by construction is mapped one-to-one to the user data of the gate in the DQCsim-protocol.