Introduction

Two-dimensional covalent organic frameworks (2D COFs) are a kind of layered crystalline polymers, where the component molecular building blocks are chemically bonded to form planar monoatomic layers that are stacked by van der Waals (vdW) interaction. The unique structure of 2D COFs endows them with highly customizable structures and properties1,2,3,4,5,6. In particular, tremendous attention has been paid to the intrinsic 1D and 2D nano-confined space in 2D COFs, because it provides an ideal platform for investigating material interactions and revealing new mechanisms at nanoscale, which repetitively extends our inherent cognition of materials’ structures and properties7,8,9. For instance, water has been observed to show unusually low dielectric constant in hBN nanochannels10, nearly zero friction in small-diameter carbon nanotubes11, square ice phase confined between two graphene sheet12 and ultra-high melting point in carbon nanotubes13,14. Moreover, nano-confined space is an ideal reactor for the synthesis of biomolecules under mild conditions, which might be closely related to the formation of life15.

In principle, the weak vdW interaction between atomic layers of 2D COFs makes it possible to reversibly modulate the size of 1D nanochannels of 2D COFs by layer-layer sliding. However, such a goal is challenging, because the slipped AA-stacking is the most thermodynamically stable configuration for the most of 2D COFs16. Current efforts in modulating the lattice structure of crystals mainly include: (1) Conversion by the existence and departure of the guest molecules, which is also called the breathing effect17,18,19. (2) Shape memory effect, i.e., a material’s morphology changes in response to an external stimulus, and that morphology persists until another stimulus is applied. Shape memory effect is well understood in metals and polymers, and this dynamic transformation feature has shown great potential in biomedicine20, gas absorption21, robotics22, spacecraft devices23, and sensing24. However, the shape memory effect in COFs has not yet been realized.

Here, by employing the interaction between 2D COFs and adsorbed exotic molecules in its 1D nano-confined channels, we realized the shape memory effect in TAPT-TFPA COFs, which can transform between AA stacking phase and an inclined phase with an incline angle of 71° (Fig. 1). It is worth mentioning that these two phases are still maintained after removing the foreign adsorbed molecules. This transition is different from the breathing effect COF. Both experimental results and molecular dynamics (MD) simulations revealed that the vdW interaction between THF molecules and AA stacking 2D COF is weaker than that between THF molecules and inclined stacking 2D COF, leading the 2D COF to change from AA stacking phase to an inclined phase. On the contrary, adsorption of water will convert the inclined stacking back to AA stacking. As the concentration of water molecules increases, ordered ice crystal gradually form in the 1D nano-confined channels. The formation of this room-temperature hot ice promotes the channel diameter, which directly drives the transformation from inclined stacking to AA stacking. Based on the shape memory effect of the 2D TAPT-TFPA COF, we further revealed its dynamically tunable permeability and intelligent response.

Fig. 1: Shape memory.
Fig. 1: Shape memory.
Full size image

Schematic diagram of shape memory 2D COF triggered by formation of hot ice in the nano-confined channels of 2D COF and the adsorption repulsion effect of THF.

Results and discussion

Conversion process monitoring

The TAPT-TFPA COF was synthesized by following the procedures reported in our previous study25. By filling (and then drying) the COF powders with water and THF, AA and inclined stacking phases of the TAPT-TFPA COF were successfully obtained, respectively. These two stacking phases were confirmed by powder X-ray diffraction (PXRD) pattern and Pawley refinement (Fig. 2 and Supplementary Figs. 1, 2). Ar adsorption-desorption experiments and positron lifetime spectrum were carried out to further confirm the existence of the two stacking phases (Supplementary Fig. 3). The shape memory behavior of the TAPT-TFPA COF was further monitored by vapor adsorption tests of water and THF, as well as in situ PXRD (Fig. 2 and Supplementary Fig. 4). AA and inclined COFs show sharply different adsorption behaviors for H2O vapor. As shown in Fig. 2b, the adsorption capacity of AA stacking COF for H2O vapor is much larger than that of inclined COF. More importantly, it can be seen that the two H2O vapor adsorption-desorption circles for inclined (and/or AA stacking) COF are similar to each other, suggesting that H2O vapor cannot induce the transformation of TAPT-TFPA COF from inclined phase to AA stacking phase. This phenomenon was further confirmed by in situ PXRD (Fig. 2c), suggesting the high phase stability of TAPT-TFPA COF in moisture atmosphere. In contrast to H2O, THF (either liquid or vapor) was found to be capable of converting the AA stacking COF to the inclined phase. As evidenced in Fig. 2e, the two THF vapor adsorption-desorption cycles of AA stacking TAPT-TFPA are substantially different. The large difference in the THF monolayer adsorption process between the first and second adsorption-desorption cycles directly proves the shape memory effect of COFs17,26,27. This shape memory effect was also confirmed by in situ PXRD during vacuum-THF vapor-vacuum cycle process (Fig. 2f).

