In photosynthesis, chloroplasts' light-dependent reactions generate ATP, NADPH, and O$_2$. Oxygen (O$_2$) exits the chloroplast as a byproduct. ATP and NADPH fuel the light-independent reactions (Calvin cycle) within the chloroplast, yielding sugars.
Which of the following is responsible for the production of oxygen during photosynthesis?
A. Calvin cycle
B. Photolysis of water
C. Cyclic photophosphorylation
D. Reduction of NADP+