Removed unnecessary get_gradient calls from update_structure.