The accurate numerical computation of optimal controls of infinite-dimensional quantum control problems is a very difficult task that requires us to take into account the features of the original infinite-dimensional problem. An important issue is the choice of the functional space where the minimization process is defined. A systematic comparison of L2- versus H1-based minimization shows that the choice of the appropriate functional space matters and has many consequences in the implementation of some optimization techniques. A matrix-free cascadic BFGS algorithm is introduced in the L2 and H1 settings, and it is demonstrated that the choice of H1 over L2 results in a substantial performance and robustness increase. A comparison between optimal control resulting from function space minimization and the control obtained by minimization over Chebyshev and proper orthogonal decomposition basis function coefficients is presented.