Lectures on beam optics