“The Dreams in the Witch House” was probably inspired by the lecture The Size of the Universe given by Willem de Sitter which Lovecraft attended three months prior to writing the story. De Sitter is even named in the story; he is mentioned as a mathematical genius, and remarked among other intellectual masterminds, including Albert Einstein. Several prominent motifs—including the geometry and curvature of space, and a deeper understanding of the nature of the universe through pure mathematics—are covered in de Sitter’s lecture. The idea of using higher dimensions of non-Euclidean space as short cuts through normal space can be traced to A. S. Eddington’s The Nature of the Physical World which Lovecraft alludes to having read (SL III p 87). These new ideas supported and developed a very similar conception of a fragmented mirror space that Lovecraft had previously developed in “The Trap” (written mid 1931).
An H. P. Lovecraft Encyclopedia says that “The Dreams in the Witch House” was “heavily influenced by Nathaniel Hawthorne’s unfinished novel Septimius Felton“.