a, Schematic showing viral injection and fiber implantation for optogenetic activation of MeApd Vgat+ neurons. b, Example image of injection site and viral expression in the MeApd of Vgat-Cre animals. Scale bar = 200 μm. c, Schematic showing real-time place preference assay (RTPP). Light blue area indicates the chamber paired with light stimulation when the animal enters. d, Representative heatmaps showing locomotion trajectories of control (top) and ChR2-experessing (bottom) mice in the RTPP test. e, ChR2-expressing animals display a significant preference for stimulation-coupled chamber compared to EYFP-expressing controls. ***P < 0.001, Mann-Whitney test (two-sided). f, Schematic showing an intracranial self-stimulation assay. The active port is coupled with optogenetic stimulation. g, Cumulative distribution of the number of nose-pokes in the active port by a representative ChR2-expressing or control animal in the self-stimulation assay. h, ChR2-expressing animals exhibit greater number of pokes in the active port, whereas control animals do not. Two-way repeated measures ANOVA with Bonferroni post-hoc correction (***P < 0.001). i, Schematic showing a modified social operant task, where presentation of target animals is replaced with 2-s optogenetic stimulation of the MeApd Vgat+ neurons. Poking the optogenetic “social” port leads to a 3-s delay followed by a 2-s stimulation, whereas poking the null port leads to a time-out with no stimulation. The 5-day experiment consists of 1 day of baseline session, 3 days of training sessions, and 1 day of post-training session. j, k, ChR2-expressing animals develop a strong preference (j) for and increased nose-pokes (k) in the optogenetic “social” port over 3 days of training, whereas control animals do not. Two-way repeated measures ANOVA with Bonferroni post-hoc correction (*P < 0.05, **P < 0.01, ***P < 0.001). l, m, Cumulative distribution of the numbers of pokes in control (l) and ChR2-expressing (m) mice on day 3 of training. In (b-e), n = 16 mice (ChR2) and n = 6 mice (control); in (g, h), n = 10 mice (ChR2) and n = 6 mice (control); in (j-k), n = 8 mice (ChR2) and n = 6 mice (control). (e, h) boxplots: center = median, box = quartiles, whisker = 10–90 percentile; (j, k) mean ± SEM. For detailed statistics information, see Supplementary Table 1.