Ab initio calculation of the crystalline structure and IR spectrum of polymers: Nylon 6 polymorphs