freealg.AlgebraicForm.edge#

AlgebraicForm.edge(t, kind='free', supp=None, dt_max=0.1, max_iter=30, tol=1e-12, verbose=False, plot=False, latex=False, save=False)#

Evolves spectral edges.

Parameters:
tfloat or array_like

Single scalar or an array of time \(t\). Edges are evolved at these time points.

kind{'free', 'deformed'}, default= 'free'

The type of operation:

  • 'free': evolve the spectral curve using free decompression

  • 'deformed': evolve the spectral curve using deformed deformation.

supplist, default=None

Estimated support of density as a list of tuples. If not given, support is estimated from the fitted polynomial.

dt_maxfloat, default=0.1

Maximum time step during the continuous time evolution.

max_iterint, default=30

Maximum number of iterations to solve for each time point.

tolfloat, default=1e-12

Tolerance of convergence

verbosebool, default=False

If True, debugging information is printed.

plotbool, default=False

If True, density is plotted.

latexbool, default=False

If True, the plot is rendered using LaTeX. This option is relevant only if plot=True.

savebool, default=False

If not False, the plot is saved. If a string is given, it is assumed to the save filename (with the file extension). This option is relevant only if plot=True.

Returns:
complex_edgesnumpy.ndarray

A 2D Array of the size (n_t, k), where n_t is the length of the input time array t, and k is the maximum number of edges. The i-th column of this array is a x coordinate of the i-th branch point, which may or may not be a spectral edge. This array is complex.

real_merged_edgesnumpy.ndarray

A 2D array of the same shape as complex_edges, but the elements of this array are real part of the previous array. If complex_edges also has non-zero imaginary parts, the corresponding element in real_merged_edges is set to nan, since these branch points points are spectral edges.

active_knumpy.array

A 1D array of the size n_t, the length of time t. Each element shows the number of active edges at each time point. For example, if the total detected number of edges are 4 (two bulks), once two edges merge, leading to one bulk, the active number of edges become 2.

Notes

This function evolves all branch points that are initially they were spectral edges at t=0. Once evolved, some edges may leave the real axis, in which, they no longer are spectral edges, but still branch points. The output array complex_edge track all these points (as complex number output) regardless they remain on the real axis or move to the complex plane.

In contrast, the array real_merged_edges are only the real part of the previous array, and filters out those branch points that cease to be spectral edge: they will be set to nan.

Fix: if t is a scalar or length-1 array, we prepend t=0 internally to advances from the initialization at t=0.

Examples

>>> import numpy
>>> from freealg import AlgebraicForm
>>> from freealg.distributions import CompoundFreePoisson
>>> from freealg import submatrix

>>> # Create a distribution with two bulks
>>> cfp = CompoundFreePoisson(t=[2.0,  5.0], w=[0.75, 0.25],
...                           lam=0.1)

>>> # Get a matrix realization of the distribution
>>> A = cfp.matrix(size=4000, seed=0)

>>> # Compress the matrix to smaller size
>>> As = submatrix(A, size=2000)

>>> # Create AlgebraicForm and fit the smaller matrix
>>> af = AlgebraicForm(As)
>>> af.fit(deg_m=3, deg_z=1)

>>> # Evolve edges corresponding to size 2000 to 4000
>>> t_final = numpy.log(A.shape[0] / As.shape[0])
>>> t = numpy.linspace(0, t_final)
>>> ce, rc, ne = af.evolve_edges(t)