The theoretical chemist, who typically researches quantum mechanics, discovered a passion for zymurgy, the science of fermentation. His interest in flavorful drinks expanded to coffee when a member of his brew club began roasting beans. As with beer, Hamilton studied the chemical makeup of the beverage and began giving lectures on how coffee is cultivated, roasted and brewed.

Even career chemists learn something in these lectures, Hamilton says — such as the fact that the flavor and aromatic compounds in beer and coffee are also present in other foods. Damascenone, for instance, which offers baked apple notes, is marketed as a flavoring agent; it is a product of the Maillard reaction, the same chemical reaction that browns steaks and bread crusts as they heat.

Flavors in beer come from a surprising number of sources. One is the variety of sugar-type compounds in the beverage, which give brews their sweetness. Other than the sugars, much of a particular brew’s complexity of tastes comes from the hops used in its production.

The essential oils in hops can “contribute a lot of flavors like citrus, grapefruit and orange,” Hamilton said. “They’re what you smell.”

Compounds such as geraniol and citral are extremely common in beer, giving it a geranium-like or citrusy smell, respectively.

Some flavor and aroma compounds can be less savory. If a beer does not ferment long enough or correctly, it may taste like Granny Smith apples, thanks to acetaldehyde. This compound, produced as an intermediate step in fermentation, is not pleasant, Hamilton says. Another undesirable compound is 2-transnonenal, which tastes like damp paper.

However, some styles of beer do not have much hop flavor at all and derive a lot of their flavors from the brewing yeast.

“In ales, there are a lot of ester compounds that come across as pretty fruity,” Hamilton said. “It’s all about the balance. You don’t want it to be overwhelming.”

In contrast, much of the flavor in coffee comes from pyrazines. These small aromatic compounds form much of the initial flavor of freshly brewed coffee.

“That’s one reason coffee is so much better when it’s fresh,” Hamilton said.

Other aspects of coffee’s flavor come from the sugars that are broken down by roasting.

At the end of the day, the most desirable trait he looks for in a beer is that “every sip is the same,” he said.