Function Repository Resource:

Recover a Jacobi matrix from a list of abscissa-weight pairs

Contributed by: Jan Mangaldan
 ResourceFunction["QuadratureWeightsToJacobiMatrix"][{{x1,w1},{x2,w2},…}] returns a list {j,c}, where j is the Jacobi matrix corresponding to the quadrature rule represented by the abscissa-weight pairs {xi,wi} and normalization factor c.

## Examples

### Basic Examples (2)

The resource function GaussianQuadratureWeights gives a list of abscissa-weight pairs for Gauss-Legendre quadrature:

 In[1]:=
 Out[1]=

Recover the corresponding Jacobi matrix and normalization factor:

 In[2]:=
 Out[2]=

### Scope (4)

 In[3]:=
 Out[3]=

Recover the Jacobi matrix and normalization factor from the quadrature data:

 In[4]:=
 Out[4]=

Compare the recovered Jacobi matrix with the result of the resource function JacobiMatrix:

 In[5]:=
 Out[5]=

The normalization factor is equal to the sum of the weights:

 In[6]:=
 Out[6]=

### Applications (2)

QuadratureWeightsToJacobiMatrix can be used even on non-Gaussian quadrature rules. Build a Jacobi matrix from a Newton-Cotes rule:

 In[7]:=
 Out[7]=

The resulting Jacobi matrix is unsymmetric because some the weights of the quadrature rule are negative:

 In[8]:=
 Out[8]=

A Clenshaw-Curtis rule whose weights are all positive will yield a symmetric Jacobi matrix:

 In[9]:=
 Out[9]=
 In[10]:=
 Out[10]=

## Version History

• 1.0.0 – 06 April 2021