There were errors in the script dihedral.py that was included as the original supplementary material to Ref. 1. Line 209 was incorrectly implemented as
cos2_123 = r12_dot_r23**2/(r_12sq*r_34sq)but is correctly implemented as
cos2_123 = r12_dot_r23**2/(r_12sq*r_23sq)Line 228 was incorrectly implemented as
grad_s123_2 = −(grad_s123_1 + grad_123_3)but is correctly implemented as
grad_s123_2 = −(grad_s123_1 + grad_s123_3)Line 238 was incorrectly implemented as
c_234=s_123*ds_234_divcos*r12_dot_r23/
(r_12sq*r_23sq)but is correctly implemented as
c_234=s_123*ds_234_divcos*r23_dot_r34/
(r_23sq*r_34sq)
The error in line 238 affected Fig. 2 in Ref. 1, which is corrected below. We have also corrected the supplementary material of Ref. 1. We regret these errors and thank Yiheng Wu and Riccardo Alessandri for bringing them to our attention.