1 Introduction

Capacities—such as analytic, logarithmic, and conformal—are fundamental tools in complex analysis and have several applications to problems in different fields, e.g., in approximation theory, potential theory, electronics, and fluid dynamics [5, 6, 8, 19, 31, 37]. These capacities can be expressed explicitly in only a handful of special cases, and therefore numerical methods are needed to compute these capacities in the majority of instances.

The Riemann mapping theorem states that any unbounded simply connected domain G in the extended complex plane \({\widehat{{{\mathbb {C}}}}}={{\mathbb {C}}}\cup \{\infty \}\) with \(\infty \in G\) and whose boundary consists of more than one point can be mapped one-to-one onto the unit disk \({{\mathbb {D}}}\) by a conformal map f. If we assume that

$$\begin{aligned} f(\infty )=0 \quad \textrm{and}\quad f'(\infty )>0, \end{aligned}$$
(1)

then this mapping f is unique and known as the Riemann mapping function. Here, the derivative of an analytic function f at the point at infinity is

$$\begin{aligned} f'(\infty )=\lim _{z\rightarrow \infty }z[f(z)-f(\infty )]. \end{aligned}$$
(2)

The so-called Ahlfors map can be regarded as an extension of the Riemann mapping function for multiply connected domains. That is, given an unbounded multiply connected domain G of connectivity m, the associated Ahlfors map is the unique analytic function f that maps G onto \({{\mathbb {D}}}\) such that [8, 31, 37]

$$\begin{aligned} f(\infty )=0,\quad f'(\infty )>0, \quad \text {and}\; f'(\infty )~\text {is maximal}. \end{aligned}$$
(3)

The Ahlfors map \(w=f(z)\) is then an m-to-one covering of G onto \({{\mathbb {D}}}\) which maps each boundary component of G one-to-one onto the unit circle.

Let us now introduce the notion of analytic capacity. Let E be a compact subset of the complex plane \({{\mathbb {C}}}\) and let \(G = {\widehat{{{\mathbb {C}}}}} \backslash E\) be its complement in the extended complex plane \({\widehat{{{\mathbb {C}}}}}={{\mathbb {C}}}\cup \{\infty \}\). The analytic capacity of E is defined to be [31, p. 15]

$$\begin{aligned} \gamma (E)=\sup |f'(\infty )| \end{aligned}$$