Fig. 2: Conversion process monitoring of TAPT-TFPA COF.
Fig. 2: Conversion process monitoring of TAPT-TFPA COF.
Full size image

a PXRD pattern of TAPT-TFPA Inclined under conditions of H2O wetted and dried. b Water vapor adsorption cycle of TAPT-TFPA AA and TAPT-TFPA Inclined at 298 K. c PXRD pattern of TAPT-TFPA Inclined under conditions of water vapor and vacuum. d PXRD pattern of TAPT-TFPA AA under the condition of THF wetted and dried. e THF vapor adsorption cycle of TAPT-TFPA AA at 298 K. f PXRD pattern of TAPT-TFPA AA under conditions of THF vapor and vacuum.

Theoretical simulations

To reveal the underlying mechanisms on the shape memory behavior of TAPT-TFPA COF, MD simulations under the isothermal-isobaric ensemble (300 K and 1 atm) were performed (Please see SI for simulation details). Figure 3a shows the enthalpy of pure COF as a function of its incline angle (the angle between c and a (or b) axes of the crystal lattice). The pure COF is the most thermodynamically stable when it is in the slipped-AA stacking phase (incline angle ~ 85°) rather than the strict AA stacking phase (incline angle = 90°). This result is reasonable because the strict AA stacking is not favorable for the van der Waals (vdW) interaction between conjugated carbon atomic layers. Decreasing the incline angle from 85° to 70° will significantly decrease the contacting area between neighboring COF layers and weaken their vdW interaction, making inclined phases of COF metastable.

Fig. 3: MD simulations on the stability of 2D COF under different conditions.
Fig. 3: MD simulations on the stability of 2D COF under different conditions.
Full size image

a The enthalpy of pure COF as a function of the incline angle in the 2 × 2 unit cell (5 COF layers), which is defined as the angle between [001] direction and/or [100]/[010] direction (inset). b The enthalpy of COF with different numbers of adsorbed THF molecules under different incline angles. c The average interaction energies between THF molecules and COF in (b). d The enthalpy of COF with different concentrations of adsorbed H2O molecules under different incline angles. e Snapshots of MD simulations of COF + H2O systems corresponding to those denoted in (d). f The average hydrogen bond strength in the COF + H2O systems in (d). g Synchrotron radiation XRD pattern of ice, TAPT-TFPA AA, TAPT-TFPA AA H2O wetted, TAPT-TFPA Inclined, TAPT-TFPA Inclined H2O wetted. h Average positron annihilation lifetime of water-wetted TAPT-TFPA COF as a function of temperature. i Stacking phase diagram of COFs. inset: AA stacking and inclined stacking phases.

Adsorbing THF molecules in the nano-confined channels enhances the stability of inclined COF. Figure 3b shows the enthalpy of COF adsorbed with different number of THF molecules under different incline angles. To compare their relative stability, their enthalpy is defined as:

$$H(n)={H}_{o}(n)+\Delta n\times {h}_{{THF}}$$
(1)

