original_docstring: Gets expected XC energy density from spin polarized rho and derivatives.
docstring: Gets expected XC energy density from spin polarized rho and derivatives.
docstring_tokens: Gets expected XC energy density from spin polarized rho and derivatives .
code: def _get_expected_e_xc_polarized(rho_and_derivs, xc_name):
    """Gets expected XC energy density from spin polarized rho and derivatives."""
    rho_a, grad_x_a, grad_y_a, grad_z_a, _, tau_a = rho_and_derivs[0]
    rho_b, grad_x_b, grad_y_b, grad_z_b, _, tau_b = rho_and_derivs[1]
    sigma_aa = grad_x_a ** 2 + grad_y_a ** 2 + grad_z_a ** 2
    sigma_ab = grad_x_a * grad_x_b + grad_y_a * grad_y_b + grad_z_a * grad_z_b
    sigma_bb = grad_x_b ** 2 + grad_y_b ** 2 + grad_z_b ** 2
    if xc_name == 'B97':
      return (gga.e_x_b97_polarized(rho_a, rho_b, sigma_aa, sigma_ab, sigma_bb)
              + gga.e_c_b97_polarized(rho_a, rho_b, sigma_aa, sigma_ab, sigma_bb))
    elif xc_name == 'wB97M-V':
      return mgga.e_xc_wb97mv_polarized(
          rho_a, rho_b, sigma_aa, sigma_ab, sigma_bb, tau_a, tau_b)
    else:
      raise ValueError
code_tokens: def _get_expected_e_xc_polarized ( rho_and_derivs , xc_name ) : rho_a , grad_x_a , grad_y_a , grad_z_a , _ , tau_a = rho_and_derivs [ 0 ] rho_b , grad_x_b , grad_y_b , grad_z_b , _ , tau_b = rho_and_derivs [ 1 ] sigma_aa = grad_x_a ** 2 + grad_y_a ** 2 + grad_z_a ** 2 sigma_ab = grad_x_a * grad_x_b + grad_y_a * grad_y_b + grad_z_a * grad_z_b sigma_bb = grad_x_b ** 2 + grad_y_b ** 2 + grad_z_b ** 2 if xc_name == 'B97' : return ( gga . e_x_b97_polarized ( rho_a , rho_b , sigma_aa , sigma_ab , sigma_bb ) + gga . e_c_b97_polarized ( rho_a , rho_b , sigma_aa , sigma_ab , sigma_bb ) ) elif xc_name == 'wB97M-V' : return mgga . e_xc_wb97mv_polarized ( rho_a , rho_b , sigma_aa , sigma_ab , sigma_bb , tau_a , tau_b ) else : raise ValueError
short_docstring: Gets expected XC energy density from spin polarized rho and derivatives.
short_docstring_tokens: Gets expected XC energy density from spin polarized rho and derivatives .
comment: """Gets expected XC energy density from spin polarized rho and derivatives."""