Molecular Photoswitching in Confined Spaces

Conspectus In nature, light is harvested by photoactive proteins to drive a range of biological processes, including photosynthesis, phototaxis, vision, and ultimately life. Bacteriorhodopsin, for example, is a protein embedded within archaeal cell membranes that binds the chromophore retinal within its hydrophobic pocket. Exposure to light triggers regioselective photoisomerization of the confined retinal, which in turn initiates a cascade of conformational changes within the protein, triggering proton flux against the concentration gradient, providing the microorganisms with the energy to live. We are inspired by these functions in nature to harness light energy using synthetic photoswitches under confinement. Like retinal, synthetic photoswitches require some degree of conformational flexibility to isomerize. In nature, the conformational change associated with retinal isomerization is accommodated by the structural flexibility of the opsin host, yet it results in steric communication between the chromophore and the protein. Similarly, we strive to design systems wherein isomerization of confined photoswitches results in steric communication between a photoswitch and its confining environment. To achieve this aim, a balance must be struck between molecular crowding and conformational freedom under confinement: too much crowding prevents switching, whereas too much freedom resembles switching of isolated molecules in solution, preventing communication. In this Account, we discuss five classes of synthetic light-switchable compounds—diarylethenes, anthracenes, azobenzenes, spiropyrans, and donor–acceptor Stenhouse adducts—comparing their behaviors under confinement and in solution. The environments employed to confine these photoswitches are diverse, ranging from planar surfaces to nanosized cavities within coordination cages, nanoporous frameworks, and nanoparticle aggregates. The trends that emerge are primarily dependent on the nature of the photoswitch and not on the material used for confinement. In general, we find that photoswitches requiring less conformational freedom for switching are, as expected, more straightforward to isomerize reversibly under confinement. Because these compounds undergo only small structural changes upon isomerization, however, switching does not propagate into communication with their environment. Conversely, photoswitches that require more conformational freedom are more challenging to switch under confinement but also can influence system-wide behavior. Although we are primarily interested in the effects of geometric constraints on photoswitching under confinement, additional effects inevitably emerge when a compound is removed from solution and placed within a new, more crowded environment. For instance, we have found that compounds that convert to zwitterionic isomers upon light irradiation often experience stabilization of these forms under confinement. This effect results from the mutual stabilization of zwitterions that are brought into close proximity on surfaces or within cavities. Furthermore, photoswitches can experience preorganization under confinement, influencing the selectivity and efficiency of their photoreactions. Because intermolecular interactions arising from confinement cannot be considered independently from the effects of geometric constraints, we describe all confinement effects concurrently throughout this Account.

f rameworks is dependent on the density of the photochromic units. In less crowded frameworks, spiropyran switches reversibly as in solution; in more crowded f rameworks, spiropyran converts spontaneously to merocyanine, driven by mutual stabilization of neighboring zwitterions. 2  Conf inement of azobenzene on the surface of nanoparticles enables preorganization of these switches adjacent to background ligands that facilitate their isomerization. We also observe cooperative switching of neighboring azobenzenes within small aggregates on the nanoparticle surface. Nat. Nanotechnol. 2016, 11, 82−88. Reversible assembly of nanoparticles leads to the creation and destruction of conf ined environments, or "nanof lasks", located interstitially within the aggregate. Preorganization of anthracenes within these nanof lasks results in reaction acceleration and regioselective photodimerization to the syn product. 4