where \({H}_{o}(n)\) is the enthalpy of the COF with n adsorbed THF molecules, \(\Delta n={n}_{\max }-n\) and \({n}_{\max }=112\) is the maximum number of adsorbed THF molecules, and \({h}_{{THF}}\) is the enthalpy of a THF molecule in its liquid phase, respectively. It can be seen that the enthalpy of a COF + THF system decreases with n, suggesting the attractive interaction between COF and THF molecules. Moreover, the COF + THF system with an incline angle of 70° is more stable or shows a local minimum enthalpy with the change of incline angle. Further analysis reveals that such a stability inversion is induced by the relatively strong vdW interaction between COF and THF molecules at an incline angle of 70°, as shown in Fig. 3c. The THF vapor adsorption experimental results of TAPT-TFPA COF showed that its isosteric heat of adsorption (Qst) was ~ 9.56 kcal/mol, indicating that there was a strong interaction between them and the result is consistent with our theoretical calculations (Fig. 3c and Supplementary Fig. 5). Our simulations are well consistent with experiments showing that THF induces the inclination of COF to ~71°. The metastable inclined COF structures can be kept after the desorption of THF, probably due to high activation energy barriers for the transition between inclined and AA stacking phases at room temperature.

Different from THF, H2O leads inclined COF to transform back to AA stacking. Figure 3d shows the enthalpy of COF with different H2O adsorption concentrations under different incline angles, as calculated by the equation in the same formalism as Eq. (1). It can be seen that under a low adsorption quantity (\({n}_{{{{{\rm{H}}}}}_{2}{{{\rm{O}}}}}=628\)), the COF + H2O system is the most stable at an incline angle of 70°. When \({n}_{{{{{\rm{H}}}}}_{2}{{{\rm{O}}}}}\) is increased to ~780, the COF + H2O system becomes most stable at an incline angle of 80°. Further increasing \({n}_{{{{{\rm{H}}}}}_{2}{{{\rm{O}}}}}\) makes the AA stacking phase to be the most stable. Such a stability inversion is induced by the solidification of H2O in COF with incline angles ≥80°. Figure 3e shows MD snapshots of the most stable COF + H2O systems under different H2O adsorption quantity. H2O in the most stable COF-H2O system at an incline angle of 70° is in liquid or amorphous state, while at an incline angle of 80° or 85° it forms an ordered crystalline phase, which is further verified by the average radial distribution functions between oxygen atoms \({g}_{o-o\,}(r)\) (Supplementary Fig. 7). To elucidate the driving force for the transition from inclined phase to AA stacking phase, the average hydrogen bond strength profiles were calculated (Fig. 3f), which show the same tendency as those in Fig. 3d. With the increase of \({\rho }_{{{{{\rm{H}}}}}_{2}{{{\rm{O}}}}}\), H2O molecules tend to crystallize due to the stronger hydrogen bond interaction, which promotes the COF channel size and thus convert the inclined COF to AA stacking. The synchrotron radiation XRD patterns of ice, TAPT-TFPA AA, and TAPT-TFPA AA H2O wetted also confirmed the diffraction peaks of thermal ice (Fig. 3g and Supplementary Figs. 8, 9). In addition, the positron lifetime spectrum provides direct evidence for the formation of hot ice (Fig. 3h). As the temperature increases, the positron lifetime of the water-wet TAPT-TFPA COF first decreases slightly and then increases. The slight decrease in the positron lifetime is due to the formation of disordered H2O caused by the melting of hot ice. As the temperature continues to increase, water is evaporated and the positron lifetime exhibits properties of the COF itself (Supplementary Fig. 3)28. Due to the small amount of thermal ice, the intensity of the diffraction peaks and the relative changes of the positron annihilation lifetime are not strong. This may be the reason why ordinary PXRD (Cu/Kα radiation) cannot obtain hot ice diffraction (Supplementary Fig. 2a, b). Our simulations are well consistent with the experimental observation that the conversion can only be triggered by liquid H2O rather than H2O vapor. It is worth mentioning that formation of hot ice confined in carbon nanotubes has been reported both experimentally and theoretically, and hot ice in COF confined channels adds a new case to such confined systems.

