The following helper function is currently used in several examples throughout the codebase, and it would be nice to have it defined.
function noisy_pair_func(perfect_pair, F)
p = (4*F - 1) / 3
perfect_pair_dm = SProjector(perfect_pair)
mixed_dm = MixedState(perfect_pair_dm)
return p * perfect_pair_dm + (1 - p) * mixed_dm
end