We give an alternative derivation for the explicit formula of the effective Hamiltonian describing the evolution of the quantum state of any number of photons entering a linear optics multiport. The description is based on the effective Hamiltonian of the optical system for a single photon and comes from relating the evolution in the Lie group that describes the unitary evolution matrices in the Hilbert space of the photon states to the evolution in the Lie algebra of the Hamiltonians for one and multiple photons. We give a few examples of how a group theory approach can shed light on some properties of devices with two input ports.