Coder Social home page Coder Social logo

taylor-resum's Introduction

taylor-resum

Numerical tool for resummation of a Taylor series via conformal mapping.

Just initial MATLAB experiments for now, including version which uses the Schwarz-Christoffel toolbox to handle general polygonal regions.

Author: Alex Barnett. 7/31/19

resum_log_demo image

The task

Let be a function analytic at the origin, for which the first Taylor coefficients a0...ap are given. Let be a (possibly unbounded) simply-connected domain containing 0 in which f is assumed to be analytic. The task is to accurately evaluate such an f at a target z in Ω but which lies outside the disc of convergence of this Taylor series.

This is driven by an application of Olivier Parcollet and collaborators at CCQ (see Bertrand et al arxiv:1903.11646v3). They study quantum systems where Taylor coeffs at origin are given by diagrammatic or QMC methods, but there are partially known singularities and branch cuts near by. Their notation uses U instead of z.

Prerequisites

  • MATLAB. Tested with version R2017a.
  • SC Toolbox. This appears to be more recently updated (2013) than the old version 2.4.1 (2009). However in neither version does the GUI polyedit work for me.

Installation

Install MATLAB and the SC Toolbox. Follow the above green button to clone this repo into your own directory. In the code setupsc.m, change the addpath command to point to your SC Toolbox directory.

From MATLAB, run resum_log_demo, which should produce figures including the above, and output:

>> resum_log_demo
ftrue =
          1.38629436111989
check inv map good: 3.51e-16
est L rel acc: 3.78e-08
ftarg =
           1.38629167735975 +  2.26828892182112e-06i
ztarg=(3,0): f rel err = 2.53e-06

This illustrates 6-digit accuracy in the evaluation of log(1+z) at z=3+0i from p=15 terms of the Taylor series at 0, using a map to an unbounded polygon.

The method

Let z(w) be the conformal map (called iw in the code) taking the unit disc to Ω and 0 to 0. See above figure for Ω (left plot) and D (right plot). By our assumption on f,

is convergent in D. It is easy to show that there is a lower-triangular matrix L, independent of f, mapping the coefficients via

We approximate a finite block of this matrix using only application of z(w), by evaluating each monomial zn at the points z(r e2 π ij/N) for j=1,...,N. One must choose a suitable radius r and number of points N, and check stability with respect to these two parameters (in practice choosing N is easy, and it seems there is a range of r that is stable). Note that r can be large enough that the z-plane images of the circle points are outside the disc of convergence of f(z); this is because the procedure for L is independent of f, and only monomials are sampled at these points. See matrixfrominvmap.m.

Finally, given the vector a0,...,ap we hit it with L to get the c coefficients then use (*) to evaluate the truncated Taylor series for at w(z), for any desired target z.

Note that L involves large entries that grow exponentially with p, as the right-most plot above shows. This implies extreme sensitivity to errors in the given Taylor coefficient data.

Code usage

  • matrixfrominvmap.m : the main utility which outputs the first p-by-p block of the lower-triangular coefficient-mapping matrix L, given only a function handle of the map from w to z, and a radius r. The user must choose r, but the internal number of points N is set automatically. Called without arguments, a self-test demo is done.

  • resum_log_demo.m : tests the idea for the function f(z) = log(1+z), allowing two different choices of conformal map. Gets 6 digits.

  • resum_bertrand_demo.m : tests the function f(z) = 1/log(i(1-z)+1) used in App. A of Bertrand et al, using a map to the exterior of a downwards-pointing hairpin polygon domain. Gets 2 digits at z=2+0i, 1.5 digits at z=1.2+0i.

In the above two demo codes, all plotting code sections within if verb, ..., end can be removed to leave the math.

Notes about polygons in SC Toolbox

To create polygons, vertices must be in CCW order relative to the interior of the domain (for an unbounded domain this may appear to be CW).

  • bounded polygons: vertices as complex numbers, ie p = polygon([z1 z2 ... zN]);

  • unbounded polygons: for an infinite vertex, give Inf. Interior corner angles divided by pi must also be provided (these are called alpha's), ie ie p = polygon([z1 z2 ... zN], [a1 a2 ... aN]);. Note that the alphas must sum to N-2, where N is the number of vertices (including infinite ones). It appears N must be at least 3, so that a half-space or slit requires one vertex more than one might think. Trial and error is needed.

Once you have a valid polygon (p=polygon(...) has no errors), plot it using plot(p) to check the shape.

You should be able to graphically draw and edit polygons in SC Toolbox, but I have not got this to work on my MATLAB R2017a.

See the SC user guide for polygon examples.

To do

  • get feedback

  • get GUI polygon editing to work

  • try convergence acceleration on the transformed Taylor series

  • understand effect of nearest singularities in w-plane, affects design of map (how much should it shield singularities?). Plot the w-plane function.

taylor-resum's People

Contributors

ahbarnett avatar

Watchers

James Cloos avatar  avatar

Forkers

corentinb78

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.