Symmetric Bilinear Form

To find the distinct roots \(\{z_i\}_{i=1}^n\) and corresponding multiplicities \(\{m_i\}\) of the given function \(f(z)\) within the given contour \(C\) use is made of the fact that

\[\frac{1}{2\pi i} \int_C \phi(z)\psi(z) \frac{f'(z)}{f(z)} dz = \sum_{i=1}^n m_i \phi(z_i) \psi(z_i)\]

In cxroots the left hand side is computed using the function prod().

cxroots.root_counting.prod(C: ContourABC, f: AnalyticFunc, df: AnalyticFunc | None = None, phi: AnalyticFunc | None = None, psi: AnalyticFunc | None = None, abs_tol: float = 1.49e-08, rel_tol: float = 1.49e-08, div_min: int = 3, div_max: int = 15, int_method: Literal['quad', 'romb'] = 'quad', integer_tol: float = inf, callback: Callable[[complex, float | None, int], bool | None] | None = None) complex[source]

Compute the symmetric bilinear form used in (1.12) of [KB].

\[<\phi,\psi> = \frac{1}{2\pi i} \oint_C \phi(z) \psi(z) \frac{f'(z)}{f(z)} dz.\]
Parameters:
  • C (Contour) – A contour in the complex plane for. No roots or poles of f should lie on C.

  • f (function) – Function of a single variable f(x)

  • df (function, optional) – Function of a single variable, df(x), providing the derivative of the function f(x) at the point x. If not provided then df is approximated using a finite difference method.

  • phi (function, optional) – Function of a single variable phi(x). If not provided then phi(z)=1.

  • psi (function, optional) – Function of a single variable psi(x). If not provided then psi(z)=1.

  • abs_tol (float, optional) – Absolute error tolerance for integration.

  • rel_tol (float, optional) – Relative error tolerance for integration.

  • div_min (int, optional) – Only used if int_method=’romb’. Minimum number of divisions before the Romberg integration routine is allowed to exit.

  • div_max (int, optional) – Only used if int_method=’romb’. The maximum number of divisions before the Romberg integration routine of a path exits.

  • int_method ({'quad', 'romb'}, optional) – If ‘quad’ then scipy.integrate.quad is used to perform the integral. If ‘romb’ then Romberg integraion, using scipy.integrate.romb, is performed instead.

  • integer_tol (float, optional) – Only used when int_method is ‘romb’. The integration routine will not exit unless the result is within integer_tol of an integer. This is useful when computing the number of roots in a contour, which must be an integer. By default integer_tol is inf.

  • callback (function, optional) – Only used when int_method is ‘romb’. A function that at each step in the iteration is passed the current approximation for the integral, the estimated error of that approximation and the number of iterations. If the return of callback evaluates to True then the integration will end.

Returns:

  • complex – The value of the integral <phi, psi>.

  • float – An estimate of the error for the integration.

References

[KB]

“Computing the zeros of analytic functions” by Peter Kravanja, Marc Van Barel, Springer 2000