Karim Belabas on Fri, 08 Jul 2022 11:26:03 +0200
|
[Date Prev] [Date Next] [Thread Prev] [Thread Next] [Date Index] [Thread Index]
Re: Hilbert class polynomial roots mod q
|
- To: Andreas Enge <andreas.enge@inria.fr>
- Subject: Re: Hilbert class polynomial roots mod q
- From: Karim Belabas <Karim.Belabas@math.u-bordeaux.fr>
- Date: Fri, 8 Jul 2022 11:25:57 +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=1657272359; c=relaxed/relaxed; bh=4zlkTUKPVWG20nC+t16wlK1MgBzQIK3Q1gK0M2FXlxI=; 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=RZxNF6UzlrwrnJk9zbMC89nBQ8iIHsPPMBjdizyWUxEQeuIg6M/WegodIX8hbtgnEiqOGRBZ9AdiKkTbmSNuJtM2QQsMhRMpY4PpxLdoafKeEK86cAYGuweubEjACgShnPxSkyyXPSTnS/g/lzxQS5zRT6blTqXPQE57p1EzovJ9Htyz2ZFP+Bvx45ArhyoYTumNAiHxZA1uwzEMRzwz9Q3sgnijlebuJPBUVHYB+VpZ6jwmbfGfEGIFN0G5qhDs8Wa11MMLdNPKuuN4qu+p9ejwrHe7aeSRWTpKFjQk706AI+SWY3+OQOo64wYJtbKDulXU2x/um+zgbQx5tZ5ZoKf8DrrKK8T1Naq7ZP+wmrtySHjONQ7Gml+rpwfxNg16WziwXXbtHMKsyVgI2qeQuvDCOJCRh9ow41MwfXjDPqjdx+zaF7TH5+UaH6jdzbwqcYiTDsOgLG3Eb8GxZTAECGrna8uB/o0td//93pXZFb/zItpr3uOsp3Nc4nfVrXc8GScYPHkDXAMXKnHsGs4/cBFLdk+6rU0pDokB1aGePWnsruV9cEe/7bp77GOBYGlmBeMXiDhl9lNVZzSw3wCIY4PAk4WdtnuoKjLG9QkbzidpMrR6zU2W85XQgRRxiJq8KlofBe88JaznVzyuqhUTGnVa1v2GHhDQsdzSN3NNr14=
- Arc-seal: i=1; a=rsa-sha256; d=math.u-bordeaux.fr; s=openarc; t=1657272359; cv=none; b=et7AkJEY1R2lnj0AEEfluhiM/0VKGZjkMg0RDUQtPRDaOjOzW8sVATpg7AxoSgCyJhkVwn6pzY+FdyRxqX4s95LX6cvTJgdxvFIy8QVfbOWy59+LNT0qmKIxj39wK6zCAbKoA0I8y5TKrUnSk0VPZ7wu1xC5jXO6V0mqEoM413noGbjYFCWv25KUUXnW2YnXAeJF8nDUuHcdhXPVqyBegd/WXmLibwDNS5iuOIfPQhQMayq8gA9ZPGodcIjnTAdcbHCl77yLIXttW0WK14wgHdHLGnnqgTv3pZ0/5cjYxM/BpJ6RvOfLCTZJ/SCqm8IEmDAXHBGxMZXz5nhINyGG3uj2lG4Y2htLu5eejS4Ju9td2tjGEmdn4+J4ksMnnhybTQHG22p3+YyVcujlwKhxEIVyb3Lej47YF0YE7r9awdYBKYAiBqGAkDisWocWnPA/HZIc/UQ46hubIfDX8UAjNTlKJnbWs3vWA+e77WR7CjjE24D3qMysk6HcGZ0eX58tk2AtwH72dxSkfZff6P61kHSR1HRvbAzkY+cV6jN0ZUrSHEoOIV5F7QTXmI9C8nWHnPC3WX0mAijGZ+XURLXJYdOd24NIukEN/OmwElpFwlp2IfMyAYFIVE3SqEvc8+FRG1FnMrIaBc1Sr1fhYWJRBWB/FDmOslsDw+92H2Zb2ao=
- Authentication-results: smail; arc=none
- Cc: pari@jvdsn.com, pari-users@pari.math.u-bordeaux.fr
- Delivery-date: Fri, 08 Jul 2022 11:26:03 +0200
- Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=math.u-bordeaux.fr; s=2022; t=1657272359; bh=4zlkTUKPVWG20nC+t16wlK1MgBzQIK3Q1gK0M2FXlxI=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=Wpdqo0P3/aB1I3HqZJSxL7+iD2uOOyQ5kUSCAVOOtcZ+5N7YDmNaEdsnMQ3k5tt8U buaVdnhZsDqpFBmM9ZA2VQaB/Ce/0HsyeWePEAlhtPrQsh73WjUu48RIjo2zt7GrVY g8lG4aXBt2OWo1F341RCXlIOkB/28WWIhFE/ZlYMFEM6fD0+99W0TWhh7KPYZ6kncc le61FUWPBRN0SpWWE3gvL7Ujvqvhrc6z/BDT+kt/7CSvUDuYMVVLTf5RF16rW9I9OA dJ/muSXJW9Y8fZSq/SkEZ1oRaV5pKcGNSE4Slnz5DYRoHcJc/yT22FlbZvf+VS+poX P3/5ga3mK5LHZ3cQQI1y3XscGYmWx+gi55MKI2sLIfzGhobpRT1BXBtDNGqyvRkYlT cavP6ie4dT2T45s8YOeVbW4M5fMYc2O3kS41te8thVGCvycatdOWPIR7EQIrRAa7va Jc9DvEJNfChhONef19nTbdRCgEFO7zTcYH0aDnDwCK0CmT1Us3BWfm4yCZwwe6rRXG As0Y8x5Wfmt+zC89lOmkjOZNls1ScvuqjW9br30ynpwlraDuNymBzXsSmSLILa17EJ nHg+MF+BUf2+mKnQ0jUx41g4cH0Jjd2x6+hAwlw2+uLu96IRcppLcHFmjEU6UoNXQr Y5dNQAvR8I3p/hDd0+DG5G08=
- In-reply-to: <Ysc1JxJ5zfVZgzeW@jurong>
- Mail-followup-to: Andreas Enge <andreas.enge@inria.fr>, pari@jvdsn.com, pari-users@pari.math.u-bordeaux.fr
- References: <f2ad96b9-b1ad-0555-20b7-6f8609250269@jvdsn.com> <YsNKRwc2VerX3huG@seventeen> <69f31097-e292-8a85-3cee-407d4b029fe0@jvdsn.com> <YsVHUHMBPPcQAZk1@jurong> <91cc5c19-051c-e827-a7b4-44967e96e8cd@jvdsn.com> <Ysc1JxJ5zfVZgzeW@jurong>
* Andreas Enge [2022-07-07 21:34]:
> Hello Joachim,
>
> Am Thu, Jul 07, 2022 at 08:16:44PM +0200 schrieb pari@jvdsn.com:
> > * PARI/GP polclass: out of memory after about 20 minutes (PARI stack size
> > set to 9100001280 (8678.438 Mbytes))
> > * Sutherland's classpoly without providing q: 149.9s
> > * Sutherland's classpoly with providing q: 129.2s
> >
> > As you can see, Sutherland's implementation is somewhat faster if q is
> > provided.
>
> indeed, somewhat faster, but not radically so. In any case, Sutherland's
> implementation is really fast, with or without q. And if I am not mistaken,
> it is not even parallelised.
>
> My CM software needs 2700s (on one core of my laptop) for this polynomial
> of degree 38022 and with a precision of 57641 bits (which tends to be very
> close to the size of the largest coefficient, which has 52360 bits here).
> The text file storing the polynomial in GP format takes about 500MB.
>
> > Perhaps another question is why the PARI/GP implementation is so
> > inefficient compared to the original implementation it was adapted from.
>
> It should definitely not run out of memory on this size of polynomial.
> I would call this a bug. Or at least an opportunity for improvement!
I just fixed that memory problem in the 'master' branch:
polclass(-4506399751,1);
is still slow (23 minutes on my laptop) but requires less than 2GB,
in fact a little more than 1GB. The output size (internal binary format, not
text) is 231MB, so this is OK.
As far as speed is concerned, I see where the bottleneck is but am not
familiar with the code either. We're computing modulo 1681 (32-bit)
primes, which is enough to recognize 53792 bit coefficients, even closer
to the optimal 52360 compared to 'cm'.
The computation modulo each such prime p is "too slow", which in turn
boils down to computing roots mod p of small degree polynomials (say T)
and in fact just computing x^p mod T is the bottleneck (deg T ~ 5, p ~ 2^32);
not sure why we lose a factor 10 or so there, compared to Sutherland's code.
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/
`