Einstein gave substantial thought to what he described as “cosmic religion,” a spirituality that flows from the work of science.