On Tue, Apr 30, 2024 at 3:29 AM 'Doris Behrendt' via sage-devel <
sage-devel@googlegroups.com> wrote:

> Hi all,
>
> My team is about to develop a webapp where we want to factor polynomials
> with coefficients in ZZ.
> We want to offer a dropdown menu where the user can select the base ring
> and then the factorisation changes interactively. We use React and
> JavaScript and also Web Assembly, e.g. for our Web-OpenSSL here:
> https://www.cryptool.org/en/cto/openssl/
>
> Sage offers the command change_ring, we did not find a JavaScript Library
> that has this functionality. So I thought, perhaps we could look for
> solutions where Sage is used together with web assembly.
>

What base rings do you intend to support?  The hard part is the factoring
itself, not the change_ring (which basically only requires that you have a
reasonable internal representation for that base ring).  Reasonable base
rings that I can think of:
* Finite fields GF(p) with p prime
* Finite fields GF(q) with q a prime power
* Complex numbers
* Real numbers
* p-adic numbers for prime p
* Number fields
* the integers themselves
* Z/N for N not prime (there are tricky issues here, since factorization is
no longer unique)

Sage mainly uses other open source C libraries to carry out these
factorizations, so you would need to be able to port these to wasm as
well.  The underlying C libraries used vary by base field, and include
pari, FLINT, NTL and maybe others.  You can figure out what is used by each
base ring using the get_systems function (note the warning displayed; I
haven't recompiled my sage):

sage: from sage.misc.citation import get_systems
sage: R.<x> = ZZ[]
sage: f = (x^4 + 2)*(x^3 - 3)
sage: get_systems("factor(f)")
<ipython-input-101-7ff638a220bf>:1: UserWarning: get_systems() requires
Cython profiling to be enabled, otherwise the results will be very
unreliable. Rebuild Sage with the environment variable 'SAGE_PROFILE=yes'
to enable profiling.
  get_systems("factor(f)")
['FLINT']

Finally, you should think about what scope you want to support in terms of
degree (and, to a lesser extent, size of coefficients), as well as whether
you want to allow non-monic polynomials.

Good luck!
David

After some research I have the impression that there are some proofs of
> concept, but there is nothing actively developed?
>
> Since I am not a programmer and nobody in my team is a mathematician (so
> my developers don't know Sage), I kindly ask on this list for any hints how
> we could proceed?
>
> Thanks in advance
> Doris
>
> --
> You received this message because you are subscribed to the Google Groups
> "sage-devel" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to sage-devel+unsubscr...@googlegroups.com.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/sage-devel/08830539-4D13-4E63-80E0-4F1F788B1657%40me.com
> .
>

-- 
You received this message because you are subscribed to the Google Groups 
"sage-devel" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to sage-devel+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/sage-devel/CAChs6_mC%3Db1sx-ZFgUEZN6Tkkc2Shh08eT98e%2B747%2BY%3D0P8Pew%40mail.gmail.com.

Reply via email to