Due to health problems, Ada Lovelace started using opium “systematically,” as her biographer notes, from 1841 onward. Her mentor and collaborator Charles Babbage is an interesting figure, too, the author of both “On the Economy of Machinery and Manufactures” as well as the Ninth Bridgewater Treatise, a work on natural theology. The fourth chapter of the latter work is titled “On the Account of the Creation in the First Chapter of Genesis.” Scanning the chapter’s opening pages, one discovers references to geology. Most mysterious of all, though: Ada’s letters to Babbage contain references to a “lady-fairy” and “Fairy-Guidance.” Babbage’s nickname for Ada was “Enchantress of Number.” Her hope, apparently, was to “bequeath to the generations a Calculus of the Nervous System.” As her health declined in the 1850s to the point where opium no longer controlled her pain, she began to experiment with cannabis. Ada was largely forgotten after her death until her rediscovery by figures like Alan Turing nearly 100 years later in the 1940s and 1950s. The key to all of this magic, I think, is what Ada called “cycles” and “cycles of cycles,” or loops and nested loops.