Improve counting of local solutions for QuadraticForm at p=2
Fixes #38679.
Introduces new method CountAllLocalGoodTypesNormalForm(Q, p, k, m, zvec, nzvec) to compute the number of local solutions of 'good type' for Q[v] = m mod p^k when Q is in local normal form at p.
This replaces the use of the slow brute-force function CountAllLocalTypesNaive indirectly used in local_good_density_congruence_even for (p,k)=(2,3) .
:memo: Checklist
- [x] The title is concise and informative.
- [ ] The description explains in detail what this PR is about.
- [x] I have linked a relevant issue or discussion.
- [x] I have created tests covering the changes.
- [x] I have updated the documentation and checked the documentation preview.
:hourglass: Dependencies
Documentation preview for this PR (built with commit b945f4b5ba0b029ee8649c487d1697d90a0e9c31; changes) is ready! :tada: This preview will update shortly after each push to this PR.
one failing doctest
Should be resolved now. The old doctest failed the (already existing) input assumption that Q is given in local diagonal form. The new code uses this assumption and therefore gave unexpected results. Now the local diagonal form is passed to the function in the doctest. I verified the results also with release version 10.4.
The previous build resulted in an error because some .coverage file was missing (see https://github.com/sagemath/sage/actions/runs/10962048022/job/30442695828 ). Is there something I can do to fix this? The coverage report is fine on my local machine and it is unclear to me what this error is referring to.
I also merged the latest develop branch again, maybe this will already resolve the issue.
That seems to have fixed it, should be good to merge now.
the documentation in count_local_2 is not looking right ; you can see it by clicking above and navigating to that file in the reference manual
Thank you both for noticing this and for the suggestions. I've updated the docs accordingly.
Thank you both for noticing this and for the suggestions. I've updated the docs accordingly.
Thanks for the changes, looks good to me now! Not sure why the workflows require approval, but since the last commit only changed documentation and the tests ran correctly before, I'll set this to positive review.