Quantum chemistry calculations for molecules coupled to reservoirs: Formalism, implementation, and application to benzenedithiol | Synapse