INTRODUCTION
Photoisomerization of retinal drives diverse processes that are critical to life in all organisms, ranging from ion transport across bacterial membranes to vision in animals. The proteins responsible for harnessing the isomerization of retinal are called opsins. Bacteriorhodopsin, for example, is a seventransmembrane-helix proton pump that binds retinal within its hydrophobic cavity, wherein the chromophore forms an imine bond with the protein's Lys216 residue ( Figure 1). 5 Illumination of bacteriorhodopsin triggers trans→cis isomerization of the bound all-trans retinal selectively at the 13position. This selectivity is remarkable considering that retinal contains several photoisomerizable CC bondsin fact, photoirradiation of all-trans retinal in solution results in an illdefined mixture of 9-cis-, 11-cis-, and 13-cis-retinal. Furthermore, photoswitching of retinal within the confinement of the protein proceeds with a quantum yield of up to 67%, whereas each of the solution products forms in a poor yield of a few percent. Other protein scaffolds can guide the same process with entirely different selectivities. For example, proteins called photoisomerases can similarly bind all-trans-retinal and direct its switching precisely at the 11-position. 6 The trans→cis isomerization of the bound retinal is accompanied by a large conformational change, which initiates a sequence of structural changes within the bacteriorhodopsin host, ultimately resulting in unidirectional transport of protons outside the cell. 7 While achieving the level of photoswitching precision found in nature is challenging, we are inspired by these processes to harness molecular photoswitches for the creation of functional molecular machines and materials.
Photoswitchable molecules have been studied extensively in solution and have been used as building blocks for synthetic molecular machines, which have the potential to convert light energy into mechanical work. The vast majority of known photoswitches require some degree of conformational freedom for reversible switching. Just as isomerization of retinal within opsins initiates a signaling cascade, isomerization of synthetic photoswitches can enable their communication with the environment. Switching of free (noninteracting) molecules in solution, however, while highly efficient, does not entail communication with other components of the system. To facilitate better communication between photoswitches and their environment, we are thus investigating the behavior of these molecules under confinement. Molecular confinement generally arises when a species is physically trapped (as opposed to covalently bound) within a partially or completely enclosed environment. 8 As such, their diffusion is limited and their movement is constrained, thereby influencing their chemical reactivity. For the purpose of this Account, we also consider species that are tethered to a surface or framework to be confined, as they likewise experience a partially enclosed environment and their movement is restricted.
Successful switching and communication under confinement require achieving a delicate balance between conformational freedom and molecular crowding. Historically, the term molecular crowding has been used to describe cellular environments wherein the majority of the volume is physically occupied by large (i.e., not solvent) molecules. 9 In nature, this crowded environment influences the way biomolecules diffuse through the cell, which in turn affects their structure,   10 Similarly, a very crowded molecular environment prohibitively restricts the freedom available for a photoswitch; unsuccessful switching has been observed within single crystals, 11,12 densely packed monolayers, 13,14 and cavities of rigid coordination cages. 15 Confined systems that offer too much conformational freedom and not enough molecular crowding, however, constitute environments that are functionally similar to solution-state systems. As in solution, photoswitches communicate weakly with these loosely confined systems. In pursuit of this balance, a range of different strategies have been developed to accommodate the conformational changes associated with photoswitching under confinement. 8 These strategies include diluting densely packed monolayers of photoswitches with shorter molecules, 16,17 decorating photoswitches with spacer groups, 18,19 and confining them on curved substrates, 20 within porous solids, 21,22 within the spaces between aggregated nanoparticles, 4 or within the cavities of flexible coordination cages. 23 To compare the behaviors of photoswitchable molecules within different confined environments, we have organized this Account according to the type of photoswitch, roughly in order of increasing demand for conformational freedom. Furthermore, we have included switches that undergo unimolecular photoisomerization or photodimerization, as these two types of molecules show similar behavioral responses under confinement. We begin by discussing diarylethenes, including dihydropyrene switches, which require only a small degree of freedom for efficient isomerization. We then transition to anthracenes, which undergo cyclodimerization between two neighboring molecules and require a greater degree of conformational freedom. Next, we discuss the behavior of confined azo switches, including azobenzenes and arylazopyrazoles, which require a high degree of conformational freedom for switching. Uniquely, spiropyran and donor−acceptor Stenhouse adducts form zwitterionic isomers upon switching, and we show in the final section how intermolecular interactions between zwitterions often govern the behavior of these switches under confinement.