It is interesting to note that we have also performed 2,4,6-triphenyl-s-triazine (TPT) filling experiments to confirm the stacking phase transition of TAPT-TFPA COF (Supplementary Fig. 10). TAPT-TFPA TPT filled with TPT molecules showed AA stacking, which further indicated that the supporting effect of the guest molecules promoted the transition to AA stacking. Since TAPT-TFPA TPT exhibited pore-blocked AA stacking, its Ar adsorption, pore size and specific surface area were intermediate between AA and Inclined stacking. Similar to our experiments on H2O filling and previous reports on the formation of ordered polypyrrole in 1D nano-confined channels of TPB-DMTP COF29, no PXRD diffraction peaks (Cu/Kα radiation) of ordered TPT structures in confined space were observed. Weak confined space TPT diffraction peaks can be observed at the synchrotron radiation source.

Based on the above calculations, a model for the COF stacking phase diagram under different chemical environments can be established. As shown in Fig. 3i inset, when changing from AA stacking phase to an inclined stacking (due to the in-plane translational symmetry of COF) phase, the interface area between COF and the adsorbates is increased. The energy change \(\Delta E\) for this phase transition can be estimated by (Please see SI for derivation details):

$$\Delta E=[{\gamma }_{{cof}}+{\gamma }_{{adb}}-{E}_{b}+{\Delta E}_{m}]\Delta S$$
(2)

where \({\gamma }_{{cof}}\) and \({\gamma }_{{adb}}\) are the surface energies of COF and adsorbates, respectively; \({E}_{b}\) is the binding energy between COF and adsorbates; \({\Delta E}_{m}=\alpha l{\Delta Q}_{m}\tan \left(\theta \right)\) with \({\Delta Q}_{m}\) representing the phase transition energy of adsorbates (if any), \(\alpha\) is the geometry factor of the COF channel and \(l\) is the channel perimeter; \(\Delta S\) is the change of interface area between COF and adsorbates. To testify this model, we calculated \({\gamma }_{{cof}}\), \({\gamma }_{{adb}}\), \({E}_{b}\) and \({\Delta E}_{m}\) for THF, Acetonitrile (ACN), Acetone (AC) and H2O (Please see SI for calculation details). As shown in Fig. 3i, \({E}_{b} < {\gamma }_{{cof}}+{\gamma }_{{adb}}+{\Delta E}_{m}\) for H2O and thus the AA stacking phase is preferred, while \({E}_{b} > {\gamma }_{{cof}}+{\gamma }_{{adb}}+{\Delta E}_{m}\) for THF, ACN and AC, which will lead COF to show an inclined phase. Experiments were further performed to verify the inclined stacking phase of COF in ACN and AC (Please see SI for details).

Dynamically tunable permeability

With the advancement of intelligent process of Industry 4.0, the development of more intelligent and refined materials has become a research hotspot30. Traditional shape memory materials store energy through mechanical shaping and low-temperature locking, and then change the environment to complete the shape change. This transformation method is unidirectional and cannot be continuously and reversibly converted, which makes it unfavorable for refined operation. A smarter way is to be able to reversibly and continuously change its temporary shape through the internal driving force caused by external stimulation31. Reversible shape memory COF can exhibit continuous and reversible conversion between AA and Inclined phases by external stimulation. The two phases have different pore sizes and pore environments, which are expected to exhibit dynamically tunable permeability17,23,27. The results of gas adsorption and breakthrough experiment of CH4, C2H6 and C3H8 show full gas permeability of AA phase and selective gas permeability of Inclined phase (Fig. 4a, b and Supplementary Figs. 1113). The isosteric heat of adsorption (Qst) of all gases is lower than 9.56 kcal/mol, indicating that there is no bonding interaction between the gas molecules and the COF framework (Supplementary Figs. 14, 15 and Supplementary Table 1)32. Compared with the AA phase, the ideal adsorbed solution theory (IAST) selectivity of the Inclined phase was significantly increased by 2 times (Supplementary Figs. 1618 and Supplementary Table 2). We demonstrate that the reversible shape memory COF can easily switch between two phases through simple external stimulation, thereby achieving easy and convenient permeability controllability.

Fig. 4: Dynamically tunable permeability.
Fig. 4: Dynamically tunable permeability.
Full size image

