We report a self-consistent linear-combination-of-Gaussian-orbitals study of the electronic states and ground-state geometry of an undoped and doped single, infinite chain of trans-polyacetylene using the density-functional theory in the local-density approximation. We find a dimerized ground state for an undoped chain with a dimerization amplitude of about 0.01 Å, which is lower than the experimental value of 0.023–0.03 Å. A pure Hartree calculation neglecting all exchange and correlation gives a much smaller dimerization amplitude of less than 0.005 Å. The local exchange-correlation energy thus significantly favors the dimerization although its effect is not strong enough. In the calculations of the doped chains, the dopant ions were approximated by a uniform background charge. We find that the undimerized state becomes energetically more favorable than any uniformly dimerized state at a critical doping level of about 0.04 (0.03) extra holes (electrons) per CH unit. The band structures and total energies of polaron and soliton lattices at a higher doping level of 0.2 holes per CH unit are calculated and compared with those of the uniformly dimerized and undimerized lattices, and possible models of the metallic state of trans-polyacetylene are discussed. According to our study, the bonds become increasingly similar with increasing doping. The undimerized chain model seems to be a good approximation for the metallic state of trans-polyacetylene at high doping levels although the possibility for a marginal soliton lattice cannot be fully excluded.