CONFINED DIARYLETHENES
In this section, we discuss bridged diarylethenes (DAEs), whose switching entails 6π electrocyclization ( Figure 2a) and thus requires a minimal degree of conformational freedom. As they isomerize, these molecules reversibly switch between an open, nonconjugated form and a closed, conjugated form. In general, switching of these molecules does not result in steric clashes with their environment, and reversible switching can be readily achieved when these molecules are confined on solid surfaces or within small cavities. The small degree of conformational freedom required for DAE isomerization is best manifested by the observation of photoswitching in the crystalline state, which occurs efficiently while being accompanied by small changes in the overall shape of the single crystal (Figure 2b). 24 Because the electrocyclic ring closing of DAE establishes efficient π-electron conjugation throughout the molecule, interest in using these photoswitches to modulate the electronic properties of materials 25 has motivated the study of their behavior under confinement. In pioneering studies, mixed self-assembled monolayers of a thiolated DAE and dodecanethiol were prepared on planar gold surfaces. Dodecanethiol ligands are electrically insulating and similar in length to the DAE ligands, creating a crowded molecular environment around the photoswitches. 26,27 By scanning tunneling microscopy (STM), the confined DAE units were nevertheless observed to switch reversibly and with high efficiency, comparable to their behavior in solution. These results suggest that confinement of DAEs within densely packed monolayers does not restrict the small conformational changes associated with isomerization. Similar observations were recorded upon confinement of DAE switches within an amorphous polymer matrix. 28 Within more rigid environments, such as highly ordered polymer matrices, some differentiation between the two isomers of DAE can be achieved: while the closed form is planar and can pack closely with other closed-   28 Reversible switching of DAEs under confinement has also been achieved within networks of carbon nanotubes 29 and organic thin films. 30 Uniquely among DAE photoswitches, dihydropyrene (DHP) exhibits negative photochromism: upon irradiation with visible light, the closed, colored form undergoes a ringopening reaction to form cyclophanediene (CPD), and the back reaction can be performed either upon irradiation with UV light or thermally in the dark (Figure 2c). To accommodate the conformational freedom required for DHP isomerization, we encapsulated DHP within flexible coordination cage 1 (Figure 2d). 31 This pseudo-octahedral cage selfassembles from six Pd 2+ cations, four triimidazole ligands, and six tetramethylethylenediamine (TMEDA) ligands (the latter occupy the two external coordination sites on each metal center). 32 The inherent flexibility of cage 1 is derived from torsion around the bonds between the imidazole groups and the central benzene ring within each ligand. Encapsulation of DHP within cage 1 is accompanied by a red shift in the absorption bands associated with DHP in the UV/vis spectrum and an upfield shift of the signals corresponding to DHP in the 1 H NMR spectrum. By following the forward reaction and the thermal back reaction over time using UV/vis spectrophotometry, we found that the rates of DHP switching under confinement within the cage cavity and in solution are similar. Specifically, isomerization of DHP to CPD proceeds approximately 3 times slower under confinement than in solution, but encapsulation does not influence the thermal back reaction. Furthermore, molecular dynamics (MD) simulations indicate that cage 1 deforms similarly upon encapsulation of either DHP or CPD. 31 Considering these experimental and computational results concurrently, we surmise that cage 1 can easily adapt in response to the small structural changes that accompany DHP isomerization. Interestingly, although encapsulation does not significantly alter the switching behavior of DHP, we determined that confinement within cage 1 serves to protect the unstable biradical intermediate 33 associated with this reaction. While only 70% of free DHP remains intact after 10 switching cycles, >90% of encapsulated DHP is maintained under the same irradiation conditions (Figure 2e,f, respectively). This degree of stabilization, which we attribute primarily to distancing of reactive radical species from one another, is remarkable given the large open panels within cage 1 (Figure 2d, right).

