Skip to content

Generic complex numbers and algebras, basic implementation#2589

Merged
fredrik-johansson merged 1 commit intoflintlib:mainfrom
fredrik-johansson:gr_complex
Mar 5, 2026
Merged

Generic complex numbers and algebras, basic implementation#2589
fredrik-johansson merged 1 commit intoflintlib:mainfrom
fredrik-johansson:gr_complex

Conversation

@fredrik-johansson
Copy link
Collaborator

Adds a generic implementation of the algebra $R[i]$ where $i^2 = -1$.

This is very basic, missing things like:

  • Several conversion to/from other types
  • Square and nth roots, elementary and transcendental functions for complex numbers
  • Polynomial and matrix multiplication
  • Optimizations for specific base rings

Three examples of things this can be useful for are shown in the Python docstring:

  • Arithmetic in $\mathbb{Q}(i)$ (since there is currently no fmpqi -- note however that this is unoptimized and either ca or nf_elem is currently a better choice for performance)
  • Arithmetic in $(\mathbb{Z}[x])[i]$ (as an alternative to $(\mathbb{Z}[i])[x]$)
  • Arithmetic in $\mathbb{\overline{Q}}$ using pairs of real algebraic numbers

@fredrik-johansson fredrik-johansson merged commit 9d8121b into flintlib:main Mar 5, 2026
12 of 13 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant