[−][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. >
gmmust be a handle to a gate map object (dqcs_gm_new()).key_freeis an optional callback function used to freekey_datawhen the gate map is destroyed, or when this function fails.key_datais the user-specified value used to identify this mapping.matrixmust be passed a handle to the matrix to detect. It is consumed by this function.num_controlsspecifies 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.epsilonspecifies 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_phasespecifies whether the aforementioned check should ignore global phase or not when there are no explicit control qubits.The parameterization
ArbDataobject returned by detection and consumed by construction is mapped one-to-one to the user data of the gate in the DQCsim-protocol.