CONFINED ANTHRACENES
Most of the photoswitches highlighted in this Account undergo unimolecular photoisomerization; in contrast, anthracenes (and similar compounds, such as coumarins) undergo a dimerization reaction upon irradiation with light. While the mechanisms for unimolecular photoisomerization and photodimerization are very different, both reactions are triggered upon irradiation with light of a certain wavelength, and both can be reversed thermally and/or upon irradiation with light of another wavelength. More specifically, irradiation of anthracenes with near-UV (∼350 nm) light triggers a [4+4] photodimerization reaction (Figure 3a). The dimer can then revert back to anthracene upon exposure to higher-energy (∼250 nm) UV light or upon heating above 100°C. The dimerization reaction requires a relatively small degree of conformational freedom, and in this respect, the behavior of confined anthracenes is similar to that of DAE photoswitches described in the previous section. While dimerization of anthracene under confinement rarely results in steric clashes with the environment, confinement effects can nevertheless influence the reactivity of these species.
In confined spaces, there is a delicate balance between having enough conformational freedom for anthracene switching and having too much molecular crowding. This balance is beautifully illustrated in a recent report wherein four anthracene molecules were encapsulated within a spherical cavity of a metal−organic framework (ZIF-8). 34 Results from X-ray crystallography and UV/vis spectrophotometry suggested that irradiation with UV light leads to selective photodimerization of one pair of anthracene molecules, while the remaining two anthracenes remain as monomers ( Figure  3b−d). The initial (preirradiation) state within the cavity in this system provides enough conformational freedom for two anthracene molecules to dimerize; however, this reaction results in an environment that is too sterically hindered for switching of the second anthracene pair.
Anthracenes can also be switched within cavities formed upon aggregation of nanoparticles (NPs), which we have termed "nanoflasks" (Figure 3e,f). 4 By following changes in the characteristic absorbance of photodimerization products around 350−370 nm, we found that when 9-anthracenemethanol molecules were entrapped within these nanoflasks, the photodimerization reaction was accelerated by 2 orders of magnitude compared with the same reaction in solution ( Figure 3g). This effect is primarily attributed to the increased local concentration of anthracene molecules under confinement. Furthermore, hydrogen bonding between 9-anthracenemethanol and ligands on the NPs results in preorganization of the trapped molecules within the cavity. In addition to contributing to the observed increase in dimerization rate, this effect significantly modulates the regioselectivity of this photoreaction (Figure 3h). We used 1 H NMR spectroscopy to identify the anti and syn isomers on the basis of the chemical shifts of the tertiary protons adjacent to the hydroxymethyl groups, which appear at 4.1 and 4.4 ppm, respectively. The photodimerization of 9-anthracenemethanol in solution yields the thermodynamically favored anti isomer, with the hydroxyl groups pointing in opposite directions within dianthracene. Interactions between anthracene molecules and NP ligands within these nanoflasks, however, preorganize the molecules around the "edge" of the nanoflask, resulting in preferential (>80%) formation of the syn isomer.
While typical anthracenes undergo [4+4] photocycloaddition upon irradiation with UV light, installing an ethynyl moiety at the 9-position can also induce a [4+2] Diels−Alder addition. 35 Confining these 9-ethynylanthracenes, however, can induce either of these reactions to proceed with high selectivity. For example, confinement within supramolecular gels induces the [4+2] reaction selectively. 36 In contrast, preorganization of thiolated 9-ethynylanthracene on a planar gold surface prevents the mutual orientation of molecules required for the [4+2] Diels−Alder reaction, thus resulting in the [4+4] photodimerization (Figure 3i). 37 Similar regioselectivity was observed upon preorganizing the same ligands on a curved surface, but the reaction proceeded with lower efficiency. 38 This modulation in reactivity is attributed to the difference in curvature of planar and curved surfaces. On the Accounts of Chemical Research pubs.acs.org/accounts Article planar surface, the terminal anthracene units are in close proximity, facilitating the [4+4] photodimerization. On the curved surface, however, the distance between anthracene moieties is larger because the angle between adjacent ligands is greater, hindering the reaction between neighboring switches. Changing the surface curvature thus modulates the photostationary state of this reaction.
To further examine preorganization on curved surfaces, we appended the same 9-ethynylanthracene ligands to gold NPs of different sizes (Figure 3j). 39 Importantly, the curved surfaces of NPs offer a convenient method of modulating the reactivity of anthracenes by adjusting the surface curvature. On 2.5 nm gold NPs, no photoreaction was observed (as concluded from the fact that there were no changes in absorption at ∼400 nm, which is diagnostic of unreacted anthracene). We repeated the same experiment using 5.5 and 7.5 nm gold NPs, which have less curvature. Upon irradiation with UV light, the reaction yields were determined as 9% and 26% on 5.5 and 7.5 nm NPs, respectively. These results suggest that curvature plays an important role in modulating the switching efficiency of ethynylanthracenes. Compared with 5.5 and 7.5 nm NPs, the 2.5 nm particles have more curvature and thus longer distances between the ligands. This geometry positions neighboring anthracene headgroups too distant from one another to undergo [4+4] photodimerization. In contrast, the distance between ligands is shorter on larger NPs, and neighboring anthracene units are positioned close enough to react. This effect was verified by the trend relating increasing NP size to increasing [4+4] reaction yield. 39

