  We study a general theory on the interference of a two-photon wavepacket in a
beam splitter. The theory is carried out in the Schr\"{o}dinger picture so that
the quantum nature of the two-photon interference is explicitly presented. We
find that the topological symmetry of the probability-amplitude spectrum of the
two-photon wavepacket dominates the manners of two-photon interference which
are distinguished according to increasing and decreasing the coincidence
probability for the absence of interference. However, two-photon entanglement
can be witnessed by the interference manner. We demonstrate the necessary and
sufficient conditions for the perfect two-photon interference. For a two-photon
entangled state with an anti-symmetric spectrum, it passes a 50/50 beam
splitter with the perfect transparency. The theory contributes an unified
understanding to a variety of the two-photon interference effects.
