I'm a software engineer, and when I get home from work, my hobbies are generally intellectual. So you could say that in a typical day, I do a full work day of intense intellectual effort, and then go home and relax by spending the rest of the day doing intense intellectual effort. Therefore, it's very important for me to avoid mental fatigue, and it seems like mental fatigue befalls me much easier when I'm trying to lose weight, often causing me to fail the diet.
What do I need to do so that the caloric deficiency of a weight loss diet will not make me have less energy for intensive intellectual effort?