Proposal for realizing an all-optical half adder based on photonic crystals.