. For details on the implementation of the G-matrix contractions, see Section S7. The contraction of the B matrix with one (complex) vector from the left and two from the right in the second term of Eq. ( ) is evaluated analogously to the F-matrix contractions described in Ref. 49. There, the singles components of σ( tx , t y ) are contracted with the singles components of the t z amplitudes, whereas the contraction of the doubles is evaluated directly from the intermediates for constructing σ( tx , t y ) D , thereby avoiding the storage of any doubles intermediates. For the B-matrix contractions, the unperturbed Lagrange multipliers are replaced by response multipliers, and a contribution that originates from the projection onto the Hartree-Fock state is skipped.