  Most quantum processors requires pulse sequences for controlling quantum
states. Here, we present an alternative algorithm for computing an optimal
pulse sequence in order to perform a specific task, being an implementation of
a quantum gate or a quantum state preparation. In our method, we reduced
drastically the number of parameters to be fitted, by using a limited number of
functions as the modulations for the amplitude and phase of the radio-frequency
pulses, and employed approximations to make the algorithm fast and scalable. We
demonstrate the success of the proposed algorithm, by performing several real
experiments for 4, 7 and 12 quantum bits systems using NMR. In addition, we
have also shown the efficiency of the algorithm, finding pulses for controlling
with good fidelity the quantum states of spins in a fictional square
bi-dimensional lattices containing 16, 36 and 100 qubits.
