Lecture notes on electron correlation and magnetism