Bill Allombert on Thu, 07 Dec 2023 20:09:35 +0100
|
[Date Prev] [Date Next] [Thread Prev] [Thread Next] [Date Index] [Thread Index]
Re: norml2() with variables in vector?
|
- To: pari-users@pari.math.u-bordeaux.fr
- Subject: Re: norml2() with variables in vector?
- From: Bill Allombert <Bill.Allombert@math.u-bordeaux.fr>
- Date: Thu, 7 Dec 2023 20:09:31 +0100
- Delivery-date: Thu, 07 Dec 2023 20:09:35 +0100
- Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=math.u-bordeaux.fr; s=2022; t=1701976173; bh=DU3IWpatNU+vj3UY+z6x3fl9ZxDIq0STUbBsc8SFpSI=; h=Date:From:To:Subject:References:In-Reply-To:From; b=HBebxcSu62jxSy9/3wRJk+QB1wVs2829Eb4/l2a16A1mv0wPWRbq60ogEv2lqG+Hi 6EYhudxmqB3Uk+22VqH1HceZjwBat8bH1l8c0XUka78ewPbN4PvPjOcXtPI+zgLJHr BEhtPJn5adGFrGjYihZ1mjfY9LVmBNMY+kOK2XuBlBBuLLDqypk9Cy3fzhTmpIqAL5 N4rZTUFSCrL4Ts/OBtUF7ViqJrV/245C3yqY3wthPQHmq0i8QMfRaFiDRY+hF2P1Ig jtq4r5uishI9PPVMaWO0GNQdPuGhL8gLgDumyoM2Yu9hIAcHfvT+oe3UvQ/iaiJtQv qh4ZifBYziZkV5LjV9gw28sw+WKa5K0f8wV1mQzRGF7c4iwFBFDn3lQIQ9I+paNaOi mnqGeYDvTGAieWRlHdZrFmHh7xkD0+XqbInpNKJ9lD9szoPs/s4O/wEImpD1WKNNeh frEEZc+MlpjIVb9ABBURKUoiTWoi9bdc9rztuVHzeJq4kcLXd/Ohc3KPdxCZFIfFkC eYMSV2ZfYDcGXlqhdYrhjkpFGKSk0GkHf18qMR7d3EaMHirxu/ILxcyGZ86JYxHvpo VUiu/6mkJEDmuV3in2IGI2wrMcVVU5J3A3YJABHsIWFHXCI8L2hNZRHP+n7d6l3r4S vq5KEioHHfsFhzH8LEt6b3Cs=
- In-reply-to: <f576702a1028b56c882fad15c01bcbb3@stamm-wilbrandt.de>
- Mail-followup-to: pari-users@pari.math.u-bordeaux.fr
- References: <f576702a1028b56c882fad15c01bcbb3@stamm-wilbrandt.de>
On Thu, Dec 07, 2023 at 07:54:14PM +0100, hermann@stamm-wilbrandt.de wrote:
> There is no constant term in "v[1]^2+v[2]^2+v[3]^2" below.
> How can it be that "norml2(v)" reports 417 ?
>
> $ gp -q
> ? G=[-102, -107, 93; 22, 23, -20; 1, 1, -1];
> ? v=G^-1*[a,b,c]~
> [3*a + (14*b - c), -2*a + (-9*b - 6*c), a + (5*b - 8*c)]~
> ? v[1]^2+v[2]^2+v[3]^2
> 14*a^2 + (130*b + 2*c)*a + (302*b^2 + 101*c^2)
> ? norml2(v)
> 417
You are victim of a strange PARI behaviour which is that some functions
are fully recursive so
norml2([a,b,c]) = norml2(a) + norml2(b) + norml2(c)
etc.
? (3^2+14^2+1^2)+(2^2+9^2+6^2)+(1^2+5^2+8^2)
%4 = 417
You probably want v~*v
? v~*v
%5 = 14*a^2+(130*b+2*c)*a+(302*b^2+101*c^2)
Cheers,
Bill