Density-functional study of the dimerization of trans-polyacetylene.