Calculation of the electrical conduction of molecules and nanowires