[−][src]Function dqcsim::bindings::dqcs_gm_add_measure
#[no_mangle]pub extern "C" fn dqcs_gm_add_measure(
gm: dqcs_handle_t,
key_free: Option<extern "C" fn(user_data: *mut c_void)>,
key_data: *mut c_void,
num_measures: isize,
basis: dqcs_handle_t,
epsilon: f64
) -> dqcs_return_t
Adds a measurement gate mapping 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 freekey_data
when the gate map is destroyed, or when this function fails.key_data
is the user-specified value used to identify this mapping.num_measures
specifies the number of measured qubits for this gate type. If negative, the gate can have any number of measured qubits. If zero or positive, the number of measured qubits must be as specified.basis
optionally specifies a handle to a 2x2 matrix specifying the measurement basis to be detected. If not specified, the Z basis is used. The matrix is deleted by the call iff the function succeeds.epsilon
specifies the maximum RMS deviation between the specified basis (if any) and the incoming basis.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.