Best way to compute powers of complex rational functions

47 views
Skip to first unread message

Stephen Crowley

unread,
Aug 17, 2024, 3:29:49 PM8/17/24
to flint-devel


Dear flint-devel,

I'm currently working on a project that involves computations with complex rational functions. I've implemented these functions using a pair of `fmpz_poly_q` to represent the real and imaginary parts.

I need to compute the power of these complex rational functions, with both positive and negative integer exponents. I'm considering two approaches:

1. **Direct computation using the binomial theorem:**  I've implemented a function that expands the power using the binomial theorem and performs the necessary arithmetic operations on the `fmpz_poly_q` components.
2. **Matrix representation and `fmpz_poly_mat_q`:**  I could represent the complex rational function as a 2x2 matrix of `fmpz_poly_q` and use the `fmpz_poly_mat_q_pow` function to compute the power.

I'm wondering which approach is generally more efficient and recommended in FLINT. Are there any potential pitfalls or considerations I should be aware of for either method?

Any insights or suggestions would be greatly appreciated.

Thanks in advance,
Stephen

**Regarding which method is better**

* The matrix approach, leveraging `fmpz_poly_mat_q_pow`, is likely to be more efficient, especially for larger exponents. FLINT's matrix functions are generally well-optimized.
* The direct computation approach might be simpler to implement and understand, but could be slower for higher powers due to the nature of the binomial expansion.

Stephen Crowley

unread,
Aug 17, 2024, 3:35:15 PM8/17/24
to flint-devel
Well, now we know what a complete and utter piece of worthless junk google gemini is. It was hallucinating, there is no such fmpz_poly_mat_q .

That being said, any thoughts on the most efficient way to accomplish this given a complex rational function as a pair of real and imaginary rational function parts?

Oscar Benjamin

unread,
Aug 17, 2024, 4:44:57 PM8/17/24
to flint...@googlegroups.com
If you factor out the denominator then you can use fmpz_poly_mat.
> --
>
> ---
> You received this message because you are subscribed to the Google Groups "flint-devel" group.
> To unsubscribe from this group and stop receiving emails from it, send an email to flint-devel...@googlegroups.com.
> To view this discussion on the web, visit https://groups.google.com/d/msgid/flint-devel/0e61b54c-bdf8-467e-b483-0a019a0c8eafn%40googlegroups.com.

Stephen Crowley

unread,
Aug 18, 2024, 11:03:40 PM8/18/24
to flint...@googlegroups.com
Thank you I may try that if I need to I won't be computing powers more than a hundred I would be suspect

You received this message because you are subscribed to a topic in the Google Groups "flint-devel" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/flint-devel/jRffQJUzna4/unsubscribe.
To unsubscribe from this group and all its topics, send an email to flint-devel...@googlegroups.com.
To view this discussion on the web, visit https://groups.google.com/d/msgid/flint-devel/CAHVvXxT%3DWhy8%2BCTJnWZyn1o5uzbw4T13qLfoJjzg1ZSUhzmUbA%40mail.gmail.com.
Reply all
Reply to author
Forward
0 new messages