Quantum control of I2 in the gas phase and in condensed phase solid Kr matrix