Quantum Dynamics of the Photodissociation of Hydrogen Halides in Rare Gas Matrices. I. The Initial State