Ab initio computation of atomic and molecular polarizability