original_docstring: calculate the sum of state for D2 molecule at T 
docstring: calculate the sum of state for D2 molecule at T
docstring_tokens: calculate the sum of state for D2 molecule at T
code: def sumofstate_D2(T):
      """calculate the sum of state for D2 molecule at T """
  
      Q = np.float64(0.0)
  
      #--- nuclear spin statistics ------------
      g_even = 6        # deuterium
      g_odd = 3
      # ---------------------------------------
  
      data = eJD2
  
      nCols = data.shape[1]
      # nCols is equal to the number of vibrational
      #  states included in the summation
  
      # generate Q using each energy from the dataset
      for i in range(0, nCols):
  
          # select row for v=i
          row = data[:,i]
  
          # remove nan values
          x = row[np.logical_not(np.isnan(row))]
  
          # get the dimension (equal to J_max)
          nRows = x.shape[0]
  
          # iterate over the available energies
          for j in range(0, nRows):
              E = x[j]
              energy = (-1*E*H*C)
  
              factor = (2*j+1)*math.exp(energy/(K*T))
  
              if j % 2 == 0:
                  factor = factor*g_even
              else:
                  factor = factor*g_odd
              Q = Q+factor
  
  
  
      #   return the sum of states for H2
      return Q
code_tokens: def sumofstate_D2 ( T ) : Q = np . float64 ( 0.0 ) g_even = 6 g_odd = 3 data = eJD2 nCols = data . shape [ 1 ] for i in range ( 0 , nCols ) : row = data [ : , i ] x = row [ np . logical_not ( np . isnan ( row ) ) ] nRows = x . shape [ 0 ] for j in range ( 0 , nRows ) : E = x [ j ] energy = ( - 1 * E * H * C ) factor = ( 2 * j + 1 ) * math . exp ( energy / ( K * T ) ) if j % 2 == 0 : factor = factor * g_even else : factor = factor * g_odd Q = Q + factor return Q
short_docstring: calculate the sum of state for D2 molecule at T
short_docstring_tokens: calculate the sum of state for D2 molecule at T
comment: """calculate the sum of state for D2 molecule at T """$SEP$#--- nuclear spin statistics ------------$SEP$# deuterium$SEP$# ---------------------------------------$SEP$# nCols is equal to the number of vibrational$SEP$#  states included in the summation$SEP$# generate Q using each energy from the dataset$SEP$# select row for v=i$SEP$# remove nan values$SEP$# get the dimension (equal to J_max)$SEP$# iterate over the available energies$SEP$#   return the sum of states for H2