The first step to simulate the dynamics of spin systems is
to construct the basic elements of Nuclear Magnetic Resonance (NMR)
including the Liouvillian matrix, relaxation matrix, pulse matrix and
equilibrium state. It is easy to deal with single spin systems, but
there are more challenges to do coupled-spin systems. The computer
algebra software provides the feasibility to build these elements for
n-spin systems. Applying these elements, we can simulate and analyze
the whole process of NMR experiments of more complex spin systems and
pulse sequences in symbolic or numerical ways. In this talk, we will
illustrate the computation of some experiments such as spin echo,
steady state, INADEQUATE. We may also show how to efficiently
compute the objective function, its first-order and second-order
derivatives in the optimal pulse design.