the boundaries depicted in Fig. \[fig:Poincare-surface-of-section\]. The waveguide segments were modeled as a “squircle” [@Squircle]. This curve has a polar-coordinate representation $$r_{\text{WG}}(\phi)=\sqrt{a^{2}\left|\cos\phi\right|+b^{2}\left|\sin\phi\right|}$$ but was also shifted horizontally in order to connect smoothly with the unshifted curve of Eq. (\[eq:ShapeCurve\]).

The waveguide portions of the boundary are shaded in the Poincar[é]{} section because they are irrelevant to the interior ray dynamics that makes the folded orbits possible. There are no stable islands associated with any periodic orbits other than the bouncing-ball trajectories (leftmost inset) whose perpendicular angle of incidence precludes long-lived stable modes from forming. There are no invariant curves in the whispering-gallery region near $\sin\chi\to1$.

Wave calculations {#sec:wavecalc}
=================

The wave patterns in Fig. \[fig:Q-factor-versusEps\] indicate that the mode is not supported by any one of the self-intersecting periodic orbits in Fig. \[fig:Two-self-intersecting-periodicOrbits\] alone, but by a more extended phase-space region in their vicinity. The main panel of Fig. \[fig:Q-factor-versusEps\] follows a single mode over a range of deformations $\epsilon$, revealing an optimal deformation of $\epsilon\approx0.44$ at which this particular mode reaches $Q\approx2500$.

To characterize the parameter-dependence of the Q factor further, we carry out numerical simulations of the wave equation using two different methods. The first approach is a 