dlfivefifty / NumericalFreeProbability.jl

A Julia package for compute free convolutions
MIT License
0 stars 1 forks source link

Don't feel the need to document so much.... #2

Open dlfivefifty opened 1 year ago

dlfivefifty commented 1 year ago

I realise you are taught in programming to always document your code. But in research code this is time consuming and a lot of times the function is self-explanatory. I feel like your documentation is too detailed and that you are wasting time on this.

For comparison: Julia itself has very little documentation, particularly for the internal machinery, see e.g.

https://github.com/JuliaLang/julia/blob/master/stdlib/LinearAlgebra/src/diagonal.jl

I can understand pretty much the whole code even though the documentation is so sparse.

jamiecjx commented 1 year ago

By the way, expect progress with regard to:

Currently trying to adapt the method of recovering the measure from the Inverse Cauchy transform after knowing it's support

dlfivefifty commented 1 year ago

Awesome!

there’s something here I’m worried about: in this case we want a point cloud living on a Riemann surface but I don’t know how to tell which inverse lives on which sheet

ALTHOUGH… perhaps we don’t actually need this information as the “culling” process might still be valid.

jamiecjx commented 1 year ago

image

Free Convolution of Semicircle and atoms $1/4 (2\delta{-2} + \delta{-1} + \delta_{-1})$

Turns out that the pruning method we discussed earlier (for every $j$, for each inverse $k$, $G{\mu}(G{\mu}^{-1}(y_j)_k) = y_j$ is enough to recover the measure here (this was the example someone else did with fixed point iteration)

dlfivefifty commented 1 year ago

This is awesome!!

I guess the main thing missing now is when both the input measures are multi-valued? That is, how can we tell which inverse goes with which inverse?

It's possible we can just try every combination and the pruning procedure will deduce whether the pair are admissible or not.

jamiecjx commented 1 year ago

Is there an algorithm to find all roots within an interval?

It appears that Algorithm 5 is not applicable in the case of convolving a Square root measure with A point measure with 3 or more atoms i.e. there could be multiple roots of G^-1 in the interval [0, b_0]

dlfivefifty commented 1 year ago

A few approaches:

  1. Approximate the function by a piecewise polynomial and find the roots of that function. This is implemented in ApproxFun for example
  2. Use interval Newton method. This is completely rigorous and can give bounds on the number of roots within an interval. But this requires being able to evaluate on intervals which is hard for us since we compute the roots with eigenvalue problems. There might be in Arb.jl ball arithmetic for finding roots of complex polynomials.
dlfivefifty commented 1 year ago

Oh I forgot an easy one: Newton + Deflation . Basically you divide by the first root you find. This can be numerically unstable so instead you multiply by something like λ + 1/(x - r)

I guess this would also work with bisection

dlfivefifty commented 1 year ago

Or even just use bisection multiple times?

jamiecjx commented 1 year ago

I've been thinking about the convolution of a Sqrt measure with a point measure, and I have the following conjecture:

Let $Gb(w)$ be the Cauchy transform of the point measure $\mu{b}$ (For technical reasons, it must have at least 2 points, and finitely many points). Consider the function $1/Gb(w) - w$, which admits a Nevanlinna representation $-\int \textup{d} \mu{b} + \int \frac{1}{x-w}\textup{d} \mu'_{b}(x)$

This measure $\mu'_{b}$ has total measure equal to the variance of the point measure. And in this case, it happens to also be a point measure, with atoms whenever $G_b(w) = 0$.

If you represent the new measure as a sum of atoms $a1 \delta{\lambda_1} + a2 \delta{\lambda_2} + ...$

Let $\sigma^2$ be the variance of the Sqrt measure.

I conjecture that: A cubic singularity occurs in the convolution whenever $a_i = \sigma^2$, and such a singularity occurs at the point $\lambda_i$

jamiecjx commented 1 year ago

Some experimental evidence (ignore the numerical artifacts lol)

image

This is the convolution of the measure $\frac{x^{2}+1}{4\pi}\sqrt{4-x^{2}}dx$ with $1/2 (\delta{-\sqrt{1.5}} + \delta{\sqrt{1.5}})$, which was predicted under the conjecture

image

Convolution of semicircle with $1/2 \delta{\approx -2.78} + 1/4 \delta{-1} + 1/4 \delta_{1}$ which was also predicted $\sqrt{5+\sqrt{7}}$ is the closed form

jamiecjx commented 1 year ago

I also have some progress towards proving this, the two papers you sent me earlier have a lot of the machinery I think would be required to prove this, though neither paper really considered point measures on their own

dlfivefifty commented 1 year ago

Very cool.

Something I’m curious about is whether we can ever get higher order singularities such as quartic. This would probably have to correspond to a transition directly from one interval to 3