Karim Belabas on Fri, 16 Feb 2024 18:01:52 +0100
|
[Date Prev] [Date Next] [Thread Prev] [Thread Next] [Date Index] [Thread Index]
Re: conversion of t_FFELT to t_POL
|
- To: Max Alekseyev <maxale@gmail.com>
- Subject: Re: conversion of t_FFELT to t_POL
- From: Karim Belabas <Karim.Belabas@math.u-bordeaux.fr>
- Date: Fri, 16 Feb 2024 18:01:05 +0100
- Arc-authentication-results: i=1; smail; arc=none
- Arc-message-signature: i=1; a=rsa-sha256; d=math.u-bordeaux.fr; s=openarc; t=1708102867; c=relaxed/relaxed; bh=I7iKGumfuAJPDjpV5fiQ2/9TTbti6k7X1WODD1DxpdE=; 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=awF/yL1OS8PdqqOfvmf96kSWGaZUoi0+xnZyfKOUsl+r6Ta4snzFdBhUdDxuxtcZQ4krpENwFsontCczx4vu9kGGaEcZqRfSEebSVmiItU3wg0zEbPMpa6fjvBgtTW/woEcCbhiJe6RYB9f69wZfWtHvj1ahPfH3aPLYKH4uSgO9oziu+I5tDUCExXEA3jzw/1XJutOwHjpS1ihvrP6ZaRYOhb7dKkdPwApEDKPr4z25ajmcwXElPAjpgumFwGWSbUBbK3gz5OFpWik3k/2GbtQ77FF2dSdH40H58EAiQh9Y3wMBHyn5/cSTCgmYlh6BquDXfs9uqMtc9QCC5jtFfXs6kIpxOw3OEvAlK1w9vL/001YkT/ih1ncF0cmUfH3LJBJmNgvPGH6NpPxK6qTnB5yutkxdGfKlN0PFbIig2GXeA7NJkypnwX2ZsiOYs1mWDcMiDlPHCTx+CdEmynMDfTdP6/FJ5qDgDvoW1zbsemuhWNKyN5H5EU/2j/eb8jmwN/cS7sPysvduNg+MWORnz3A5TKy8NOGC0QIU1eZoxgkzNauJY4LM04+WWVMtUJEUlz0fF5VPeHfcoIrDqEvMQD2ZF6u0S2FnfUUDei/FC1sRL2eevpM9TSjoTKPx/v2e9a8Nl9K+ZYV27fx5cExL4Lms9SUPKcuIwB1ryjuxRsI=
- Arc-seal: i=1; a=rsa-sha256; d=math.u-bordeaux.fr; s=openarc; t=1708102867; cv=none; b=mOj90pcBl8idpefV53E8xF2CaWsyd49qcWRlno6JTRUPGDkTAZxQtdnUrfHh1Jc57HmRC+QbGwXAAvolb86WxxbTbJ5/4YI6Y0feS6TvAc6WKgp0UIMJBQTYwVe6nhYbNW7uPBiPb0Wf7SJhWobnrCa78ehExoeveGdmpLJL19FGZif15p6w1Q/c4XdkP6FNzabq4hejqXXfHxvnt0Qu2X4oi7qbIq2BkWAX3/hEOcsaCb7wmhDP0oIC95Q1WWgjJL5mcRLlU3M5gaeWmLoRvOTLuTWpRLk3U9hRVn6OKGjnWbPyxgQ+7bUhemKbYmQOoQMHhTetr+DGxiBqOV2WnyH96H2R33ULgZ6IV99VflwbpJkYzeGHSjUnQjApWypnx6G8OjHOqjAjLVHxxg0Dw6H/MMG6uUCG1ulfARSy5o4KrirkN64U3TCskkRDmUYB84uHa3iiFNG2pVurB5q1c87QoF4ZnYMViBhejzb9IcFdyc6zhUGE8QKWMV9zkH6f8zspP9DYi2eE87c1AWQFTRpQ6muIL0206R6EWpA3edEcDuOB61g/Ssb9mafKM711LxdKMT5XhCQr2IxIzmZoREw/zz7zfqdy0wTAMoYCg0Xugey3d1a2mWx9u06m9BC2+A/g1PrwzbNGXTFVBziKfGKDH+g2NZi5YU9pLzuAuIg=
- Authentication-results: smail; dmarc=none header.from=math.u-bordeaux.fr
- Authentication-results: smail; arc=none
- Cc: pari-users@pari.math.u-bordeaux.fr
- Delivery-date: Fri, 16 Feb 2024 18:01:52 +0100
- Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=math.u-bordeaux.fr; s=2022; t=1708102867; bh=I7iKGumfuAJPDjpV5fiQ2/9TTbti6k7X1WODD1DxpdE=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=bS8bZR+LseronLsvaC8J8gGviNTtQ5E5BXsyBIsFUDRZuu0fL2n5EHV3Xu7cPjAFq +ziJHm92q1PeOK1Q6fegh5vAFbmtLUGtnzxUtxSoTr6K1cK5uO/6lkn+PyeJf4iiI1 A6rz8S3XCYCWpjS0ttARMfI1sAh7qr0Oe3/lR++jfgj3tGVSE6DEFfPQx4d4gFqv3a /JLABOm+WVBcwJZ4OJBwgh+UuSdxln8SYNldA6zLSHAC04XAM0i1pNMqenBgLB7Dj1 Bl0ac3JA1dyvvnClABiXZvxN9Y9S3E7ekgpStatk1AcJVXTXG3nwPuykyaXkHsw3IX KSg8lF6fBppPXZjXsrfaj4UG49feHneM0/BSBKk8Htunfhf7ZrtaS5DmlrQpGelire y46i2PCmHbjEfW5kkERP2BcaeLrGAySS4/G9OnQWr9412riJhT8MaVTtdmgB/aSoNu TSPYD9g4lEtchjJByt2f2eHM/wVBAaFWRYa2Mo1psfNmYKE7axmP74fy9POfORpyLy /q2yfKCcqAaCPtEf8Un4imfUh10vy8X5F0+1FNE2QCtgGssopdheedEB1yPnN5+Q2M 3tP3DgGFXTsV0TNF9/Tx7EjjQRWHgwd1thbayyrMclzFkYNjf7+Yc2MvnbS50XAW/s fNNIWVc3uempWOkN13tKUn7Q=
- In-reply-to: <CAJkPp5PGsgD7mFcx=o4MPneBGpOJNWEE5wVApSvS+GkJ=5BL7Q@mail.gmail.com>
- Mail-followup-to: Max Alekseyev <maxale@gmail.com>, pari-users@pari.math.u-bordeaux.fr
- References: <CAJkPp5PGsgD7mFcx=o4MPneBGpOJNWEE5wVApSvS+GkJ=5BL7Q@mail.gmail.com>
* Max Alekseyev [2024-02-16 17:11]:
> Please take a look at this example:
>
> ? r = ffprimroot(ffgen([3,5]))
> %1 = 2*x^4 + 2*x^3 + x^2 + x + 2
> ? type(r)
> %2 = "t_FFELT"
> ? f = Pol(r)
> %3 = 2*x^4 + 2*x^3 + x^2 + x + 2
> ? type(f)
> %4 = "t_POL"
> ? print(f)
> (2*x^4 + 2*x^3 + x^2 + x + 2)
>
> Why are there parentheses around the polynomial f when it's printed?
Because the operation Pol(r) didn't do what you expected: you omitted
the variable in the call to Pol(), but this is equivalent to Pol(r, 'x)
['x by default ] and it produces the constant polynomial r * 'x^0 (if
the default 'simplify' is on, this simplifies to r in %1, but it's
apparently off in your session).
Note that even though r apparently involves many "x" when printed, it
doesn't actually contain a free variable. And that printed "x" has nothing to
do with the 'x variable, it's only used for printing your t_FFELT, and
can (should) be specified as an optional argument to ffgen() [again
"x" by default]
This allows to use t_FFELT without worrying about variable priorities.
You can actually have a polynomial in 'x whose coefficients are t_FFELT
elements written in terms of "x" and this will work; this will certainly
be confusing though, so don't do that !
What you probably intended is r.pol. Beware that now, the result becomes a true
polynomial in variable 'x.
Cheers,
K.B.
--
Pr. Karim Belabas, U. Bordeaux, Vice-président en charge du Numérique
Institut de Mathématiques de Bordeaux UMR 5251 - (+33) 05 40 00 29 77
http://www.math.u-bordeaux.fr/~kbelabas/