HvD: A problem surfaced for the structure preserved closed shell code generation. When derivatives are generated using other routines the usual procedure may request derivatives of those routines that are not calculated for the closed shell case. E.g. DIFF(LDA(RHOA,RHOB)*GGA(...),RHOA,1,RHOB,1) will lead to terms asking for DIFF(LDA(RHOA,RHOB),RHOB,1) but a closed shell implementation of an LDA functional will not calculate that derivative. Instead DIFF(LDA(RHOA,RHOB),RHOA,1) is calculated which has the same value. Hence, after the differentiation is completed, the results asked for from the sub-expressions need to be translated to results that are actually  calculated.
HvD: A problem surfaced for the structure preserved closed shell code
generation. When derivatives are generated using other routines the usual
procedure may request derivatives of those routines that are not calculated
for the closed shell case. E.g. DIFF(LDA(RHOA,RHOB)*GGA(...),RHOA,1,RHOB,1) will
lead to terms asking for DIFF(LDA(RHOA,RHOB),RHOB,1) but a closed shell
implementation of an LDA functional will not calculate that derivative.
Instead DIFF(LDA(RHOA,RHOB),RHOA,1) is calculated which has the same value.
Hence, after the differentiation is completed, the results asked for from
the sub-expressions need to be translated to results that are actually 
calculated.

The canonicalArgs function that was introduced to do this translation. By adding
this in the eliminateAt function the expression optimizer can take advantage of
the additional similarities that result from this translation as well.





rangsimanketkaew/NWChem