There are specific genes that determine the regulation of circadian rhythm in conjunction with light. When light activates NMDA receptors in the SCN, CLOCK gene expression in that region is altered and the SCN is reset, and this is how entrainment occurs. Genes also involved with entrainment are PER1 and PER2.
