docs: def laser_detunings(Lij, Nl, i_d, I_nd, Nnd):
      r"""This function returns the list of transitions i,j that each laser
      produces as lists of length Ne, whose elements are all zero except for the
      ith element =1 and the jth element = -1.
  
      Also, it returns detuningsij, which contains the same information
      but as pairs if ij. The indices in it start from 0.
      """
      Ne = len(Lij)
      detunings = [[] for i in range(Nl)]
      detuningsij = [[] for i in range(Nl)]
      detuning = [0 for i in range(Nnd)]
      for i in range(1, Ne):
          for j in range(i):
              for l in Lij[i][j]:
                  det = detuning[:]
                  det[I_nd(i+1)-1] += 1; det[I_nd(j+1)-1] -= 1
                  if det not in detunings[l-1]:
                      detunings[l-1] += [det]
                      detuningsij[l-1] += [(I_nd(i+1)-1, I_nd(j+1)-1)]
  
      return detunings, detuningsij