Electronic structure and mechanism for conductivity in thiophene oligomers and regioregular polymer