polarization function

Calculate polarization