Computer simulation of the entropy of polypeptides using the local states method: application to cyclo-(Ala-Pro-D-Phe)2 in vacuum and in the crystal