  We study how to simulate, efficiently, pulse field gradients (PFG) used in
nuclear magnetic resonance (NMR). An efficient simulation requires
discretization in time and space. We study both discretizations and provide a
guideline to choose best discretization values depending on the precision
required experimentally. We provide a theoretical study and simulation showing
the minimum number of divisions we need in space for simulating, with high
precision, a sequence composed of several unitary evolution and PFG. We show
that the fast simulation of PFG allow us to optimize sequences composed of PFG,
radio-frequency pulses and free evolution, to implement non-unitary evolution
(quantum channels). As an evidence of the success of our work, we performed two
types of experiments. First, we implement two quantum channels and compare the
results with their theoretical predictions. In the second experiment, we used
the fast simulation of PFG to optimize and implement a sequence to prepare
pseudo pure state with better signal to noise ratio than any known procedure
till now.
