def E_nl_dirac(n, l, spin_up=True, Z=1, c=Float('137.035999037')):
 if (not (l >= 0)):
  raise ValueError("'l' must be positive or zero")
 if (not (n > l)):
  raise ValueError("'n' must be greater than 'l'")
 if ((l == 0) and (spin_up is False)):
  raise ValueError('Spin must be up for l==0.')
 if spin_up:
  skappa = ((- l) - 1)
 else:
  skappa = (- l)
 c = S(c)
 beta = sqrt(((skappa ** 2) - ((Z ** 2) / (c ** 2))))
 return (((c ** 2) / sqrt((1 + (((Z ** 2) / (((n + skappa) + beta) ** 2)) / (c ** 2))))) - (c ** 2))

def E_nl_dirac ( n , l , spin_up = True , Z = 1 , c = Float ( '137.035999037' ) ) : if ( not ( l >= 0 ) ) : raise ValueError ( "'l' must be positive or zero" ) if ( not ( n > l ) ) : raise ValueError ( "'n' must be greater than 'l'" ) if ( ( l == 0 ) and ( spin_up is False ) ) : raise ValueError ( 'Spin must be up for l==0.' ) if spin_up : skappa = ( ( - l ) - 1 ) else : skappa = ( - l ) c = S ( c ) beta = sqrt ( ( ( skappa ** 2 ) - ( ( Z ** 2 ) / ( c ** 2 ) ) ) ) return ( ( ( c ** 2 ) / sqrt ( ( 1 + ( ( ( Z ** 2 ) / ( ( ( n + skappa ) + beta ) ** 2 ) ) / ( c ** 2 ) ) ) ) ) - ( c ** 2 ) )
returns the relativistic energy of the state in hartree atomic units .