def _ms_opatom(op):
    """
    Stringify the operator part of a term.  If multiple motional modes are
    being considered, then the resultant Mathematica object will have `2n+1`
    arguments for `n` motional modes.
    """
    sy = 1 if op[0] == 'P' else 2
    pairs = ','.join(str(x) for pair in op[1:] for x in pair)
    return f'op[{sy},{pairs}]'