Upon UV irradiation in the presence of beta-cyclodextrin, (E)-4,4'-bis
(dimethylammoniomethyl)stilbene is transformed to the (Z)-isomer, but
in the presence of gamma-cyclodextrin only the [2 + 2]-cycloaddition p
roducts are obtained; the products are a molecular imprint of the cavi
ty of the cyclodextrin.