Since the calculation of all zeros can now be avoided, improvements in speed and memory will now follow. To get a handle on how these CCD calculations are implemented we need only to look at the most expensive sum in equation (3). This corresponds to the sum over \( klcd \). Since this sum is repeated for all \( i < j \) and \( a < b \), it means that these equations will scale as \( \mathcal{O}(n_{p}^{4} n_{h}^{4}) \). However, they can be rewritten using intermediates as $$ \begin{align} 0 = \langle ab|\hat{v}|ij \rangle + \hat{P}(ab) \sum_{c} \langle b| \chi |c\rangle \langle ac| t |ij\rangle - \hat{P}(ij) \sum_{k} \langle k| \chi |j\rangle \langle ab| t |ik\rangle & \nonumber \\ + \frac{1}{2}\sum_{cd} \langle ab| \chi |cd\rangle \langle cd| t |ij\rangle + \frac{1}{2} \sum_{kl} \langle ab| t |kl\rangle \langle kl| \chi |ij\rangle \tag{14}\\ + \hat{P}(ij)\hat{P}(ab) \sum_{kc} \langle ac| t |ik\rangle\langle kb| \chi |cj\rangle & \nonumber \end{align} $$ for all \( i,j,a,b \).