CONFINED AZO COMPOUNDS
In this section, we compare the behaviors of azo photoswitches, including azobenzenes and arylazopyrazoles, in the presence and absence of confinement. Upon irradiation with UV light, the planar trans isomer of azobenzene undergoes a large conformational change to the nonplanar cis form ( Figure  4a). Because azo compounds require a high degree of conformational freedom to achieve switching, there are a plethora of examples wherein confinement of azo switches leads to a marked decrease in their switchability. 11,13−15 Although the environment around confined azo switches must be carefully designed, these photoswitches are perhaps the most promising candidates for harnessing the power of light to drive more complex systems. 40,41 Crucially, the high degree of Accounts of Chemical Research pubs.acs.org/accounts Article conformational freedom required by azo switches enables them to interact with their environment, facilitating the emergence of cooperative effects and communication throughout a system. 42−44 As in previous sections, our early investigations into the behavior of azobenzene molecules under confinement focused on elucidating the impact of molecular crowding on switching efficiency. 3,16,45 By using gold NPs of different sizes, we tuned surface curvature and thus the distance between terminal azobenzene groups on the ligands. Larger NPs, for instance, have less curvature and shorter ligand−ligand distances, creating a more crowded environment. We measured the rates of azobenzene isomerization on the surface of these nanoparticles by following the evolution of their UV/vis absorption spectra over time under irradiation with light. Upon comparing the behaviors of azobenzene confined on 2.6, 4.4, 6.2, and 7.8 nm gold NPs, we observed that decreasing the distance between azobenzene units decreases photoswitching efficiency. 16 Similarly, steric effects have also been reported to suppress azobenzene switching on planar gold surfaces. 46−48 On these surfaces, chromophore density can be modulated by preparing mixed self-assembled monolayers of azobenzene and alkanethiolate spacer ligands. 16 Decreasing chromophore density in these systems can thus be accomplished by increasing the percentage of spacer ligands; as observed on curved surfaces, 20 less molecular crowding around the azobenzene ligands resulted in higher rates of photoswitching. 16 To follow photoswitching on planar surfaces, we used UV/vis differential reflectance spectroscopy to show that less molecular crowding is also correlated with more complete conversion from trans to cis. We observed a similar effect upon increasing the percentage of spacer ligands on gold NPs: a higher percentage of the cis isomer can be obtained with greater chromophore dilution. 3 Having achieved successful photoswitching of azobenzenes on gold NPs, we investigated intermolecular interactions between ligands within these environments and their effects on the rate of azobenzene switching. To this end, we synthesized NPs functionalized with mixed monolayers of different azobenzenes and different background ligands, systematically varying the length of the thiolate tether and the terminal functional group on the background ligand. 3 MD simulations suggested that when azobenzene 2 is combined with significantly shorter background ligand 3 (Figure 4b), the hydrophobic azobenzene units bundle together in water, minimizing their exposure to the polar solvent (Figure 4c). These bundles displayed remarkable photoswitching behavior; instead of inefficient switching, as one might expect from a crowded environment, aggregation was observed to accelerate isomerization of azobenzenes. As inferred from similar behavior exhibited by azobenzene on planar surfaces 16,42 and within single crystals, 49 this result suggests a cooperative switching mechanism whereby isomerization of one azobenzene molecule within the bundle results in communication with a neighboring azobenzene, facilitating its isomerization.
To further investigate the effect of intermolecular interactions on azobenzene switching, we synthesized NPs cofunctionalized with azobenzene ligand 4 and hydroxyterminated thiol 5 (Figure 4d). 3 Upon confinement on the NP surface, the hydroxyl group of the background ligand can form a hydrogen bond with azobenzene's nitrogen atoms, decreasing the double-bond character of the azo bond and facilitating the trans ⇄ cis switching in both directions ( Figure  4e). Compared with an analogous system with methylterminated background ligands, azobenzene back-isomerization in this system proceeded up to 500 times faster.
In addition to investigating azobenzene isomerization on surfaces, we have probed the behavior of azo photoswitches within the cavity of a coordination cage. Although photoisomerization of azo compounds requires a high degree of conformational freedom and does not proceed in the cavity of rigid coordination cages, 15 we anticipated that switching could be accommodated by the inherent flexibility of cage 1 ( Figure  2d). Upon encapsulation of azo analogues, 1:1 or 2:1 inclusion Accounts of Chemical Research pubs.acs.org/accounts Article complexes were observed to form depending on the substitution pattern on the azobenzene core. 1 The formation of these complexes was accompanied by an upfield shift of the guest signals in the 1 H NMR spectra. Furthermore, we obtained X-ray crystal structures that illustrate the adaptivity of cage 1, showing significant distortion of the cage upon conforming to the geometry of the encapsulated guest molecules (Figure 4f, left). Recently, Pavan et al. used atomistic MD and metadynamics simulations to map out the conformational free energy landscape of the empty cage in solution. 50 According to these simulations, the structural rearrangement of the cage upon encapsulation of azo guests incurs a relatively large penalty (e.g., ∼8 kcal/mol for cage deformation caused by binding of two molecules of transazobenzene). This energetic cost is offset by favorable host− guest interactions and release of water molecules from the hydrophobic cavity. Upon irradiation with UV light, all of the encapsulated transazo compounds were observed (by UV/vis and 1 H NMR spectroscopies) to convert to their corresponding cis isomers. 1,51 For complexes encapsulating two trans-azo guests, isomerization within the cavity was followed by expulsion of one guest, while the second guest remained within the cavity. Additional simulations provided insight into the mechanism of isomerization and guest release. Upon irradiation of the system with light, one of the two trans isomers converts to the cis form under confinement (Figure 4f). The resulting complex, in which trans and cis isomers are coencapsulated, is highly unstable, leading to preferential expulsion of the cis isomer. 50

