Wigner function as the expectation value of a parity operator