Accounting for electron–electron and electron–lattice effects in conjugated chains and rings