  Preparation of quantum state lies at the heart of quantum information
processing. The greedy algorithm provides a potential method to effectively
prepare quantum states. However, the standard greedy algorithm, in general,
cannot take the global maxima and instead becomes stuck on a local maxima.
Based on the standard greedy algorithm, in this paper we propose a revised
version to design dynamic pulses to realize universal quantum state
preparation, i.e., preparing any arbitrary state from another arbitrary one. As
applications, we implement this scheme to the universal preparation of single-
and two-qubit state in the context of semiconductor quantum dots and
superconducting circuits. Evaluation results show that our scheme outperforms
the alternative numerical optimizations with higher preparation quality while
possesses the comparable high efficiency. Compared with the emerging machine
learning, it shows a better accessibility and does not require any training.
Moreover, the numerical results show that the pulse sequences generated by our
scheme are robust against various errors and noises. Our scheme opens a new
avenue of optimization in few-level system and limited action space quantum
control problems.
