cideriv takes target state
intermediate: more work on core orbitals in grad
another cideriv fix
a couple of fixes - some important
minor
still need to check, but looks reasonable. all the terms implemented.