project_trace function

Project diagonal elements to have trace of zero