A quantum description of the beam splitter