Skip to content
This repository has been archived by the owner on Apr 12, 2024. It is now read-only.

[WIP] Add implementation of partial sqrt algorithm #51

Open
wants to merge 24 commits into
base: trunk
Choose a base branch
from
Open

Conversation

wbhart
Copy link
Collaborator

@wbhart wbhart commented Aug 25, 2020

This works ok for small degree, but for large degree and large input it can take too long to find a b(n) it can factor.

Another approach is needed.

@wbhart wbhart changed the title Add implementation of partial sqrt algorithm. [WIP] Add implementation of partial sqrt algorithm Aug 25, 2020
@wbhart wbhart changed the title [WIP] Add implementation of partial sqrt algorithm Add implementation of partial sqrt algorithm Sep 30, 2020
@wbhart
Copy link
Collaborator Author

wbhart commented Sep 30, 2020

I am ready to merge this. If anyone has any comments on it, now is the time.


int nf_elem_is_square(const nf_elem_t b, const nf_t nf)

Return \code{1} if \code{b} is a square.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Perhaps document that this isn't any faster than actually computing the square root (as presently implemented).

@wbhart wbhart changed the title Add implementation of partial sqrt algorithm [WIP] Add implementation of partial sqrt algorithm Oct 2, 2020
@wbhart
Copy link
Collaborator Author

wbhart commented Oct 2, 2020

I just added the WIP back as I have found another case that hangs. I have no idea why at this point.

nf_elem/doc/nf_elem.txt Outdated Show resolved Hide resolved
@bobot
Copy link

bobot commented Feb 7, 2022

Is there a description of the representation used by the library? It seems not to keep an interval or other way to distinguish the root of the polynomial. Does it make the naïve $P(X^2)=0$ polynomial for the square root impossible?

Co-authored-by: François Bobot <[email protected]>
@wbhart
Copy link
Collaborator Author

wbhart commented Feb 7, 2022

That's correct. We implement number fields without embedding. If you wanted a \bar{Q} implementation you might look at Fredrik Johansson's Calcium library.

I'm not sure what you are asking about P(X^2). Could you be more specific?

@bobot
Copy link

bobot commented Feb 8, 2022

Even if Calcium library is interesting (thank you for pointing it!) I'm not sure I'm looking at embedding, but I must look more into it (mainly the roots used seem fixed in a field). I tried this library libpoly, but I have efficiency problem since the polynomials used are not minimal so I was looking at other libraries. For P(X^2) it is just the simple way I used to implement positive root in the library: SRI-CSL/libpoly#57 .

EDIT: Calcium was the answer to my problem and it is a great library! Thanks a lot.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants