deltakit.circuit.noise_channels.MultiProbabilityNoiseChannel.approx_equals#
- MultiProbabilityNoiseChannel.approx_equals(other: object, *, rel_tol: float = 1e-09, abs_tol: float = 0) bool#
Determine whether two noise channels are equal within a given tolerance. The tolerance accounts for differences in the probabilities and all other properties of the noise channel must be the same.
- Parameters:
other (object) – The other object to compare this noise channel to.
rel_tol (float) – The allowed relative difference between the error probabilities of the two noise channels, if this is larger than that calculated from abs_tol. Has the same meaning as in math.isclose. By default, 1e-9.
abs_tol (float, optional) – The allowed absolute difference between the error probabilities of the two noise channels, if this is larger than that calculated from rel_tol. Has the same meaning as in math.isclose. By default, 0.0.
- Return type:
bool