  Compensation for parameter dispersion is a significant challenge for control
of inhomogeneous quantum ensembles. In this paper, we present a systematic
methodology of sampling-based learning control (SLC) for simultaneously
steering the members of inhomogeneous quantum ensembles to the same desired
state. The SLC method is employed for optimal control of the state-to-state
transition probability for inhomogeneous quantum ensembles of spins as well as
$\Lambda$ type atomic systems. The procedure involves the steps of (i) training
and (ii) testing. In the training step, a generalized system is constructed by
sampling members according to the distribution of inhomogeneous parameters
drawn from the ensemble. A gradient flow based learning and optimization
algorithm is adopted to find the control for the generalized system. In the
process of testing, a number of additional ensemble members are randomly
selected to evaluate the control performance. Numerical results are presented
showing the success of the SLC method.
