This light-switch technology promises to accelerate scientists’ efforts in mapping which clusters of the brain’s 100 billion neurons warble to each other when a person, for example, recalls a memory or learns a skill. That quest is one of the greatest challenges facing neuroscience.

The channelrhodopsin switch is “really going to blow the lid off the whole analysis of brain function,” said George Augustine, a neurobiologist at Duke University in Durham, N.C.

Dr. Deisseroth, who is also a psychiatrist who treats patients with autism or severe depression, has ambitious goals. Brain cells in those disorders show no damage, yet something is wrong with how they talk to one another, he said.

“The high-speed dynamics of the system are probably off,” Dr. Deisseroth said. He wants to learn whether, in these neuropsychiatric diseases, certain neurons falter or go haywire, and then to find a way to tune patients’ faulty circuits.

A first step is establishing that it is possible to tweak a brain circuit by remote control and observe the corresponding behavioral changes in freely moving lab animals. On a recent Sunday at Stanford, Dr. Deisseroth and Feng Zhang, a graduate student, hovered over a dark brown mouse placed inside a white plastic tub. Through standard gene-manipulating tricks, the rodent had been engineered to produce channelrhodopsin only in one particular kind of neuron found throughout the brain, to no apparent ill effect.

Mr. Zhang had implanted a tiny metal tube into the right side of the mouse’s partly shaved head.

Now he carefully threaded a translucent fiber-optic cable not much wider than a thick human hair into that tube, positioned over the area of the cerebral cortex that controls movement.