cirq.phase_flip

Returns a PhaseFlipChannel that flips a qubit's phase with probability p.

Used in the notebooks

Used in the tutorials

If p is None, return a guaranteed phase flip in the form of a Z operation.

This channel evolves a density matrix via:

ρM0ρM0+M1ρM1

With:

M0=1p[1001]M1=p[1001]

p the probability of a phase flip.

ValueError if p is not a valid probability.