where the supremum is taken over all analytic functions \(f:G\rightarrow {{\mathbb {C}}}\) such that \(|f(z)|\le 1\) for all \(z\in G\), and \(f'(\infty )\) is as in (2). In this paper, we assume that G is an unbounded multiply connected domain of connectivity m with \(\infty \in G\).

It is well-known that analytic capacity is inextricably linked to the Ahlfors map [6, 8, 19, 31, 37]. If \(w=f(z)\) is the unique Ahlfors map from the unbounded multiply connected domain G in the z-plane onto the unit disk \({{\mathbb {D}}}\) in the w-plane satisfying the conditions (3), then the analytic capacity of the set E is given by [8, 31]

$$\begin{aligned} \gamma (E) = f'(\infty ). \end{aligned}$$
(4)

In particular, when E is compact and connected such that \(G = {\widehat{{{\mathbb {C}}}}} \backslash E\) is a simply connected domain, the Ahlfors map \(w=f(z)\) is a conformal map from G onto the unit disk \({{\mathbb {D}}}\) and hence the analytic capacity \(\gamma (E)\) is equal to the logarithmic capacity \({{\,\mathrm{\textrm{cap}}\,}}(E)\) of E. However, for a general compact set E, we have \(\gamma (E)\le {{\,\mathrm{\textrm{cap}}\,}}(E)\). See [37, p. 13] for details.

Closed-form expressions for analytic capacity are special and known only in a handful of cases, and it is informative to survey some of these briefly here. If E is a disk of radius r, then [31, p. 17]

$$\begin{aligned} \gamma (E)=r, \end{aligned}$$
(5)

and if E is a square with sides of length \(\ell \), then [16]

$$\begin{aligned} \gamma (E)=\frac{\ell \,\Gamma ^2(1/4)}{4\sqrt{\pi ^3}}, \end{aligned}$$
(6)

where \(\Gamma (\cdot )\) is the gamma function. For a complex line segment \(E=[a,b]\subset {{\mathbb {C}}}\), we have [31, p. 17]

$$\begin{aligned} \gamma (E)=\frac{1}{4}|b-a|. \end{aligned}$$
(7)

For any compact subset E of \({{\mathbb {R}}}\), we have [8, Ch. I, Thm. 6.2]

$$\begin{aligned} \gamma (E)=\frac{1}{4}|E|. \end{aligned}$$

In particular, for m non-overlapping real intervals \(E_j=[a_j,b_j]\) with \(a_1<b_1<\cdots<a_m<b_m\), if \(E=\bigcup _{j=1}^mE_j\), we have [37, p. 14]:

$$\begin{aligned} \gamma (E)=\frac{1}{4}|E|=\frac{1}{4}\sum _{j=1}^m|E_j|=\frac{1}{4}\sum _{j=1}^m(b_j-a_j). \end{aligned}$$
(8)

If \(E\subset F\subset {{\mathbb {C}}}\), then \(\gamma (E)\le \gamma (F)\). Furthermore, for all \(z,\lambda \in {{\mathbb {C}}}\), \(\gamma (z+\lambda E)= |\lambda | \gamma (E)\). For a compact and connected set \(E\subset {{\mathbb {C}}}\), we have

$$\begin{aligned} \mathrm {\frac{diam(E)}{4}}\le \gamma (E)\le {{\,\mathrm{\textrm{diam}}\,}}(E) \end{aligned}$$

where \({{\,\mathrm{\textrm{diam}}\,}}(E)\) denotes the diameter of E. For more details, see [31, p. 17].

When E and F are disjoint connected compact subsets of \({{\mathbb {C}}}\), Suita [29] proved that the subadditivity property

$$\begin{aligned} \gamma (E\cup F)\le \gamma (E)+\gamma (F) \end{aligned}$$
(9)

holds. For general compact sets, the proof of this property is still an open problem. However, Tolsa [30] proved the semi-additivity of analytic capacity: there exists a constant c such that for all compact sets \(E,F\subset {{\mathbb {C}}}\), the analytic capacity satisfies

$$\begin{aligned} \gamma (E\cup F)\le c\left( \gamma (E)+\gamma (F)\right) . \end{aligned}$$
(10)

Moreover, proving the conjectural subadditivity of analytic capacity for arbitrary compact sets \(E,F\subset {{\mathbb {C}}}\) is equivalent to proving it for all disjoint compact sets \(E,F\subset {{\mathbb {C}}}\) that are finite unions of disjoint closed disks, all with the same radius [17, 36]. Several numerical examples have been considered by Younsi and Ransford in [36] for purely circular compact sets. Numerical results for sets other than circular ones were also presented in [35, 36]. All of these examples provide convincing evidence to suggest that the conjectural subadditivity property for analytic capacity is true. It should also be pointed out that, from (8), in the case of multiple real slits, equality as opposed to inequality holds in (9). The subadditivity property will be of significant interest in the ensuing discussion and will be corroborated numerically in several cases.

Several numerical methods are available in the literature for computing the logarithmic and conformal capacities. One of these methods is based on the boundary integral equation (BIE) with the generalized Neumann kernel [16, 24]. For the numerical computation of analytic capacity, to the best of our knowledge, the only available numerical method is that given in [36]. The method is based on using quadratic minimization for the numerical computation of upper and lower bounds for the analytic capacity, which, in principle, converges to its exact value. This method has been used before to compute the logarithmic capacity [27]. In this paper, we present a fast and accurate BIE method for the numerical computation of the analytic capacity. Our presented method will be used to compute the analytic capacity for a wider class of compact sets, including those with smooth boundaries, piecewise smooth boundaries, and sets consisting of only slits. The method is based on using a BIE for the Szegő kernel (refer to [3, 7, 12, 13, 19] for the definition and basic properties of the Szegő kernel). The BIE has been used by Kerzman and Trummer [13] to compute the conformal mapping for simply connected domains. Bell [2] proved that the BIE can be used to compute the Ahlfors map of bounded multiply connected domains. In [4], the BIE has been implemented numerically to compute both the Riemann mapping function and the Ahlfors map for bounded simply and multiply connected domains, respectively. See also [3, 12, 25, 32].

Besides this introductory section, our paper is structured in the following way. In Sect. 2, we introduce a numerical method for computing the analytic capacity for compact sets bounded by smooth or piecewise smooth Jordan curves, and several numerical examples for such sets are presented in Sect. 3. In Sect. 4, we consider compact slit sets. We provide our concluding remarks in Sect. 5. Finally, in Appendix A, for a given multiply connected rectilinear slit domain, we review an iterative method from [23] for the construction of a preimage unbounded multiply connected domain bounded by smooth Jordan curves.

2 The Numerical Method

2.1 Analytic Capacity and the Szeg Kernel

Let E be a compact subset of the complex plane \({{\mathbb {C}}}\) and let \(G = {\widehat{{{\mathbb {C}}}}} \backslash E\) be its complement in the extended complex plane \({\widehat{{{\mathbb {C}}}}}\). We assume that G is an unbounded multiply connected domain bounded by m smooth, or piecewise smooth, Jordan curves \(\Gamma _1,\ldots ,\Gamma _m\). Domains bounded by slits will be considered in Sect. 4 below.

From (4), the analytic capacity \(\gamma (E)\) is calculated by computing the derivative \(f'(\infty )\) of the Ahlfors map f from the domain G onto the unit disk \({{\mathbb {D}}}\) with the normalization (1). A BIE method for computing the Ahlfors map for a bounded multiply connected domain is presented in [2, 4]; however, the domain G is unbounded, and therefore a preliminary step is required. We first conformally map the unbounded multiply connected domain G onto a bounded multiply connected domain D using the Möbius transformation

$$\begin{aligned} \zeta =M(z)=\frac{1}{z-\alpha }, \end{aligned}$$

where \(\alpha \) is a point in the interior of any of the curves \(\Gamma _j\). The point at infinity is mapped onto the origin, \(M(\infty )=0\in D\). Let \(w=F(\zeta )\) be the Ahlfors map from the bounded multiply connected domain D onto the unit disk \({{\mathbb {D}}}\) such that \(F(0)=0\), \(F'(0)>0\), and \(F'(0)\) is maximal. It follows immediately that

$$\begin{aligned} f(z)=F(M(z)), \quad z\in G, \end{aligned}$$

is the Ahlfors map from the unbounded domain G onto the unit disk \({{\mathbb {D}}}\) which satisfies the conditions (3). Note that

$$\begin{aligned} f(\infty )=F(M(\infty ))=F(0)=0 \end{aligned}$$

and

$$\begin{aligned} f'(\infty )=\lim _{z\rightarrow \infty }z[f(z)-f(\infty )]=\lim _{z\rightarrow \infty }zf(z)=\lim _{z\rightarrow \infty }zF(M(z)). \end{aligned}$$

Note also that \(\zeta =M(z)=1/(z-\alpha )\) if and only if \(z=M^{-1}(\zeta )=a+1/\zeta \) and hence \(z\rightarrow \infty \) if and only if \(\zeta \rightarrow 0\). Thus, since \(F(0)=0\),

$$\begin{aligned} f'(\infty ) =\lim _{\zeta \rightarrow 0}\left( a+\frac{1}{\zeta }\right) F(\zeta ) =F'(0)>0. \end{aligned}$$

It is straightforward to prove that \(f'(\infty )\) is maximal since \(F'(0)\) is maximal.

As D is a bounded multiply connected domain, the Ahlfors map \(w=F(\zeta )\) from D onto the unit disk \({{\mathbb {D}}}\) can be computed using the method presented by Bell [2] (see also [4]). However, computing the analytic capacity \(\gamma (E)\) requires only computing the derivative \(F'(0)\) since \(\gamma (E)=f'(\infty )=F'(0)\). In fact, it follows from [2] that

$$\begin{aligned} F'(0)=2\pi S(0,0) \end{aligned}$$

where \(S(\zeta ,0)\) is the Szegő kernel for the bounded multiply connected domain D with respect to the base point \(0\in D\). Our numerical method is based on computing S(0, 0) using the BIE related to the Szegő kernel in multiply connected domains [2]. Then

$$\begin{aligned} \gamma (E) = f'(\infty )=F'(0)= 2\pi S(0,0). \end{aligned}$$
(11)

2.2 Integral Equation for the Szeg Kernel

Assume that each boundary component \(\Gamma _j\) is parametrized by a \(2\pi \)-periodic function \(\zeta _j(t)\), \(t\in J_j=[0,2\pi ]\), \(j=1,\ldots ,m\). For domains with corners, the parametrization \(\zeta _j(t)\) is defined as described in [16]. We define the total parameter domain J as the disjoint union of the m intervals \(J_j=[0,2\pi ]\), \(j=1,\ldots ,m\). The whole boundary \(\Gamma \) is therefore parametrized by

(12)

See [16, 22, 23] for more details. Further, the boundary \(\partial D\) of the bounded multiply connected domain D is parametrized by

$$\begin{aligned} \eta (t)=\frac{1}{\zeta (t)-\alpha }, \quad t\in J. \end{aligned}$$
(13)

The Szegő kernel for the bounded multiply connected domain D with respect to the base point \(0\in D\) can be computed by solving the second-kind Fredholm integral equation [2, 4]

$$\begin{aligned} S(\eta (t),0)+\int _{J} A(\eta (t),\eta (s))S(\eta (s),0)|\eta '(s)|ds= \overline{\frac{1}{2\pi \textrm{i}}\frac{\eta '(t)}{|\eta '(t)|\eta (t)}} \end{aligned}$$
(14)

where

$$\begin{aligned} A(\eta (t),\eta (s))=\overline{\frac{1}{2\pi \textrm{i}}\frac{\eta '(t)}{|\eta '(t)|(\eta (t)-\eta (s))}} -\frac{1}{2\pi \textrm{i}}\frac{\eta '(s)}{|\eta '(s)|(\eta (s)-\eta (t))} \end{aligned}$$

The kernel \(A(\eta (t),\eta (s))\) is continuous with \(A(\eta (t),\eta (t))=0\). The integral equation in (14) is known as the Kerzman–Stein BIE [12, 13, 25, 32]. It was proved in [2] that this BIE can be used also for the computation of the Szegő kernel for bounded multiply connected domains. Multiplying both sides of (14) by \(\eta '(t)/\eta (t)\) and defining

$$\begin{aligned} \phi (t)=\frac{S(\eta (t),0)\eta '(t)}{\eta (t)}, \end{aligned}$$
(15)

the BIE (14) can be written as

$$\begin{aligned} \phi (t) +\int _{J} A(\eta (t),\eta (s))\frac{\eta '(t)}{\eta (t)}\frac{\eta (s)}{\eta '(s)} \phi (s)|\eta '(s)|ds= \frac{\textrm{i}}{2\pi }\frac{|\eta '(t)|}{|\eta (t)|^2}. \end{aligned}$$
(16)

Now, since

$$\begin{aligned} \eta (t)=\frac{1}{\zeta (t)-\alpha }, \quad \zeta (t)=\frac{1}{\eta (t)}+\alpha , \end{aligned}$$

it follows that

$$\begin{aligned}&\phi (t) +\int _{J} A\left( \frac{1}{\zeta (t)-\alpha },\frac{1}{\zeta (s)-\alpha }\right) \frac{\zeta (s) -\alpha }{\zeta (t)-\alpha }\frac{\zeta '(t)}{\zeta '(s)} \frac{|\zeta '(s)|}{|\zeta (s)-\alpha |^2}\phi (s)ds\\ {}&\qquad = \frac{\textrm{i}}{2\pi }|\zeta '(t)|, \end{aligned}$$

or equivalently,

$$\begin{aligned}&\phi (t)-\int _{J} \left( \overline{\frac{1}{2\pi \textrm{i}}\frac{\zeta '(s)}{|\zeta '(s)|(\zeta (s)-\zeta (t))}} -\frac{1}{2\pi \textrm{i}}\frac{\zeta '(t)}{|\zeta '(t)|(\zeta (t)-\zeta (s))}\right) |\zeta '(t)|\phi (s)ds\\ {}&\qquad =\frac{\textrm{i}}{2\pi }|\zeta '(t)|. \end{aligned}$$

Taking the conjugate of both sides and then multiplying by \(\textrm{i}/|\zeta '(t)|\), we obtain

$$\begin{aligned}&\frac{\textrm{i}\,\overline{\phi (t)}}{|\zeta '(t)|} +\int _{J} \left( \overline{\frac{1}{2\pi \textrm{i}}\frac{\zeta '(t)}{|\zeta '(t)|(\zeta (t)-\zeta (s))}} -\frac{1}{2\pi \textrm{i}}\frac{\zeta '(s)}{|\zeta '(s)|(\zeta (s)-\zeta (t))}\right) \frac{\textrm{i}\,\overline{\phi (s)}}{|\zeta '(s)|}|\zeta '(s)|ds\\ {}&=\frac{1}{2\pi } \end{aligned}$$

which can be written in the concise form

$$\begin{aligned} \psi (t)+\int _{J} A(\zeta (t),\zeta (s))\psi (s)|\zeta '(s)|ds=\frac{1}{2\pi }, \qquad \psi (t)=\frac{\textrm{i}\,\overline{\phi (t)}}{|\zeta '(t)|}. \end{aligned}$$
(17)

This BIE (17) is a modification of the Kerzman–Stein BIE (14).

By (11), computing the analytic capacity \(\gamma (E)\) requires computing the value of the Szegő kernel S(0, 0). Since the Szegő kernel \(S(\zeta ,0)\) is an analytic function in the domain D, by the Cauchy integral formula, we have

$$\begin{aligned} S(0,0)=\frac{1}{2\pi \textrm{i}}\int _{\partial D} \frac{S(\zeta ,0)}{\zeta }d\zeta =\frac{1}{2\pi \textrm{i}}\int _{J} \frac{S(\eta (t),0)}{\eta (t)}\eta '(t)dt. \end{aligned}$$

Then, by solving the BIE (17) for \(\psi (t)\) and using (15) and (17), we have

$$\begin{aligned} S(0,0) = \frac{1}{2\pi \textrm{i}}\int _{J} \phi (t)dt = \frac{1}{2\pi }\int _{J} \overline{\psi (t)}|\zeta '(t)|dt. \end{aligned}$$

It then follows at once from (11) that

$$\begin{aligned} \gamma (E) = 2\pi S(0,0) = \int _{J} \overline{\psi (t)}|\zeta '(t)|dt. \end{aligned}$$
(18)

It is immediate from (18) that the integral \(\int _{J} \overline{\psi (t)}|\zeta '(t)|dt\) must be real and hence

$$\begin{aligned} \gamma (E) = {{\,\mathrm{\textrm{Re}}\,}}\left[ \int _{J} \overline{\psi (t)}|\zeta '(t)|dt\right] = \int _{J} {{\,\mathrm{\textrm{Re}}\,}}[\psi (t)]|\zeta '(t)|dt. \end{aligned}$$
(19)

2.3 Numerical Solution of the Integral Equation

The Kerzman-Stein BIE (14) has been used to compute conformal mappings for bounded and unbounded simply connected domains [13, 20, 25, 32], and in [2, 4] to compute the Ahlfors map for bounded multiply connected domains. A combination of the usage of the Kerzman–Stein BIE (14) and the Fast Multipole Method (FMM) [9, 10] has been presented in [25] for computing conformal mappings for bounded simply connected domains.

In this paper, to compute the analytic capacity \(\gamma (E)\), we will solve the BIE (17) which is a modified version of the Kerzman–Stein BIE (14). To accomplish this, we too shall employ the FMM when solving (17). Since the integrand in (17) is \(2\pi \)-periodic, the BIE (17) can be best discretized by the Nyström method with the trapezoidal rule [13, 20, 25, 32].

For domains with smooth boundaries, we use the trapezoidal rule with equidistant nodes. We discretize each interval \(J_p=[0,2\pi ]\), for \(p=1,2,\ldots ,m\), by n equidistant nodes \(s_1, \ldots , s_n\) where

$$\begin{aligned} s_q = (q-1) \frac{2 \pi }{n}, \quad q = 1, \ldots , n, \end{aligned}$$
(20)

and n is an even integer. Writing \(\textbf{s}=[s_1,\ldots , s_n]\), we discretize the parameter domain J by the vector \(\textbf{t}= [\textbf{s}, \textbf{s}, \ldots , \textbf{s}]\) which consists of m copies of \(\textbf{s}\), i.e.,

$$\begin{aligned} \textbf{t}=[t_1,t_2,\ldots ,t_{mn}] \end{aligned}$$

where for \(p=1,2,\ldots ,m\) and \(q = 1, \ldots , n\),

$$\begin{aligned} t_{(p-1)n+q}=s_q. \end{aligned}$$

For a real or a complex function \(\mu (\zeta (t))\) defined on the boundary \(\Gamma \), the trapezoidal rule then yields

$$\begin{aligned} \int _J\mu (\zeta (t))dt = \sum _{p=1}^{m}\int _{J_p}\mu (\zeta _p(t))dt \approx \sum _{p=1}^{m}\sum _{q=1}^{n}\frac{2\pi }{n}\mu (\zeta _p(s_q)) =\sum _{j=1}^{mn}\frac{2\pi }{n}\mu (\zeta (t_j)).\nonumber \\ \end{aligned}$$
(21)

Discretizing the BIE (17) using the trapezoidal rule (21) and substituting \(t=t_i\), we obtain the linear system

$$\begin{aligned} \psi _n(t_i)+\frac{2\pi }{n}\sum _{j=1}^{mn} A(\zeta (t_i),\zeta (t_j))|\zeta '(t_j)|\psi _n(t_j)=\frac{1}{2\pi }, \quad i=1,2,\ldots ,mn, \end{aligned}$$

where \(\psi _n\) is an approximation of \(\psi \). Recall that \(A(\zeta (t_i),\zeta (t_j))=0\) when \(i=j\). Using the definition of the kernel \(A(\zeta (t),\zeta (s))\), we have for \(i=1,2,\ldots ,n\),

$$\begin{aligned} \psi _n(t_i)+\frac{\textrm{i}}{n}\sum _{{\begin{array}{c} j=1\\ j\ne i\end{array}}}^{mn} \left( \frac{\overline{\zeta '(t_i)}}{|\zeta '(t_i)|(\overline{\zeta (t_i)}-\overline{\zeta (t_j)})} +\frac{\zeta '(t_j)}{|\zeta '(t_j)|(\zeta (t_j)-\zeta (t_i))}\right) |\zeta '(t_j)|\psi _n(t_j)=\frac{1}{2\pi }, \end{aligned}$$

or equivalently,

$$\begin{aligned} \psi _n(t_i)&+\frac{\textrm{i}}{n} \frac{\overline{\zeta '(t_i)}}{|\zeta '(t_i)|}\overline{\sum _{{\begin{array}{c} j=1\\ j\ne i\end{array}}}^{mn} \frac{1}{\zeta (t_i)-\zeta (t_j)} |\zeta '(t_j)|\overline{\psi _n(t_j)}}\\&- \frac{\textrm{i}}{n}\sum _{{\begin{array}{c} j=1\\ j\ne i\end{array}}}^{mn} \frac{1}{\zeta (t_i)-\zeta (t_j)}\zeta '(t_j)\psi _n(t_j)=\frac{1}{2\pi }, \end{aligned}$$

which can be written in the following concise form:

$$\begin{aligned} \textbf{x}+\frac{\textrm{i}}{n} (\overline{\zeta '(\textbf{t})}./|\zeta '(\textbf{t})|).*\overline{B\left( |\zeta '(\textbf{t})|.*\overline{\textbf{x}}\right) } - \frac{\textrm{i}}{n}B\left( \zeta '(\textbf{t}).*\textbf{x}\right) =\textbf{r}. \end{aligned}$$
(22)

Here, \(.*\) and ./ are the MATLAB element-by-element multiplication and division, respectively, \(\textbf{x}=\psi _n(\textbf{t})\), \(\textbf{r}\) is the \(mn\times 1\) vector with entries \(\textbf{r}_{i}= \frac{1}{2\pi }\), and B is the \(mn\times mn\) matrix with entries

(23)

The linear system (22) will be solved using the GMRES iterative method [28] where the matrix-vector product can be computed using the FMM. The FMM allows us to use the method presented to compute the analytic capacity of compact sets consisting of a high number of components. If we define the left-hand side of (22) to be a function of the unknown vector \(\textbf{x}\),

$$\begin{aligned} \mathscr {F}(\textbf{x})=\textbf{x}+\frac{\textrm{i}}{n} (\overline{\zeta '(\textbf{t})}./|\zeta '(\textbf{t})|).*\overline{B\left( |\zeta '(\textbf{t})|.*\overline{\textbf{x}}\right) } - \frac{\textrm{i}}{n}B\left( \zeta '(\textbf{t}).*\textbf{x}\right) , \end{aligned}$$

then the value of the function \(\mathscr {F}(\textbf{x})\) can be computed quickly and accurately using the MATLAB function zfmm2dpart in the MATLAB toolbox FMMLIB2D developed by Greengard and Gimbutas [9]. This method for computing the solution \(\psi \) to the BIE (17) is summarized in the following MATLAB function where the tolerances for the FMM and the GMRES method are taken to be \(0.5\times 10^{-15}\) and \(10^{-14}\), respectively, and the GMRES method is run without restart:

figure a

The preceding method assumes that the boundaries of the domains of interest are smooth, i.e. without corners. In the case of domains with corners (excluding cusps), to obtain accurate results, a re-parametrization of the boundary of the domain is performed as described in [16]. Assume that the boundary component \(\Gamma _j\) has \(\ell \) corner points. We first parametrize each boundary component \(\Gamma _j\) by a \(2\pi \)-periodic function \({\hat{\zeta _j}}(t)\) for \(t\in J_j=[0,2\pi ]\). The function \(\zeta _j(t)\) is assumed to be smooth with \(\zeta '_j(t)\ne 0\) for all values of \(t\in J_j\) such that \(\zeta _j(t)\) is not a corner point. We assume that \(\zeta '_j(t)\) has only the first kind discontinuity at these corner points. At each corner point, the left tangent vector is taken to be the tangent vector at this point. As above, let J be the disjoint union of the m intervals \(J_j=[0,2\pi ]\), \(j=1,2,\ldots ,m\) and \({\hat{\zeta }}(t)\), \(t\in J\), be a parametrization of the whole boundary \(\Gamma \). Then, we parametrize the boundary \(\Gamma \) by \(\zeta (t)={\hat{\zeta }}(\delta (t))\), where the function \(\delta (t)\) is defined in [16, pp. 696–697]. The function \(\delta (t)\) is chosen such that the singularity in the first derivative of the solution of the BIE in the vicinity of the corner points is removed [15, 16]. With the new parametrization \(\zeta (t)\), the BIE (17) can be solved accurately using the above MATLAB function. However, for domains with corners, we usually need a larger number of points n (which should be a multiple of the number of corners on each boundary component) for discretizing the BIE compared to domains with smooth boundaries (see [15, 16, 22] for further details).

Once the solution \(\psi \) of the BIE (17) has been found, we can proceed to compute the analytic capacity \(\gamma (E)\) using the formula (19). This can be undertaken using the following MATLAB function:

figure b

Various numerical examples will be presented in the proceeding two sections. We will take, in turn, domains bounded by Jordan curves and domains bounded by slits.

3 Domains Bounded by Jordan Curves

In this section, we will use the method presented in the previous section to compute numerical approximations \({\tilde{\gamma }}(E)\) to the analytic capacity \(\gamma (E)\) of compact sets bounded by smooth and piecewise smooth boundaries.

Example 1

Consider the compact set \(E=E_1\cup E_2\) where \(E_{1,2}=\{z \in {{\mathbb {C}}}\,|\,|z\pm c|\le r\}\) and \(0<r<c\). Then [36]

$$\begin{aligned} \gamma (E)=\frac{r}{2\sqrt{q}}\left( 1-q\right) \theta _2^2(q), \quad q=\frac{p-\sqrt{p^2-1}}{p+\sqrt{p^2-1}}, \quad p=\frac{c}{r}, \end{aligned}$$

where

$$\begin{aligned} \theta _2(q)=2q^{1/4}\prod _{j=1}^{\infty }\left( 1-q^2\right) \left( 1+q^{2j}\right) ^2 \end{aligned}$$

is the second Jacobi theta function. The relative error in the computed approximate values \({\tilde{\gamma }}(E)\) obtained with \(n=2^9\) are given in Table 1 for several values of c and r. For \(c=2\) and \(r=1\), our obtained value is \({\tilde{\gamma }}(E)=1.875595019097120\) which is in the interval (1.875595019097112, 1.875595019097164) given in [36]. The exact value is

$$\begin{aligned} \gamma (E)=\sqrt{3}\,\theta _2^2\!\left( \left( 2- \sqrt{3}\right) ^2\right) \approx 1.8755950190971197. \end{aligned}$$
Table 1 The relative error in the approximate values of the analytic capacity \(\gamma (E)\) for Example 1

Example 2

Let E be the square with corners \(1,-\textrm{i},-1,\textrm{i}\). In this case, the domain \(G = {\widehat{{{\mathbb {C}}}}} \backslash E\) is an unbounded simply connected domain. Thus, by (6), the analytic capacity of E is

$$\begin{aligned} \gamma (E)={{\,\mathrm{\textrm{cap}}\,}}(E)=\frac{\Gamma ^2(1/4)}{2\sqrt{2\pi ^3}}\approx 0.834626841674073. \end{aligned}$$
(24)

In this example, the boundary components of the compact set E have corners. We use our numerical method with various values of n to approximate the analytic capacity \(\gamma (E)\) and the results are presented in Table 2. As can clearly be seen in Table 2, the relative error decreases as n increases.

Table 2 The approximate values \({\tilde{\gamma }}(E)\) to the analytic capacity \(\gamma (E)\) and their relative errors for Example 2, where \(\gamma (E)\) is given by (24)

Example 3

As a validation of our numerical method, let us also consider the four compact sets shown in Fig. 1. These sets were considered in [36, Figures 2, 3, 5 and 6]. We are not aware that the analytic capacities \(\gamma (E)\) of these sets are known analytically. The approximate values of \(\gamma (E)\) computed by our method are presented in Table 3.

Fig. 1
figure 1

The four compact sets considered in Example 3 and in Younsi and Ransford [36, Figures 2, 3, 5 and 6]

Table 3 The approximate values \({\tilde{\gamma }}(E)\) of the analytic capacity \(\gamma (E)\) for Example 3

It is important to point out that for the union of 4 ellipses, the elapsed time of 0.55 seconds suggests that our computations are more than 1000 times faster than the method used for the same problem in [35, 36]. However, around a decade has passed since the computations in [36] were performed. We also note that our method is much faster than the method presented in [35, 36] for non-circular compact sets compared with circular ones.

Example 4

Consider the square \([-2,2]\times [-2,2]\) and the four sub-squares with centers \(\pm 1 \pm \textrm{i}\). Let \(\varepsilon >0\) be a real parameter. We consider three cases (i)-(iii). In the case (i), consider moving the centers of the sub-squares via the parameter \(\epsilon \) to the points \((1+\varepsilon )(\pm 1 \pm \textrm{i})\) (see Fig. 2 (left)). In case (ii), let us fix the lower two sub-squares and consider moving the centers of the upper sub-squares to the points \((1+\varepsilon )(\pm 1 + \textrm{i})\) (see Fig. 2 (middle)). Finally, in case (iii), let us fix three of the sub-squares and move the center of the remaining sub-square to the point \((1+\varepsilon )(1+\textrm{i})\) by increasing the value of \(\epsilon \) (see Fig. 2 (right)). Let us label the union of the compact sets generated with \(\varepsilon \) in each case by \(E_\varepsilon \). For \(\varepsilon =0\), then \(E_0=[-2,2]\times [-2,2]\) is the original square.

Note that the length of each side of the original square is 4, and hence, by (6),

$$\begin{aligned} \gamma (E_0)=\frac{\Gamma ^2(1/4)}{\sqrt{\pi ^3}}. \end{aligned}$$

Further, let us label the sub-squares by \(F_1,\ldots ,F_4\), then the length of each of these sub-squares is 2, and hence, by (6),

$$\begin{aligned} \gamma (F_j)=\frac{\Gamma ^2(1/4)}{2\sqrt{\pi ^3}}=\frac{1}{2}\gamma (E_0), \quad j=1,\ldots ,4. \end{aligned}$$

In each of the three cases, we compute the analytic capacity \(\gamma (E_\varepsilon )\) as a function of \(\varepsilon \) which are presented in Fig. 3. The results indicate that \(\gamma (E_0)\) is a lower bound for \(\gamma (E_\varepsilon )\) and \(\sum _{j=1}^4\gamma (F_j)=2\gamma (E_0)\) is an upper bound for \(\gamma (E_\varepsilon )\). These results collectively provide numerical evidence to corroborate the conjectural subadditivity property of analytic capacity for these compact sets. Our results demonstrate the expected phenomenon that the analytic capacity increases as the sub-squares move further apart from each other, and values of the analytic capacity in the case (i) are larger than those in the cases (ii) and (iii) corresponding to the greater number of sub-squares.

Fig. 2
figure 2

The three kinds of compact sets considered in Example 4

Fig. 3
figure 3

Graphs of the approximate values \({\tilde{\gamma }}(E_\varepsilon )\) of the analytic capacity as a function of \(\varepsilon \) in each of the three cases in Example 4. The dashed line denotes the upper bound \(2\gamma (E_0)\) and the dotted line denotes the lower bound \(\gamma (E_0)\)

Example 5

Consider the four disks with radius 1 and centers at \(\pm 1\pm \textrm{i}\). Let \(\varepsilon >0\) be a real parameter. We consider three cases (i)-(iii). In case (i), consider moving the centers of the four disks via the parameter \(\epsilon \) to the points \((1+\varepsilon )(\pm 1 \pm \textrm{i})\) (see Fig. 4 (left)). In case (ii), let us fix the lower two disks and consider moving the centers of the upper disks to the points \((1+\varepsilon )(\pm 1 + \textrm{i})\) (see Fig. 4 (middle)). Finally, in case (iii), let us fix three of the disks and move the center of the remaining disk to the point \((1+\varepsilon )(1+\textrm{i})\) by increasing the value of \(\epsilon \) (see Fig. 4 (right)). We label the union of the compact sets generated with \(\varepsilon \) in each case by \(E_\varepsilon \).

Let us label the disks by \(F_1,\ldots ,F_4\), then \(\gamma (F_j)=1\), \(j=1,\ldots ,4\). In each of the three cases, we compute the analytic capacity \(\gamma (E_\varepsilon )\) as a function of \(\varepsilon \) which are presented in Fig. 5. The results demonstrate the expected phenomenon that the analytic capacity increases as the disks move further apart from each other, and values of the analytic capacity in case (i), corresponding to the case when all disks are moving away from each other, are larger than those in cases (ii) and (iii).

Remark 1

If E is a compact set such that \(G = {\widehat{{{\mathbb {C}}}}} \backslash E\) is bounded by finitely many analytic curves, then [35, 36]

$$\begin{aligned} \gamma (E)=\min \left\{ \frac{1}{2\pi }\int _{\partial G}|1+g(z)|^2|dz|\right\} \end{aligned}$$

where the minimum is taken over all functions g(z) that are analytic on G, continuous up to the boundary, with \(g(\infty )=0\). Thus, taking \(g(z)\equiv 0\) gives the inequality

$$\begin{aligned} \gamma (E)\le \frac{1}{2\pi }\int _{\partial G}|dz|. \end{aligned}$$

Hence, if E is a union of finitely many disjoint closed disks \(E_1,\ldots ,E_m\) with radii \(r_1,\ldots ,r_m\), we have

$$\begin{aligned} \gamma (E)\le r_1+\cdots +r_m=\gamma (E_1)+\cdots +\gamma (E_m). \end{aligned}$$

This explains the results presented in Fig. 5 indicating that \(\sum _{j=1}^4\gamma (F_j)=4\) is an upper bound for \(\gamma (E_\varepsilon )\).

Fig. 4
figure 4

The three kinds of compact sets considered in Example 4

Fig. 5
figure 5

Graphs of the approximate values \({\tilde{\gamma }}(E_\varepsilon )\) of the analytic capacity as a function of \(\varepsilon \) in each of the three cases in Example 5. The dotted line denotes the upper bound \(\sum _{j=1}^4\gamma (F_j)=4\)

Example 6

We consider \(m=100\) random non-overlapping disks. For \(k=1,2,\ldots ,100\), the radius \(r_k\) of the disk \(E_k\) is chosen randomly in (0.2, 0.8) and its center \(c_k\) is chosen in the square \([-10,10]\times [-10,10]\) such that all disks are non-overlapping. Then we randomly choose an integer \(\ell \in [1,99]\). We define

$$\begin{aligned} E=\bigcup _{k=1}^{\ell }E_k,\quad F=\bigcup _{k=\ell +1}^{m}E_k. \end{aligned}$$

See Fig. 6 (right) for an example of such compact sets E and F.

For this problem, we run our method 50 times to obtain 50 different locations for these disks as well as different sets E and F. For each run j, we use the above presented method with \(n=2^9\) to compute approximate values of the quantities \(\gamma (E)\), \(\gamma (F)\) and \(\gamma (E\cup F)\). The values of the ratio

$$\begin{aligned} \frac{\gamma (E\cup F)}{\gamma (E)+\gamma (F)} \end{aligned}$$
(25)

are plotted as a function of the run number j as shown in Fig. 6 (left). As can be seen from the graphs in this figure, we have verified that the conjectural subadditivity property of analytic capacity holds for each of the 50 random compact sets we considered, and in particular that

$$\begin{aligned} \gamma (E\cup F)\le \gamma (E)+\gamma (F). \end{aligned}$$

Again, the conjectural subadditivity property for analytic capacity holds for the compact sets in this example.

Fig. 6
figure 6

The ratio in (25) as functions of the run number j for random radii in (0.2, 0.8) (left), and an example of the compact set \(E \cup F\) with 100 random disks, where the elements of E are shown in blue and the elements of F are shown in red (right)

Example 7

In this example, we study compact sets consisting of disjoint disks of equal radii. In particular, we will validate numerically the conjectural subadditivity property of analytic capacity in several cases. The consideration of such compact sets is important since proving the conjectural subadditivity property of analytic capacity for arbitrary compact sets \(E,F\in {{\mathbb {C}}}\) is equivalent to proving it for all disjoint compact sets that are finite unions of disjoint closed disks, all with the same radius [17, 36].

Let \(E_m\) be a union of m disjoint disks and F be a disk with center \(x+\textrm{i}y\) such that these \(m+1\) disks are non-overlapping and of unit radii. Let the real function u(xy) be defined by

$$\begin{aligned} u(x,y) = \gamma (E_m\cup F), \end{aligned}$$

i.e. the function u(xy) is defined for all points \((x,y)\in {{\mathbb {R}}}^2\) such that the disk F does not overlap any of the other m disks. Note that the domain of definition of the function u(xy) is unbounded. Hence, in our numerical computations, we consider only the region \(-10\le x,y\le 10\) and we assume that the minimum distance between any two disks is 0.02. We compute approximate values of the function u(xy) using \(n=2^{10}\) and then plot several level curves of u(xy). We consider four cases of m, namely \(m=1,2,3,4\). For \(m=1\), \(E_m\) consists of only one disk which is assumed to be the unit disk. For \(m=2,3,4\), we assume that the centers of the disks forming \(E_m\) are \(5e^{2k\pi \textrm{i}/m}\), \(k=1,2,\ldots ,m\). The approximate values \({\tilde{\gamma }}(E_m)\) of the analytic capacity of \(E_m\) are presented in the following table.

m

\({\tilde{\gamma }}(E_m)\)

1

1

2

1.98000206142844

3

2.88420404308815

4

3.67012955644439

The computed level curves of the function u(xy) are presented in Fig. 7. The results presented demonstrate that the values of the analytic capacity \(\gamma (E_m\cup F)\) increase when F moves away from \(E_m\) and decrease when F moves towards \(E_m\). In particular, when F is far away from \(E_m\), we have

$$\begin{aligned} \gamma (E_m\cup F) \approx \gamma (E_m)+\gamma (F). \end{aligned}$$
(26)

The results presented also illustrate that

$$\begin{aligned} \gamma (E_m) \le \gamma (E_m\cup F) \le \gamma (E_m)+\gamma (F)=\gamma (E_m)+1, \end{aligned}$$

which indicates that the conjectural subadditivity property for analytic capacity again holds in this example.

Finally, we compute approximate values \({\tilde{\gamma }}(E_m)\) of the analytic capacity for the above compact sets \(E_m\), this time assuming that the centers of the disks are \(re^{2k\pi \textrm{i}/m}\), \(k=1,2,\ldots ,m\), for \(1.5\le r\le 20\). The ratios \({\tilde{\gamma }}(E_m)/m\) are plotted in Fig. 8 as functions of r. As we can see, each of these ratios tends to 1 as r increases; that is, the analytic capacity of \(E_m\) (the union of m disks) tends to the sum of the individual analytic capacities of these m disks which is equal to m (see Remark 1 above). The results presented in (26) and Figs. 7 and 8 provide experimental evidence for a previously known result due to Pommerenke who showed that, roughly speaking, the analytic capacity of a compact set is approximately equal to the sum of the analytic capacities of its components if they are far away from each other (see [14, p. 267]).

Fig. 7
figure 7

The level curves of the function \(u(x,y)=\gamma (E_m\cup F)\) in Example 7 when \(m=1,2,4,5\), and the disks forming \(E_m\) are colored blue

Fig. 8
figure 8

The ratios \({\tilde{\gamma }}(E_m)/m\) as functions of the distance r measured from the origin to the centers of the m disks

4 Domains Bounded by Slits

In this section, we will use our numerical method to compute numerical approximations \({\tilde{\gamma }}(E)\) to the analytic capacity \(\gamma (E)\) of sets consisting of slits. We will consider here only rectilinear slits. However, the method presented can be extended to other types of slits.

For \(a_1,\ldots ,a_m,b_1,\ldots ,b_m\in {{\mathbb {C}}}\) such that \(E_j=[a_j,b_j]\) are non-overlapping for \(j=1,2,\ldots ,m\), let \(E=\bigcup _{j=1}^mE_j\) and let \(\Omega ={\widehat{{{\mathbb {C}}}}} \backslash E\), i.e., \(\Omega \) is the unbounded multiply connected slit domain obtained by removing the m slits \(E_1,\ldots ,E_m\) from the extended complex plane \(\overline{{{\mathbb {C}}}}\). The method presented in Sect. 2 is not directly applicable to such a domain \(\Omega \). However, an iterative method has been presented in [23] for constructing of a preimage unbounded multiply connected domain G bounded by smooth Jordan curves and the unique conformal mapping \(\zeta =\Phi (z)\), \(\Phi \,:\,G\rightarrow \Omega \), such that \(\Phi \) is normalized near infinity by the condition

$$\begin{aligned} \Phi (z)=z+O\left( \frac{1}{z}\right) . \end{aligned}$$
(27)

The inverse function \(z=\Phi ^{-1}(\zeta )\) is then the conformal mapping from \(\Omega \) onto G. The method presented in Sect. 2 is now applicable to the new domain G. This iterative method is reviewed in Appendix A.

Let \(w=f(z)\) be the Ahlfors map from the unbounded domain G onto the unit disk \({{\mathbb {D}}}\) such that \(f(\infty )=0\), \(f'(\infty )>0\), and \(f'(\infty )\) is maximal. Then the function

$$\begin{aligned} w=g(\zeta )=f\left( \Phi ^{-1}(\zeta )\right) \end{aligned}$$

is an Ahlfors map from the unbounded slit domain \(\Omega \) onto the unit disk \({{\mathbb {D}}}\). We have

$$\begin{aligned} g(\infty )=f\left( \Phi ^{-1}(\infty )\right) =f(\infty )=0, \end{aligned}$$

and

$$\begin{aligned} g'(\infty )=\lim _{\zeta \rightarrow \infty }\zeta [g(\zeta )-g(\infty )]=\lim _{\zeta \rightarrow \infty }\zeta f\left( \Phi ^{-1}(\zeta )\right) . \end{aligned}$$

If \(z=\Phi ^{-1}(\zeta )\), then \(\zeta \rightarrow \infty \) as \(z\rightarrow \infty \), and

$$\begin{aligned} g'(\infty )=\lim _{z\rightarrow \infty }\Phi (z) f(z)=\lim _{z\rightarrow \infty }\frac{\Phi (z)}{z}\,\lim _{z\rightarrow \infty }zf(z)=f'(\infty ), \end{aligned}$$

where we used (27) and the fact that \(\lim _{z\rightarrow \infty }zf(z)=f'(\infty )\). Since \(f'(\infty )\) is maximal, it then follows that \(g'(\infty )\) is maximal too. Thus, by computing the preimage domain G and the conformal mapping \(\Phi \,:\,G\rightarrow \Omega \) normalized by the condition (27), we will have

$$\begin{aligned} \gamma (E)=g'(\infty )=f'(\infty ) \end{aligned}$$

where \(w=f(z)\) is the Ahlfors map from the unbounded domain G onto the unit disk \({{\mathbb {D}}}\) with the normalization \(f(\infty )=0\) and \(f'(\infty )>0\). Since the domain G is bounded by smooth Jordan curves, the value of \(f'(\infty )\) can be computed as explained in Sect. 2.

We consider three examples. In our first example, we consider rectilinear slits on the real line. We know the exact value of the analytic capacity in this case and hence the error in the computed approximate values can be calculated. Examples with unknown explicit formulae are also presented.

Example 8

We consider several of the compact sets used in the process of generating the middle-thirds Cantor set. Let \(E_0=[-1,1]\), and let \(E_k\) for \(k\ge 1\) be defined recursively by

$$\begin{aligned} E_k=\frac{1}{3}\left( E_{k-1}-\frac{1}{3}\right) \cup \frac{1}{3}\left( E_{k-1}+\frac{1}{3}\right) . \end{aligned}$$
(28)

Note that \(E_k\) consists of \(m=2^k\) sub-intervals of the [0, 1], each of length \(2/3^k\). We denote these sub-intervals by \(I_j\) for \(j=1,2,\ldots ,m\). By (8), the exact value of \(\gamma (E_k)\) is known and given by

$$\begin{aligned} \gamma (E_k)=\frac{1}{4}|E_k|=\frac{1}{4}\sum _{j=1}^{m}|I_j|=\frac{1}{2}\,\left( \frac{2}{3}\right) ^k, \end{aligned}$$
(29)

from which it is immediate that \(\gamma (E_k)\rightarrow 0\) as \(k\rightarrow \infty \). Note for this example that

$$\begin{aligned} \gamma (E_k)=\gamma \left( \bigcup _{j=1}^{m}I_j\right) =\sum _{j=1}^{2^k}\gamma (I_j). \end{aligned}$$

The proposed method is used to compute approximate values \({\tilde{\gamma }}(E_k)\) to the analytic capacity \(\gamma (E_k)\) for \(k=1,2,\ldots ,10\) and the obtained results are presented in Table 4. We compute also the relative error in the computed approximate values. As can be seen in Table 4, our numerical method gives accurate results for sets consisting of a very high number of slits.

Table 4 The approximate values \({\tilde{\gamma }}(E_k)\) to the analytic capacity \(\gamma (E_k)\) and their relative errors for Example 8, where \(\gamma (E_k)\) is given by (29)

Example 9

We next consider the union of two equal rectilinear slits of unit length: one slit \(F_1=[0.1,1.1]\) is fixed on the real line, and the other is taken to be \(F_{2,\varepsilon }=[0.1e^{\textrm{i}\varepsilon \pi },1.1e^{\textrm{i}\varepsilon \pi }]\) where we vary \(\varepsilon \) between zero and one. A schematic of this configuration is shown in Fig. 9 (right) when \(\varepsilon =1/3\). Let \(E_\varepsilon =F_1 \cup F_{2,\varepsilon }\). It is known that \(\gamma (F_1)=\gamma (F_{2,\varepsilon })=1/4\), by (7). When \(\varepsilon =1\), we have \(E_1=[0.1,1.1]\cup [-1.1,-0.1]\) and hence \(\gamma (E_1)=1/2\), by (8). When \(\varepsilon =0\), we have \(E_0=F_1=F_{2,0}=[0.1,1.1]\) and hence \(\gamma (E_0)=1/4\). For \(0<\varepsilon <1\), there is no exact value of \(\gamma (E_\varepsilon )\). We use our method to compute \(\gamma (E_\varepsilon )\) for \(0.05\le \varepsilon \le 1\) and the numerical results are presented in Fig. 9 (left). It is clear that

$$\begin{aligned} \frac{1}{4}=\gamma (E_0)\le \gamma (E_\varepsilon ) \le \gamma (E_1)=\frac{1}{2}. \end{aligned}$$

That is, the value of the analytic capacity of \(E_\varepsilon \) is maximum when the two slits are collinear. Furthermore, we always have

$$\begin{aligned} \gamma (E_\varepsilon )=\gamma (F_1 \cup F_{2,\varepsilon }) \le \gamma (E_1)+\gamma (F_{2,\varepsilon })=\frac{1}{2}. \end{aligned}$$
Fig. 9
figure 9

Graph of the approximate values \({\tilde{\gamma }}(E_{\varepsilon })\) of the analytic capacity for the compact set \(E_\varepsilon \) in Example 3 as a function of \(\varepsilon \) (left). A schematic of the compact set \(E_\varepsilon \) showing the parameter \(\varepsilon \) (right)

Example 10

We next consider the union of four equal rectilinear slits of length \(2-2\varepsilon \), \(0<\varepsilon <1\), such that these four slits make the square \([-1,1]\times [-1,1]\) when \(\varepsilon =0\). A schematic of this configuration is shown in Fig. 10 (right) when \(\varepsilon =0.1\). We denote these four slits by \(F_{k,\varepsilon }\) with \(k=1,2,3,4\). We define \(E_\varepsilon =\cup _{k=1}^4F_{k,\varepsilon }\).

We use our method to approximate \(\gamma (E_\varepsilon )\) for \(0.01\le \varepsilon \le 0.99\) and the obtained numerical results are presented in Fig. 10 (left). As \(\varepsilon \rightarrow 0\), it is clear that the approximate values \({\tilde{\gamma }}(E_\varepsilon )\) approach

$$\begin{aligned} \gamma (E_0)= \frac{\Gamma ^2(1/4)}{2\sqrt{\pi ^3}} \approx 1.1803405990161, \end{aligned}$$

i.e., the value of the analytic capacity of the square \([-1,1]\times [-1,1]\). Furthermore, we always have

$$\begin{aligned} {\tilde{\gamma }}(E_\varepsilon )\le \sum _{k=1}^4\gamma (F_{k,\varepsilon })=2-2\varepsilon . \end{aligned}$$
Fig. 10
figure 10

Graph of the approximate values \({\tilde{\gamma }}(E_{\varepsilon })\) of the analytic capacity for the union of rectilinear slits in Example 10 as a function of \(\varepsilon \) (left). A schematic of the compact set \(E_\varepsilon \) for \(\varepsilon =0.1\) (right). The red dot is the exact value of the analytic capacity of the square \([-1,1]\times [-1,1]\) and the dashed-line is the upper bound \(2-2\varepsilon \) of \(\gamma (E_\varepsilon )\)

5 Concluding Remarks

This paper has shown how to use a numerical boundary integral equation method to quickly and accurately compute analytic capacity, an important conformal invariant. This quantity has been widely studied from a mostly theoretical perspective with several deep analytical results having been established [1,2,3, 6, 8, 11, 18, 19, 26, 30, 31, 33, 35,36,37]. Analytic capacity is intimately connected to the Ahlfors map and the Szegő kernel—two fundamental objects in complex analysis—and arises from the generalization of the Riemann map to multiply connected domains.

In our work, two particular classes of configurations were considered over which our calculations of analytic capacity were performed: compact sets bounded by smooth and piecewise smooth Jordan arcs, and domains consisting of a finite number of rectilinear slits. Throughout, we made connections with previous results; in particular, we have been able to corroborate the bounds found by Younsi and Ransford [36] for the analytic capacity for several compact sets they considered, and we were able to validate the conjectural subadditivity property of analytic capacity for numerous configurations. We were also able to validate numerically other exact results of analytic capacity, and illustrate several of its properties. Furthermore, the presented numerical results demonstrate that the analytic capacity \(\gamma (E\cup F)\), roughly speaking, increases when the distance between E and F increases and decreases when this distance decreases.

Our work has been mainly numerical in approach, and the key to its success lies in the BIE scheme based on the Kerzman–Stein BIE [2, 13, 20, 32] and the FMM [9, 10]. The method presented can be used for domains with smooth and piecewise smooth boundaries as well as for domains with many boundary components. We used the method also to approximate the analytic capacity for compact sets consisting of rectilinear slits. However, for the latter case, a preliminary conformal mapping step is required; this has also been shown to be expedient in other works [16, 23, 24].

The MATLAB codes for the presented computations in this paper can be found at the link https://github.com/mmsnasser/ac.