Application of Lie algebra to NMR spectroscopy