Karim Belabas on Fri, 02 Sep 2022 16:12:34 +0200
|
[Date Prev] [Date Next] [Thread Prev] [Thread Next] [Date Index] [Thread Index]
Re: all divisors of a cyclotomic integer
|
- To: John Cremona <john.cremona@gmail.com>
- Subject: Re: all divisors of a cyclotomic integer
- From: Karim Belabas <Karim.Belabas@math.u-bordeaux.fr>
- Date: Fri, 2 Sep 2022 16:12:18 +0200
- Arc-authentication-results: i=1; smail; arc=none
- Arc-message-signature: i=1; a=rsa-sha256; d=math.u-bordeaux.fr; s=openarc; t=1662127941; c=relaxed/relaxed; bh=yYTXKph/6viW+cKG1Tew061H7NANfWTy1Vo132gn+00=; h=DKIM-Signature:Date:From:To:Cc:Subject:Message-ID: Mail-Followup-To:References:MIME-Version:Content-Type: Content-Disposition:Content-Transfer-Encoding:In-Reply-To; b=ZeJULJa6W34NpS/HdrT/YC6+ThFJWH7r4IMeENzARbFzThwnKMyVlzmCkjAGlUn760HPewuPRLG3aLUMxxpXMctJdG0YZRaRSXQ6OGTarS7PDeCABM39BsS+rWarDLk9K4N06Z59heH15JxxNH3kdda+hodW58oGxSGeHDqTi3z5f7yVUKLHx1JtXeqYDzXOHRsHz5feUzTRLv2tppCHTpPa1n8gYwpo7tn2b23bDLXPU5ZKBjxGn271NrdPBA/dRmRgceH3lLoRwuk2dKDr/RTJ5Gf4u4SBIt0G/mKnvDBSA2kRKIQ/s1Wx8WIh2gmiXyTntRU53a7c16ciJ3HV2J/VE4USvoLwSf4mX0aueXfrSZZbIh7RXvaQDw3oENC6HFY8vg/59xqL4FSEUvL7FtcC/6DuEtfolJh4DRuiVIECyPNIiCqTqYJHsnBcijsTTXtI6pKIDH4fzfx027DJlata9ynsTvYJxt1jxpoCsUXEfSikFvWDYNVi+nmcKPsS9ThwNtfvOgekQG9NTNdY4F7Bl3+wUcjhZJDCrak534VZXN+5GbcvLn9GcsmjVG1ey0yrRbBJ1e95q5ecJ8qG6z6Hsnh5nmvcwgvJtXSyOKIwmtT+tCsYbZldH8BAEuL/ftekbg2aV0SEJICenPRwaG/NTAFk6i2YurjXZ3O0ucE=
- Arc-seal: i=1; a=rsa-sha256; d=math.u-bordeaux.fr; s=openarc; t=1662127941; cv=none; b=YHeHmvMcj+dt2rcEOc0vyi3QGD0Pwh+Hyky+HyDfuVGYQ0GWV/YawIGpyYvt8Vg7SbEPK0+tMB0YlpKAfGPQxaB0HB8D3l6UavuY8jCjkVH9NQKHL0bM7bP9GHT6anZ5e05EWPqIOWtQJqCrqEWBOC8h/ENJdPcIKmhT/CnIKjVTbeXMDpayJvDZgesSSOmfS8bCvBFYVCIyf3SCF+NEbuoG9g4iG61qt5P30rVZPcM+4lC0f4lAUtJKTIrwlFJ5AEtd3TYL+01t+XJh5iliuGQMBTOsEt87deF68UkxZebW9aFn01H3gi0fkwEsJUO96p7xu9RyMvsnq0QzHP5ZQLLn4uEO2PM2PpcGwIjH6ds8ptO3Z+tsU7BfjvUQG2ZCZu8YpPSF05ke80hQnOc+QBBDmTdfJwq83fuUTKhYFWu++I6Pp18K57c0UBJnEwbaNj3/svIDMlXkVj9WfUIkxYoHLlYLG5FBb0DsABeEe45xopSIbHjJBTFRR5inj3DXvinXgF30yZZb3pmuG9tjL5tWiFE7YqVgv+9mwEdSn5PaCQJAPTnw/wVTB0JacpkmPaRoh9ynb2Y/exQnQcds8RRymIXjCbwuIRXYSWjWFerKg2/XyrLS0DPef0LIIr40oxhPC3yrtGpK0f0hxPmgp8dLXbueVJ2rPFE2rOaq3r4=
- Authentication-results: smail; dmarc=none header.from=math.u-bordeaux.fr
- Authentication-results: smail; arc=none
- Cc: Pari Users <pari-users@pari.math.u-bordeaux.fr>
- Delivery-date: Fri, 02 Sep 2022 16:12:34 +0200
- Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=math.u-bordeaux.fr; s=2022; t=1662127941; bh=yYTXKph/6viW+cKG1Tew061H7NANfWTy1Vo132gn+00=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=U27m1e/Cj+zh3dH2gzhCMMT2rKUBdn8zoiqRa/cOX63/2dpWOICBYnlx5+SUPUbRx U/TpQBh6PtXnMNCtQdc+MxUGace2xR+17XMzZCD0Z/z1C6HzBefJI7p91+JOTvfxuP Jq9aNsissAPLifFGURRBX7kZFjBzwAnxVLHPEjxDDAIxPf38wOHPxignAAj3JSYLkh qnCD/5VGEMKrCzbovgMkMu5uNyCGRGElBtK8q9p/uptMwjObGmSUy7XrkighAKGsK9 I6oZCgO2B43ZuRU/JrwSvp3Fc6y3xEGN2O7lxjzW4s6HbHsqKBptl60drUgFq1JRWI ozugU6XO0OafDpm2V7O4c8q5WIZflbdC4iyffdruiTHe0Xyez0GUILAERxVC3B0yAy gCukV2yv0rbYd7k5Nr9mGeNh2OVhOjlJBftI3vW9OJXcWWQkkdE85U9rQ6RyG60s6e MUVB0qyFRRSTEuW0oOAwoZGhZfeEN5+wjOG5+lDDIG8Sbmp52/GS50TSPk5Z5rNiuH QaQv98RvY1/r19HrgRZtX2UZ4wwa5694N+liIJLM71F6S9m29RTjmTY56jV+NI22/v MlNy+NyIS53A/RgvsuTolqm7/Ubj2K6mm0bpw11lGnRyJWPlUl+UhxgMvq2lvnkyiI 8xKZPggK3PmTVf52lfqVQZ2o=
- In-reply-to: <CAD0p0K5tjETa08EkXTiVmNMosOrKHzMuFHF4YtKpJ2p_98hM8A@mail.gmail.com>
- Mail-followup-to: John Cremona <john.cremona@gmail.com>, Pari Users <pari-users@pari.math.u-bordeaux.fr>
- References: <CAJkPp5NTu1Fe01Dbkqg8L2eTaorAF3PZ_gLbLn2Rf_romNDb6A@mail.gmail.com> <YsC0fqV7pR42R3Pn@seventeen> <YsC4BbI1GfxfrrbZ@seventeen> <CAJkPp5PKe8wP-VGFNGb_04oMmz_D-LUFXWn=ORjyGGPUXA4Xcg@mail.gmail.com> <YwzymE02+O96x3ZA@seventeen> <CAJkPp5MnngpJ1KxjgNEhYH9VGsQnmW05+t7BdpOAJVaRuuvung@mail.gmail.com> <YxEHRg9UG878uxFt@seventeen> <CAD0p0K5tjETa08EkXTiVmNMosOrKHzMuFHF4YtKpJ2p_98hM8A@mail.gmail.com>
* John Cremona [2022-09-02 12:05]:
> I think that if a user thinks that some utility function would be useful,
> and it is easy to provide, then the software authors should consider adding
> it even if they themselves cannot think of an application.
>
> In my code for computing bianchi modular forms (which does not use libpari
> as I am not clever enough to use it) I have a lot of ideal utilities, and
> listing all ideal divisors of an ideal is one of them.
>
> So I vote to add such a function.
The possible variants are essentially described in ??divisors : here's
the loop version without using the (known!) factorization of each
divisor, just printing the result:
idealdivisors(K, id) =
{ my(F = idealfactor(K, id), P = F[,1], E = F[,2], d);
forvec(e = vectorv(#E,i,[0,E[i]]),
d = idealfactorback(K,P,e); print(d))
}
? K = nfinit(polcyclo(68));
? idealdivisors(K, 2*x^30 + 4*x^26 + 2*x^22)
/* output omitted */
There are quite a few such variants, based on idealfactor and forvec.
With or without restricting to principal ideals for instance [as in
Bill's code]; or returning a list instead of looping through the
results, or maybe together with their factorizations, etc. I'd rather
give a few examples in the documentation and keep the interfaces simple.
If efficiency is a concern one could
- use a Gray code to perform a single multiplication for each new
divisor, instead of idealfactorback from scratch.
- multiplications by prime ideals which are much cheaper than general
multiplications; note that idealfactorback doesn't use this trick
because it must cater to arbitrary "factorizations" involving arbitrary
ideals not only primes [it could check its input first then take
advantage of the trick if possible; but it currently doesn't]
- to output principal ideals only, one could precompute the images of the
P[i] in the class group (matrix of discrete logs M) and restrict to
exponent vectors such that M*v = 0 mod the class group elementary divisors.
Again each can be done in 5 to 10 lines of GP. I hardcoded a specific
variant in C for bnfisintnorm() because we had a specific application,
namely thue().
Cheers,
K.B.
--
Karim Belabas, IMB (UMR 5251), Université de Bordeaux
Vice-président en charge du Numérique
T: (+33) 05 40 00 29 77; http://www.math.u-bordeaux.fr/~kbelabas/
`