imate.sample_matrices.toeplitz_traceinv#

imate.sample_matrices.toeplitz_traceinv(a, b, size, gram=False)#

Computes the trace of the inverse of Toeplitz matrix using an analytic formula.

The Toeplitz matrix using the entries \(a\) and \(b\) refers to the matrix generated by imate.toeplitz().

Parameters:
afloat

The diagonal elements of the Toeplitz matrix.

bfloat

The upper off-diagonal elements of the Toeplitz matrix.

sizeint, default=20

Size of the square matrix.

grambool, default=False

If False, the matrix is assumed to be bi-diagonal Toeplitz. If True, the Gramian of the matrix is considered instead.

Returns:
traceinvfloat

Trace of the inverse of Toeplitz matrix

Notes

For the matrix \(\mathbf{A}\) given in imate.toeplitz(), the trace of its inverse is computed by

\[\mathrm{trace}(\mathbf{A}^{-1}) = \frac{n}{a},\]

where \(n\) is the size of the matrix. For the Gramian matrix, \(\mathbf{B} = \mathbf{A}^{\intercal} \mathbf{A}\) (when gram is set to True), the trace of inverse is

\[ \begin{align}\begin{aligned}\mathrm{trace}(\mathbf{B}^{-1}) = \begin{cases} \displaystyle{\frac{n(n+1)}{2 a^2}}, & \text{if} a=b \\\ \displaystyle{\frac{1}{a^2 - b^2} \frac{q^2 (q^{2n} - 1)}{q^2-1}} , & \text{if} a \neq b \end{cases}\end{aligned}\end{align} \]

where \(q = b/a\). If \(n \gg 1\), then for \(q \neq 1\) we have

(1)#\[\mathrm{trace}(\mathbf{B}^{-1}) \approx \frac{1}{a^2 - b^2} \left( n - \frac{q^{2}}{1 - q^2} \right).\]

This function uses the approximation (1) when \(n > 200\).

Examples

>>> from imate.sample_matrices import toeplitz_traceinv
>>> a, b = 2, 3

>>> toeplitz_traceinv(a, b, size=6)
3.0

>>> toeplitz_traceinv(a, b, size=6, gram=True)
45.148681640625