# Eq. (2.24)

We state that

\begin{equation}
    h_n^{(k)}\underline{a}^{(k,q)}_{nm} = h_m^{(k)} \underline{a}_{mn}^{(k,q)}.
\end{equation}

This can be easily shown using shenfun. Import the matrix `a_` (representing $\underline{a}^{(k,q)}_{ij}$) and normalization factor `h` 


```python
import sympy as sp
from shenfun.jacobi.recursions import a_, n, alfa, h, m, n
k, q = 1, 3
```

The matrix $\underline{A}$ is tridiagonal and as such $\underline{A}^q$ has bandwidth $1+2q$. It will as such be sufficient to look at the index $m$ being one of $(n-q, n-q+1, \ldots , n+q-1, n+q)$. Check that all components of $h_n^{(k)}\underline{a}^{(k,q)}_{nm} - h_m^{(k)} \underline{a}_{mn}^{(k,q)}$ are identically zero. Since this takes a bit of time (Sympy.simplify is pretty slow), we can use $\alpha=\beta$ to speed up. But the results hold also for Jacobi polynomials in general.


```python
beta = alfa
for i in range(-q, q+1):
    m = n+i
    dh = h(alfa, beta, n, k)*a_(k, q, alfa, beta, n, m) - h(alfa, beta, m, k)*a_(k, q, alfa, beta, m, n)
    print("m = n{0:+}, dh =".format(i), sp.simplify(dh))
```

    m = n-3, dh = 0
    m = n-2, dh = 0
    m = n-1, dh = 0
    m = n+0, dh = 0
    m = n+1, dh = 0
    m = n+2, dh = 0
    m = n+3, dh = 0


b7e442984df64631149bd64db0955db90654f7b9
ipynb
Jupyter Notebook
binder/Equation (2.24).ipynb
spectralDNS/PG-paper-2022
0bfa82e1ff77a5bb9a6ec5be930b4c00b449a1e0
BSD-2-Clause
binder/Equation (2.24).ipynb
spectralDNS/PG-paper-2022
0bfa82e1ff77a5bb9a6ec5be930b4c00b449a1e0
BSD-2-Clause
binder/Equation (2.24).ipynb
spectralDNS/PG-paper-2022
0bfa82e1ff77a5bb9a6ec5be930b4c00b449a1e0
BSD-2-Clause
Qwen/Qwen-72B
1. YES
2. YES