code to compute neural complexity