  Nonadiabatic unitary evolution with tailored time-dependent Hamiltonians can
prepare systems of cold atomic gases with various desired properties. For a
system of two one-dimensional quasicondensates coupled with a time-varying
tunneling amplitude, we show that the optimal protocol, for maximizing any
figure of merit in a given time, is bang-bang, i.e., the coupling alternates
between only two values through a sequence of sudden quenches. Minimizing the
energy of one of the quasicondensates with such nonadiabatic protocols, and
then decoupling it at the end of the process, can result in effective cooling
beyond the current state of the art. Our cooling method can be potentially
applied to arbitrary systems through an integration of the experiment with
simulated annealing computations.
