Now I am quite new to the chemistry, and learn little pieces at a time; I have read that heating a sample is one way to detect the presence of diacetyl, through tasting or smell.
Yep, that's called a forced diacetyl test. The increased temperature accelerates the conversion of α-acetolactate to diacetyl.
But there are quantitative methods involving not-so-cheap laboratory equipment (UV spectrometer for example), which would be great actually. I suppose if one had the means, equipment such as this would be one good way of actually measuring the levels of diacetyl, as likely professional brewers do this I assume.
Not-so-cheap is an understatement. I don't know any commercial brewers using test equipment for diacetyl. (Maybe the macros do.) There are also chemical assays available, but I can't say I know anyone using those either. The forced diacetyl test is (IMO) a practical (and very cheap) option .
Even just following printed recipes one does get curious about the chemistry of beer. Part of the journey right?
If you are interested in brewing chemistry, I recommend Roger Barth's "The Chemistry of Beer: The Science in the Suds." It's comprehensive, but I think it's approachable for anyone who has had, say, a high school chemistry course. I would avoid "Brew Chem 101: The Basics of Homebrewing Chemistry." I was so disappointed in that book that I read and annotated the whole thing, and gave it to someone who had also recently purchased it, so that they wouldn't be misled.