def eval_e_x_polarized_using_e_x_unpolarized(e_x_unpolarized):
  """Decorator function for computing e_x for spin polarized case.

  The spin-scaling relation for exchange energy is used:
  e_x(rhoa, rhob) = 0.5 * (e_x(2*rhoa) + e_x(2*rhob))

  Args:
    e_x_unpolarized: function to evaluate exchange energy density
      for spin unpolarized case.

  Returns:
    Function to evaluate exchange energy density for spin polarized case.
  """

  def e_x_polarized(rhoa, rhob, sigma_aa, sigma_ab, sigma_bb, **kwargs):
    """Evaluates exchange energy density for spin polarized case.

    Args:
      rhoa: Float numpy array with shape (num_grids,), the spin up
        electron density.
      rhob: Float numpy array with shape (num_grids,), the spin down
        electron density.
      sigma_aa: Float numpy array with shape (num_grids,), the norm square
        of density gradient (aa component).
      sigma_ab: Float numpy array with shape (num_grids,), the norm square
        of density gradient (ab component).
      sigma_bb: Float numpy array with shape (num_grids,), the norm square
        of density gradient (bb component).
      **kwargs: Dict, extra arguments for e_x_unpolarized function.

    Returns:
      Float numpy array with shape (num_grids,), the exchange energy density.
    """
    del sigma_ab
    return 0.5 * (e_x_unpolarized(2 * rhoa, 4 * sigma_aa, **kwargs)
                  + e_x_unpolarized(2 * rhob, 4 * sigma_bb, **kwargs))

  return e_x_polarized