A smooth l(1)-norm based function to obtain a sparse representation of the orbital coefficients is introduced. This sparseness function is further parametrized with respect to unitary transformations among the occupied orbitals. Thus the function can be straightforwardly included in an optimization scheme or used on the fly during self-consistent field iterations to induce or maintain the sparsity of the orbital coefficients. As practical examples, we induce sparsity in the orbital coefficients of liquid water and bulk silicon. We also report the sparsity of the orbital coefficients of 1024 water molecules along a short Born-Oppenheimer molecular dynamics trajectory. It is observed that, after a stabilization period, the sparsity of the orbitals can be kept stable along the dynamics with small additional computational effort.