a Single-component adsorption isotherms of CH4, C2H6 and C3H8 for TAPT-TFPA AA and Inclined at 298 K; b Experimental breakthrough curves of CH4: C2H6: C3H8 (85: 10: 5, v/v) mixtures with a total inlet flow rate of 2.0 mL/min; c Single-component adsorption isotherms of C3H6 and C3H4 for TAPT-TFPA AA and Inclined at 298 K; d Experimental breakthrough curves of C3H4: C3H6 (1: 99, v/v) mixtures with a total inlet flow rate of 2.0 mL/min; Cyclic breakthrough curves of e CH4: C2H6: C3H8 mixtures (85: 10: 5, v/v) and f C3H4: C3H6 (1: 99, v/v) mixtures for TAPT-TFPA Inclined with a total inlet flow rate of 2.0 mL/min.

In order to better match the pores (~ 1.67 ~ 2.00 nm) of TAPT-TFPA COF, C3H6 and C3H4 are chosen as the research objects and their gas separation effects are analyzed. The single-component adsorption isotherms indicate that inclined COF exhibits higher adsorption capacity and more significant adsorption difference (Fig. 4c). The Qst also demonstrated the non-bonding interaction between gas molecules and the COF framework (Supplementary Figs. 19, 20 and Supplementary Table 3). Compared with other reported materials, the Qst of inclined COF is lower, suggesting that the material is easier to desorb for reuse under the same separation capacity33. Meanwhile, the varying Qst values of inclined COF infer the presence of multiple binding sites caused by the tortuous pore structure. Although inclined-stacked COFs do not exhibit excellent IAST selectivity similar to metal-containing organic materials, their actual separation effect has exceeded that of the porous organic materials reported so far (Supplementary Figs. 21, 22 and Supplementary Table 4). As shown in Fig. 4d, when the mixed gas (C3H4: C3H6 = 1: 99, v/v) passes through the AA stacking COF’s confined nano-channels, C3H6 flows out first (12 min/g) with a purity greater than 99.99%. A trace amount of C3H4 begins to flow out at 18 min/g, and a great quantity does not appear until 78 min/g. The escape of this adsorbed gas is detrimental to separation and purification. When the mixed gas passes through the inclined TAPT-TFPA, C3H6 and C3H4 begin to flow out in large quantities at 23 min/g and 118 min/g, respectively. When the gas ratio is C3H4: C3H6 = 0.1: 99.9, the retention times is further extended to 200 min/g (Supplementary Fig. 23). The relative retention time of up to 376 mL2/g/min has exceeded the porous organic materials reported so far (Supplementary Table 5).

Moreover, we found that inclined COF can be reused for at least 10 cycles and their good separation performance is still maintained (Fig. 4e, f). In order to verify its long-term performance, we conducted an uninterrupted shape memory transformation experiment for up to 2 months. The results show that TAPT-TFPA COF can still exhibit good structural properties and shape memory transformation performance (Supplementary Fig. 24). The dynamic tunability of shape memory 2D COF between omni-permeability and selective permeability is expected to develop into a new intelligent material. Therefore, the reversible shape memory characteristics of this material are not only essentially intelligent and can be applied to gas separation, but also to a wide range of intelligent applications. We show that the pore size and pore environment of the material can be easily adjusted by responding to external stimuli, and the differentiation of gas separation effects provides a rough guide for designing and expanding separation applications. The preparation of COF materials into thin films combined with their excellent photoelectrocatalytic properties may provide an opportunity to design a class of efficient and convenient catalytic separation materials. In addition, the multi-morphological changes of these materials take advantage of their two possibilities: the adjustable sensing ability of the sensor active layer or the adjustable dielectric properties of the dielectric layer; artificial membranes, for example, hydrophilic passage and hydrophobic obstruction.

