We simulate a method to teach a laser pulse sequences to excite specified molecular states. We use a learning procedure to direct the production of pulses based on "fitness" information provided by a laboratory measurement device. Over a series of pulses the algorithm learns an optimal sequence. The experimental apparatus, which consists of a laser, a sample of molecules, and a measurement device, acts as an analog computer that solves Schrodinger's equation exactly, in real time. We simulate an apparatus that learns to excite specified rotational states in a diatomic molecule.