docs: def lande_g_factors(element, isotope, L=None, J=None, F=None):
      r"""Return the Lande g-factors for a given atom or level.
  
      >>> element = "Rb"
      >>> isotope = 87
      >>> print(lande_g_factors(element, isotope))
      [ 9.9999e-01  2.0023e+00 -9.9514e-04]
  
      The spin-orbit g-factor for a certain J
      >>> print(lande_g_factors(element, isotope, L=0, J=1/Integer(2)))
      [0.9999936864200584 2.0023193043622 -0.0009951414 2.00231930436220]
  
      The nuclear-coupled g-factor for a certain F
      >>> print(lande_g_factors(element, isotope, L=0, J=1/Integer(2), F=1))
      [0.9999936864200584 2.0023193043622 -0.0009951414 2.00231930436220
       -0.501823752840550]
  
      """
      atom = Atom(element, isotope)
      gL = atom.gL
      gS = atom.gS
      gI = atom.gI
  
      res = [gL, gS, gI]
      if J is not None:
          if L is None:
              raise ValueError("A value of L must be specified.")
          S = 1/Integer(2)
          gJ = gL*(J*(J+1)-S*(S+1)+L*(L+1))/(2*J*(J+1))
          gJ += gS*(J*(J+1)+S*(S+1)-L*(L+1))/(2*J*(J+1))
          res += [gJ]
      if F is not None:
          II = atom.nuclear_spin
          if F == 0:
              gF = gJ
          else:
              gF = gJ*(F*(F+1)-II*(II+1)+J*(J+1))/(2*F*(F+1))
              gF += gI*(F*(F+1)+II*(II+1)-J*(J+1))/(2*F*(F+1))
          res += [gF]
  
      return array(res)