Automated Operation Minimization of Tensor Contraction Expressions in Electronic Structure Calculations