Hydrogen bonding and collective proton modes in clusters and periodic layers of squaric acid: A density functional study