num_acc_experiment module

Numerical accuracy experiment for the qmatmul package.

Measures the relative error of float32 computations against a float64 reference, for both the direct (definition-based) and algo (proposed fast algorithm) approaches, CUDA backend. A single deterministic run per problem size is used (no repetitions or warm-up, as this is an accuracy study, not a timing study).

Primary metrics: relative_frobenius_error (global accuracy), and max_abs_error together with max_combined_error (worst-case accuracy; max_combined_error uses the same atol/rtol tolerance already used for the np.allclose correctness checks in main.py). max_relative_error, rms_error and min_abs_ref are auxiliary metrics characterizing the element-wise error distribution.

num_acc_experiment.relative_frobenius_error(C_approx, C_ref_f64)[source]

Relative error in Frobenius norm.

num_acc_experiment.max_relative_error(C_approx, C_ref_f64, eps=1e-15)[source]

Element-wise relative error.

num_acc_experiment.rms_error(C_approx, C_ref_f64)[source]

Root-mean-square absolute error.

num_acc_experiment.min_abs_ref(C_ref_f64)[source]

Smallest absolute reference value present in this run.

num_acc_experiment.max_abs_error(C_approx, C_ref_f64)[source]

Maximum absolute error.

num_acc_experiment.max_combined_error(C_approx, C_ref_f64, atol=0.01, rtol=1e-05)[source]

Maximum elementwise error relative to the np.allclose tolerance boundary. A value <= 1 means every element would pass np.allclose(rtol=rtol, atol=atol).