We reported the realization of a shape memory 2D TAPT-TFPA COF system by adsorbing (and then desorbing) different molecules, which can reversibly transit between an interlayer inclined phase with an incline angle of ~ 70° and an AA stacking phase. It is found that the inclined stacking phase is induced by the relatively stronger vdW interaction between organic molecules (like THF) and the 2D COF than the interlayer interaction of the 2D COF and the surface energy of adsorbed molecules. Moreover, H2O is found to gradually form an ordered crystalline ice structure in the 1D nanochannels of the 2D COF with the increase of adsorption concentration. The formation of this room-temperature hot ice promotes the increase of void volume, which directly drives the conversion of inclined stacking phase to AA stacking phase. These two different stacking phases of the 2D COF are highly stable, and the corresponding shape memory effect is demonstrated to show a great potential in dynamically adjustable permeability. This study opens a way for the design and realization of 2D COFs for both fundamental research in tunable nano-confined spaces and applications in the context of nanotechnology. In addition, the shape memory property also provides a new opportunity for scalable applications of intelligent responses, such as adjustable gas separation and catalytic separation; adjustable sensing layers or dielectric layers, and adjustable artificial membranes.

Methods

Synthesis of the COFs

The synthesized COF crystal powder was isolated by solvothermal reaction in mixture solvent of dioxane and mesitylene for 72 h. The as-synthesized powder crystals were extracted to remove unreacted monomers and other impurities to obtain freshly synthesized COF powders by solvent of methanol and tetrahydrofuran (THF). The COF powders were wetted and dried with water and THF to obtain TAPT-TFPA AA and TAPT-TFPA Inclined, respectively.

X-ray powder diffraction

Powder X-ray diffraction (PXRD) patterns were recorded on PANalytical Empyrean diffractometer for Cu/Kα radiation (λ = 1.5416 nm). In situ PXRD under saturated steam was recorded on a SmartLab diffractometer with sealed chamber for Cu/Kα radiation (λ = 1.5416 nm). In situ diffraction signal collection was performed by vacuuming and vapor filling cycles. The samples were spread on the square recess of XRD sample holder as a thin layer.

Synchrotron radiation X-ray diffraction

Synchrotron radiation X-ray diffraction was recorded were conducted at BL17UM in Shanghai Synchrotron Facility (λ = 0.48337 nm). All samples were sealed with polyimide tape for rapid transmission synchrotron X-ray measurement (exposure time: 60 s, det distance: 800 mm; T = 25 °C), and the polyimide tape and air background were subtracted.

Sorption measurements

Ar sorption isotherms were measured at 87 K using Autosorb-IQ instrument after samples were degassed at 120 °C for 8 h under vacuum. Pore size distributions of samples were determined by DFT. Water vapor and THF vapor sorption isotherms were measured at 273 and 298 K using BELSORP-max II instrument. CH4, C2H6, C3H8, C3H6 and C3H4 sorption isotherms were measured at 273 and 298 K using BSD-PM instrument.

Positron lifetime spectra

The experiment was completed on the positron research platform of the Institute of High Energy Physics, Chinese Academy of Sciences, using 22Na radioactive source as the positron source, with a source intensity of about 13 microjumpers. Two identical samples are tightly clamped on both sides of the 22Na radioactive source, forming a typical sandwich geometry.

The conventional positron annihilation lifetime spectrometer uses a pair of BaF2 scintillator detectors to detect the gamma rays released after positron annihilation, and uses fast-slow coincidence measurement technology to measure the positron annihilation lifetime spectrum. The total number of lifetime spectra is 2 million to ensure statistics, and LT9.0 software is used as the spectrum analysis program. The time resolution of the spectrometer is about 210 ps, and the electronic plug-in of the measurement system is the standard NIM plug-in of the American EG&G Company.

Breakthrough experiments

The breakthrough separation experiments were conducted in a BSD-PM instrument under ambient conditions (298 K, 1 bar) using a gas mixture of CH4/C2H6/C3H8(85/10/5), CH4/C2H6 (50/50), CH4/C3H8(50/50) and C3H4/C3H6 (1/99 and 0.1/99.9, v/v). In a typical breakthrough experiment, 0.50 g active TAPT-TFPA AA samples and 0.38 g TAPT-TFPA Inclined were packed into a stainless-steel column (6 mm inner diameter, 500 mm length) and purged with He flow (20 mL/min) at 100 °C for 10 h. During tests, the gas mixture was stabilized at 2 mL/min by a mass flow controller at room temperature. Outlet gas from the column was monitored using gas chromatography (Nexis GC-2030, SHIMADZU) continuously. To evaluate the reusability of the adsorbent, the adsorbent was regenerated in situ by heating for 6 h at 100 °C to finish 10 breakthrough cycles.

