def test_merge_with_pauli_noise(): p = Program(X(0)).inst(Z(0)) probs = [0.0, 1.0, 0.0, 0.0] merged = merge_with_pauli_noise(p, probs, [0]) assert (merged.out() == """DEFGATE pauli_noise: 1.0, 0 0, 1.0 PRAGMA ADD-KRAUS pauli_noise 0 "(0.0 0.0 0.0 0.0)" PRAGMA ADD-KRAUS pauli_noise 0 "(0.0 1.0 1.0 0.0)" PRAGMA ADD-KRAUS pauli_noise 0 "(0.0 0.0 0.0 0.0)" PRAGMA ADD-KRAUS pauli_noise 0 "(0.0 0.0 0.0 -0.0)" X 0 pauli_noise 0 Z 0 pauli_noise 0 """)
def test_merge_with_pauli_noise(): p = Program(X(0)).inst(Z(0)) probs = [0., 1., 0., 0.] merged = merge_with_pauli_noise(p, probs, [0]) assert merged.out() == """DEFGATE pauli_noise: