To elucidate neural mechanisms underlying oscillatory phenomena in brain function, we have developed optogenetic tools and statistical methods. Specifically, opto-current-clamp induced oscillation reveals intrinsic frequency preferences in the neural circuits by oscillatory resonance. Furthermore, resonance or entrainment to intrinsic frequency is state-dependent. When resonance phenomena go beyond a certain range, it could even induce epileptic seizure in highly reproducible manner. We are able to study how seizures start, develop, and stop in neural circuits. Therefore, the optogenetics-induced oscillatory activation is a powerful tool in neuroscience research.