Would you be willing to accept a new functioncalled ordqz which is roughly in the same spirit as https://docs.scipy.org/doc/scipy/reference/generated/scipy.linalg.ordqz.html)
Those steps are necessary in a lot of economics (and other applications, as you use it in the ricatti). Combining the ordering and generalized schur is necessary to have an AD rule.
Would you be willing to accept a new functioncalled ordqz which is roughly in the same spirit as https://docs.scipy.org/doc/scipy/reference/generated/scipy.linalg.ordqz.html)
Those steps are necessary in a lot of economics (and other applications, as you use it in the ricatti). Combining the ordering and generalized schur is necessary to have an AD rule.