A quantum is a very big battery that pro togs use to get super fast flash recycling times and huge numbers of flashes per charge.
Your choices are really limited to SB400, SB600 and SB800 if you want to have easy TTL flash. Out of these the SB800 is the top of the range, the SB600 mid range and SB400 bottom of the range.
I think which one will be best for you will depend on if you are likely to expand you kit over time or will just stick to the D40.
The reason is that the D40 doesn't have the wireless flash commander that the higher range cameras (e.g. D80, D200 etc) have so at the moment you can't benefit from the Wireless flash functions that the SB600 / SB800 have.
Basically if you think you are likely to upgrade cameras in the future go for the SB800 now rather than waiting and having to upgrade camera and flash in the future at a later date. The SB800 is only a little more than the SB600, is a little more powerful and comes with an expanded battery option, flash diffuser and colour correction gels that the SB600 doesn't have or are optional extras on the SB600. I've just paid £205.98 delivered for a new SB800 from Kerso and wish that I had bought one of these rather than my SB600 a year ago.
However, if you are likely to keep your D40 and unlikely to upgrade then the SB400 will probably do you fine.