[−][src]Function dqcsim::bindings::dqcs_mat_approx_eq
#[no_mangle]pub extern "C" fn dqcs_mat_approx_eq(
a: dqcs_handle_t,
b: dqcs_handle_t,
epsilon: c_double,
ignore_gphase: bool
) -> dqcs_bool_return_t
Approximately compares two matrices. >
a
andb
are borrowed matrix handles.epsilon
specifies the maximum element-wise root-mean-square error between the matrices that results in a positive match.ignore_gphase
specifies whether the check should ignore global phase.If ignore_gphase is set, this checks that the following holds for some x:
\f[ A \cdot e^{ix} \approx B \f]
This function returns
DQCS_TRUE
if the matrices match according to the aforementioned criteria, orDQCS_FALSE
if not.DQCS_BOOL_ERROR
is used when either handle is invalid or not a matrix. If the matrices differ in dimensionality,DQCS_FALSE
is used.