Skip to content

added precomputation of Artin-Schreier LUP decomposition for qadic char 2 sqrt#2622

Merged
fredrik-johansson merged 4 commits intoflintlib:mainfrom
alexey-orlov-math:qadic2-sqrt-precompute
Mar 26, 2026
Merged

added precomputation of Artin-Schreier LUP decomposition for qadic char 2 sqrt#2622
fredrik-johansson merged 4 commits intoflintlib:mainfrom
alexey-orlov-math:qadic2-sqrt-precompute

Conversation

@alexey-orlov-math
Copy link
Copy Markdown
Contributor

  • Extracted the LUP decomposition of the Artin-Schreier matrix (used for finding initial square root approximation in characteristic 2) into a separate function _artin_schreier_lup, so it can be computed once and reused across multiple qadic_sqrt calls in the same extension field.
  • Added a public API (with underscore to signal "use on your own risk"): _qadic_char2_sqrt_precomp_init, _qadic_char2_sqrt_with_precomp, _qadic_char2_sqrt_precomp_clear
  • Added tests comparing the precomputed variant against qadic_sqrt on random squares, and a simple benchmark doing R sqrt in the qadic extension of degree d
sqrt [d = 300, R = 500]: 2.0292 s
sqrt (precomp) [d = 300, R = 500]: 0.5945 s
sqrt [d = 500, R = 500]: 6.2686 s
sqrt (precomp) [d = 500, R = 500]: 1.2923 s
sqrt [d = 1000, R = 500]: 37.0105 s
sqrt (precomp) [d = 1000, R = 500]: 5.3692 s

@alexey-orlov-math alexey-orlov-math marked this pull request as ready for review March 26, 2026 16:01
@fredrik-johansson
Copy link
Copy Markdown
Collaborator

Looks good, thanks! Nice speedup.

@fredrik-johansson fredrik-johansson merged commit fe1d6c6 into flintlib:main Mar 26, 2026
13 checks passed
@alexey-orlov-math alexey-orlov-math deleted the qadic2-sqrt-precompute branch March 26, 2026 17:38
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.

2 participants