CONFINED SPIROPYRANS AND DASA SWITCHES
Within this section, we examine the effects governing the switching behavior of spiropyran/merocyanine and donor− acceptor Stenhouse adduct (DASA) switches under confinement. Spiropyran is composed of two heterocyclic rings bound through a single (spiro) carbon atom; upon light-induced ringopening followed by Z−E isomerization, spiropyran is converted to merocyanine, 52 the colloquial name for the open form of this photoswitch (Figure 5a). By comparison, DASAs first undergo photoinduced Z−E isomerization, followed by a 4π electrocyclization (Figure 5b). 53 Preference for the open versus closed form of these two switches is dependent on environmental conditions such as solvent polarity, and switching to the metastable form can be accomplished upon irradiation with light of a particular wavelength. As for azo compounds, the ring-opening/closing reactions experienced by spiropyrans and DASAs require high degrees of conformational freedom (Figure 5b). Furthermore, both types of switches form zwitterionic compounds upon isomerization. The effects that emerge upon confinement of zwitterions are strong and are often observed to dominate the behavior of these photoswitches.
Because spiropyran molecules require a high degree of conformational freedom to achieve switching, one may Accounts of Chemical Research pubs.acs.org/accounts Article anticipate that highly crowded environments should hinder isomerization. We began our investigation within this section by appending spiropyran ligands onto Au 25 nanoclusters. 54 These nanoclusters have a high degree of curvature, resulting in long distances between individual ligands. Furthermore, we incorporated shorter background ligands onto the nanoclusters such that only approximately four spiropyrans (vs ∼14 background ligands) were present on each particle. Because of the combined effects of surface curvature and chromophore dilution, the extent of crowding around each spiropyran in these systems was minimal. Upon sequential irradiation with UV and visible light, reversible isomerization between surfaceconfined spiropyran and merocyanine was observed by following the merocyanine absorption peak at λ max = 587 nm; we detected no significant difference in photoswitching behavior compared with spiropyran in solution. 54 To further investigate the effect of surface curvature on the switching behavior, we confined spiropyran ligands onto larger gold NPs. 55 We functionalized 2.6 nm NPs with a mixture of spiropyran and alkyl (spacer) ligands. At relatively high chromophore dilution (χ = 0.33, meaning 33% of the ligands were terminated with a spiropyran unit), isomerization of spiropyran to merocyanine was readily achieved upon irradiation with UV light, as confirmed by a decrease in absorbance at 800 nm. Interestingly, thermal relaxation back to spiropyran proceeded several times slower on these NPs than in solution (Figure 5c), which was attributed to the mutual stabilization of the zwitterionic merocyanine units on the NPs. 52,56 At higher chromophore densities, isomerization from spiropyran to merocyanine drove NP aggregation. When the mole fraction of spiropyran was increased from χ = 0.6 to χ = 0.9, the half-life of the resulting aggregates lengthened from 9 to 72 s. In these systems, stabilization occurs not only between merocyanine units on the same NP but also between different NPs within aggregates, slowing their disassembly ( Figure  5d). 55 We observed a similar effect upon coating the surface of magnetite NPs with a monolayer of DASA ligands. 57 We used UV/vis spectrophotometry to confirm adsorption of the ligands onto the NPs and to monitor their photoswitching behavior. Upon attachment to NPs, the otherwise-stable open form of these switches spontaneously and irreversibly isomerized to the closed, zwitterionic form. In other words, the photostationary state of this switch was significantly perturbed under confinement. As for merocyanine confined on gold NPs, this effect was attributed to mutual stabilization between the zwitterionic form of DASA under confinement on the NP surface. Crucially, the rate and degree of stabilization were dependent on the curvature of the NPs: spontaneous conversion to the zwitterionic form was faster and proceeded to a larger extent on larger NPs, which have less curvature and thus support stabilization between the neighboring DASA zwitterions more efficiently (Figure 5e,f).
Furthermore, upon covalent incorporation of spiropyran within a porous aromatic framework (PAF), we observed a similar stabilization effect using electron microscopies (SEM and TEM) and UV/vis spectrophotometry. 2 Upon desolvation of this material, the solid grains were observed to shrink and change in color from faint yellow to deep blue (λ max ≈ 550 nm), indicating spontaneous conversion from spiropyran to merocyanine. As on the surface of NPs, this effect is due to interactions between zwitterionic merocyanine units, which experience mutual stabilization under confinement. When the PAF was resolvated, the material returned to its original structure, and merocyanine was converted back to spiropyran. By using other building blocks, a more rigid photoresponsive framework was obtained (Figure 4g). 2 The rigidity of this PAF prevented collapse upon desolvation, and spontaneous conversion to merocyanine was not observed. Instead, we successfully drove reversible switching between spiropyran and merocyanine using light of two different wavelengths. Efficient reversible photoisomerization within nanoporous materials has also been accomplished for other spiropyran derivatives 58 as well as azobenzenes 59,60 and overcrowded alkenes. 22,61 In addition to confining spiropyrans on surfaces and within porous solids, we also probed the behavior of these photoswitches within the cavity of a coordination cage using UV/vis spectrophotometry and 1 H NMR spectroscopy. Upon encapsulation of spiropyran 7 SP within cage 1, spontaneous conversion to zwitterionic merocyanine 7 MC was observed ( Figure 5h); this process was accompanied by a downfield shift of the acidic imidazole protons of the cage (8.8−9.3 ppm) and an increase in the absorbance at 592 nm (due to the MC isomer). 23 Unlike previous examples within this section, wherein mutual stabilization of zwitterions drove the formation of the zwitterionic form, only one merocyanine unit can be encapsulated within cage 1. In this case, stabilization of the merocyanine form is primarily due to π−π stacking interactions with aromatic panels from the cage framework. 62 Furthermore, we observed a dynamic equilibrium between deprotonated and protonated (7 MCH ) merocyanine within the cage (Figure 5i). While both merocyanine species are stabilized by π−π stacking with the cage, 7 MC is stabilized by additional electrostatic interactions with the positively charged cage framework, which renders it non-photoresponsive. Upon irradiation with light corresponding to the absorbance maximum of the minor species 7 MCH , however, efficient ring closing to form 7 SP proceeded, gradually shifting the 7 MC ⥃ 7 MCH equilibrium to the right and ultimately achieving a system-wide conversion to spiropyran (Figure 5i). Although the merocyanine and spiropyran forms feature very different conformations, the conformational freedom required for switching was readily accommodated by the flexible structure of the cage.

CONCLUSION
Communication between molecular photoswitches and their environment relies on achieving a balance between conformational freedom and molecular crowding. In nature, this balance is showcased by the isomerization of retinal within bacteriorhodopsin, which constitutes the initial step of the cascade leading to transmembrane proton flux against the concentration gradient. In this Account, we have discussed the behaviors of different classes of synthetic photoswitches within different types of confined environments and compared their behaviors in the presence and absence of confinement. We observe a trend wherein photoswitches that require less conformational freedom, such as diarylethenes and anthracenes, require less stringent design conditions to achieve successful switching under confinement. Confinement of these molecules often results in switching rates similar to those in solution, and no significant communication between these switches and their environment is observed. Even in these cases, however, confinement influences the behavior of photoactive species, e.g., by improving fatigue resistance of dihydropyrene switching or by modulating the selectivity of Accounts of Chemical Research pubs.acs.org/accounts Article anthracene cycloaddition. Conversely, photoswitches that require a high degree of conformational freedom, such as azobenzenes, can present a significant design challenge in confined systems. While there are many examples in which azo compounds do not switch within crowded environments, successful photoisomerization of these molecules can lead to dramatically different behaviors under confinement compared with in solution. Effective communication between these switches and their environment can lead to effects such as modulation of the isomerization rate or guest release. In particular, we anticipate that isomerization-triggered guest release could ultimately be harnessed for chemical signaling, similar to the way retinal isomerization initiates phototransduction in nature. Photoswitches that form zwitterionic compounds upon isomerization, such as spiropyrans and DASA compounds, constitute an interesting exception to the trends described above. Upon switching to their zwitterionic forms, these photoswitches often experience a stabilization effect under confinement, either because of zwitterion− zwitterion interactions or because of interactions with their immediate environment.
In the future, we plan to explore the behavior of molecular photoswitches within an even wider range of confined environments, including densely packed 63,64 and non-closepacked 65 nanoparticle arrays and binding pockets within biomolecules. 66 Already we have begun to harness the behavior of photoswitches under confinement to perform system-wide functions. Switching of azobenzenes confined on the surface of NPs, for instance, can drive their reversible aggregation. 67−71 By systematically varying the degree of molecular crowding within confined environments, we will continue to develop our understanding of the trade-off between crowding and conformational freedom, tuning the balance required for using photoswitches within functional systems and materials.