Simultaneous two-photon imaging and two-photon manipulation of neural activity in freely- behaving mice The ability to record and manipulate neural activity in freely-behaving mice is a key step to understand the neural circuits under natural behavior. One-photon miniscope has become a mature technology and it can perform calcium imaging and optogenetics simultaneously while the mice freely behave. Though it has enabled many new discoveries in neuroscience, the ability to image and manipulate neural activity deeper into the tissue and in higher spatial specificity can further advance the field and enable studying many new questions. Compared to one-photon, two-photon techniques can access much deeper tissue and have a much higher spatial specificity. However, it has been challenging to integrate high performance optics into a compact footprint miniscope to perform simultaneous two-photon imaging and two-photon optogenetics, due to the excessive challenges in optical and mechanical design. Here, we propose a new miniscope that can simultaneously perform two-photon calcium imaging and two- photon optogenetics in freely-behaving mice. We innovatively integrate two different beam forming techniques in the miniscope for the imaging beam and optogenetics beam. This unique combination enables a very compact mechanical design and a high optical performance. Crucially, we will achieve a high-spatiotemporal-resolution in imaging, and patterned stimulation in optogenetics where a group of user-selected neurons could be simultaneously photostimulated. This allows us to manipulate the ensemble activity while monitoring the response of the neural circuit, all in cellular resolution. The entire device can have a dimension <~14x14x25 mm3 and a weight <3 g, suitable to be mounted on the skull of freely-moving mice. Furthermore, we will custom design and manufacture the optics to support a large field of view of 400 µm in diameter. This allows us to access a large amount of neurons. Finally, the focal depth of both beams could be controlled independently so we could image and manipulate the neural activity across a 3D brain volume. The success of this project will create a two-photon miniscope that can simultaneously image and manipulate neural activity, both in cellular resolution, high temporal resolution/specificity and over a large 3D volume deep in the brain tissue, in freely-behaving mice. The proposed miniscope could enable new research that is previously not possible, such as investigating the neural circuits of 2D navigation and social behavior. Our miniscope will greatly benefit the neuroscience community, and be readily deployed to many research labs. While we will design and test the miniscope for mice, its application could be extended to rats and non-human primates in future.