Shape memory durability experiments

In order to verify the durability of TAPT-TFPA COF during the shape memory conversion process, we conducted a 2-month shape memory conversion experiment. First, TAPT-TFPA COF was immersed in THF solution at room temperature for 8 h and dried for 4 h to convert it to an Inclined structure. Then, TAPT-TFPA Inclined was immersed in deionized water at room temperature for 8 h, dried for 4 h, and then converted to an AA stacking structure. This repeated process lasted for 2 months and the number of cycles reached 60 times.

Molecular dynamics simulations

Molecular dynamics simulations were performed by using the Large-scale Atomic/Molecular Massively Parallel Simulator (LAMMPS, https://www.lammps.org/). A ReaxFF-lg force field was employed to describe the interaction between atoms, which has been widely used in organic systems with weak van der Waals interactions34,35. Except for the capability of describing reactions in organic/molecular systems, it can account for weak van der Waals interaction, hydrogen bond, Coulomb interaction and long-range London dispersion interaction. The TAPT-TFPA COF and THF molecules in our study are composed of C, H, O and N atoms. The interlayer interaction in TAPT-TFPA COF is van der Waals force. The interaction between TAPT-TFPA COF and THF includes van der Waals force and possible hydrogen bonds between H atoms in COF and O atoms in THF. Therefore, we have chosen the ReaxFF-lg force field in our study. The systems of COF with/without adsorbed molecules were constructed by a 2 × 2 unit cell containing 5 COF layers with periodic boundary conditions in all directions. The temperature of simulated systems was first increased from 1 K to 300 K within 100,000 MD steps, and then kept at the isothermal-isobaric ensemble (300 K and 1 atm) for 5 million MD steps controlled by the Nose-Hoover thermostat36,37. The equation of motion was integrated with a MD time step of 0.1 fs. The time-average energies of the systems were obtained only after the systems reached equilibrium. Supplementary Fig. 6 shows typical snapshots of pure COF, COF + THF and COF + H2O structures during MD simulations. The average O-O radial distribution functions corresponding to the systems in Fig. 4d are calculated and shown in Supplementary Fig. 6a. Supplementary Movie 1 shows the MD simulation process for the COF + THF122 system with an incline angle of 70°. Supplementary Movies 24 show the MD simulation processes for the , and systems in Fig. 3d, respectively.

To further verify our finding on the formation of hot ice confined in the nanochannel of the 2D COF, the four-point tip4p/ice model was also employed in our MD simulations38. The tip4p/ice model has been proved to be capable of precisely predicting the melting point of water in bulk39 and predicting structure evolution of water confined in nanospaces40. In our testing simulation, 917 H2O molecules were inserted in the nanochannels in the 2 × 2 unit cell of 2D COF with an incline angle of 90°, which corresponds to a \({\rho }_{{{{{\rm{H}}}}}_{2}{{{\rm{O}}}}}\) ~ 26 H2O molecules per nm3. The interaction between H2O molecules was described by this tip4p/ice model. The interaction between atoms of the 2D COF is still treated by the ReaxFF-lg force field. For the interaction between COF and H2O, the 12-6 Lennard-Jones potential and Coulomb potential were used, where ε and σ in the 12-6 Lennard-Jones potential between C (N) atoms in COF and H2O molecules were set to be 0.02 kcal/mol and 3.2 Å; ε and σ for H atoms in COF and O atoms in H2O molecules were set to be 0.16 kcal/mol and 2.0 Å; ε and σ for H atoms in COF and H atoms in H2O molecules were set to be 0.005 kcal/mol and 3.2 Å, respectively. Other settings were the same as those simulations using the ReaxFF-lg force field. As shown in Supplementary Movie 5 and Supplementary Fig. 6b, water also forms hot ice in the confined channels in the 2D COF, which strongly supports our conclusion. Input files for LAMMPS simulations are provided.