The ontologies students use-their conceptions about the nature of entities-impact the way they learn physics and reason through physics problems. We investigate students' capacities for flexible use of ontologies in a modern physics context, focusing on students' reasoning around two quantum entities (photons and electrons) for three canonical topics in introductory quantum physics (double slit experiment, Mach-Zehnder interferometer, and quantum tunneling). We present a description of a full framework to describe and distinguish between different kinds of dynamic ontologies. The framework identifies possible ontological structures in individual reasoning episodes, three of which we identify in our data set: unitary (applying a single stable ontology), parallel (switching back and forth between multiple ontologies), and blended (constructing a novel ontology by blending two or more input ontologies). These different ontological structures are applied to the specific ontologies used (e.g., wave or particle) for the specific entity (e.g., photon or electron). We demonstrate the utility of the framework by coding individual responses from a representative sample of an introductory modern physics course to an array of written and multiple-choice questions on homework, exams, and pre-and postsurveys. We present and explore the patterns of use of ontologies across the three topical contexts and these various modalities. We demonstrate that students use a variety of ontologies and ontological structures across entities and topic areas, even when not explicitly prompted to do so. In addition to providing evidence of students' capacities for flexible use of ontologies, we find that the wording and framing of the question prompts impact students' use of ontologies. Expanding on the aggregate data, we engage in analysis of a few notable examples to demonstrate how the wording, framing, and content of prompts can intersect to collectively impact students' use of ontologies and ontological structures.