Invention is not the product of logical thought, even though the final product is tied to a logical structure.
Source, in full
From his "Autobiographische Skizze" (18 April 1955), original German version here. Translation from Subtle is the Lord: The Science and the Life of Albert Einstein by Abraham Pais (1982), p. 131. Pais notes that when he said "during that year", he was referring to some time between October 1895 and early fall 1896.