Frequency dependent polarizabilities for the ground state of H2, HD, and D2