Bill Allombert on Sun, 11 Feb 2024 13:31:32 +0100
|
[Date Prev] [Date Next] [Thread Prev] [Thread Next] [Date Index] [Thread Index]
- To: pari-users@pari.math.u-bordeaux.fr
- Subject: Re: GP cross product?
- From: Bill Allombert <Bill.Allombert@math.u-bordeaux.fr>
- Date: Sun, 11 Feb 2024 13:31:15 +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=1707654677; c=relaxed/relaxed; bh=+eTs32DJXf2UEx4tA87JwvrJF+IZDurjpunhKa0Xu/I=; h=DKIM-Signature:Date:From:To:Subject:Message-ID:Mail-Followup-To: References:MIME-Version:Content-Type:Content-Disposition: In-Reply-To; b=P6+fwUawLMg6WPy8hbn4PmVCmyrO9e2Fpg4a/Rj+yzcyVIUdMnj2j7ZZ9EHcjwUqkgYqNHYOSWoGwruktT3V0w5youlFbYTUojVtGhaFtslK+RVn7R7mtO1JR7Iw5UZMEFbrl6xSBwljyUlYgjHg0tTdDF7t/89pfpzLEmsSiF7EP5Zuj3u2aAovJHi/+rM8IcnbWYs8tCkY3JQ5xErXaaIEIk0xv4Eo+BRj9KqQc1+nxl+ch9eOOHXflALWbfVjGirlMseTvknZcMH0hkK2O3Q2ASzXswD6bD+4jp5Q5msLYkuP6vZn5VRisrOT+njveolmy2Q8yNfl+3+sH85W8hFwpSPtGJX3JkSJ7y14UdHkCXtlIi7bsCK4ZjbDEFaXXKnefognrWesDg27Ss/L+KbPbdE4HIMV0IdZVM/YIxtwi6dp+bLKi4xdIVIwEpoI7BTn7wOQv2IergKY6LPc4kKzgdr33F0Xq+0mhSRxYG+xQRAWuLls8DiqepNzS045F4jhfwKovZmcPKbReopvUoxilbuteZSQaB3HpWzzhNP7YEALS9qpBlqQXjHOrmYI4UnN8oZT7YwOuiq+S5v0KZVV2unz1XxI00qAGDMzmQDnm0M+RCZbtiRSJJRjE+mCOu91GpNGud/UM21+PDCgDx/K6okTiwHn5ap59Cxvn8Y=
- Arc-seal: i=1; a=rsa-sha256; d=math.u-bordeaux.fr; s=openarc; t=1707654677; cv=none; b=vREg9g5cHi0q1SdxOteKPkIegHJtqCzS+m5EdFSfwoZNnQJ1X6mIKMspnUHV8otwNiByP34UMHGKGMGHUOZkGBTGU8idK0U09E45v5MWhsoccP9ePPPaUXI5VOTba9AuNDTJlNSDiZFi0cl84r6JuE62nkBlnWYrLYGPAcixsG17ynSTL8UYXgMn2S6euwiuw/qhvsgjRfo60KsYCXj/JVbezBwQQX+vBws6IhehoGWoeXbbcsze8X4Cw7/zBYewJWjIQwT5L+RN82cjg4pRAtiecVcjKw47WF5gPrXqGR+rtFWWIlx02t4BILs66mheBbI3MQ3VcGWk5DnsiBL3zWTACdvx4jhi7lhZikF4T2JnyfZ7OxfBoZKXe9mxvQsVa17a8xYZIFS8lLUaZp/gidpwcrygH/CERs/IDNA+0n07C+YCHNWi+7dPh2lAD9/TVW8GJUkdHgTU3MstvcfusPqE4/wsI1fZbDm+uAengPQtJzxmf/j2FwkrnF9hv2DldEDNnw3jD4SLUR8s/qMdWnmRbgsDmD3urkBT4CfRbrUsFLRETaU8ilfitMuksBLmET1Z6SoytxmG4IyVad10zmLSCiqO1jG6o0VSXxjobvyGeeQNkUYIAL5QR6Dqj0y4iBTm+UpGEaF5tKputj14yQV/a0oxhdSkVA15/06CQk4=
- Authentication-results: smail; dmarc=none header.from=math.u-bordeaux.fr
- Authentication-results: smail; arc=none
- Delivery-date: Sun, 11 Feb 2024 13:31:32 +0100
- Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=math.u-bordeaux.fr; s=2022; t=1707654677; bh=+eTs32DJXf2UEx4tA87JwvrJF+IZDurjpunhKa0Xu/I=; h=Date:From:To:Subject:References:In-Reply-To:From; b=O4oDSskysAKv4vLVIV6Mq8YJGfM2TO1Jjx/6C34Gc0uez+FaX1uW9uiT2vfKu48pB CuJkRnXQHeQCjlNCsuailsRF1ep55Lv7H+1/s4cFopkQtHtuTilLyEiTecoJxF1PpD yuFY7HHcKzeB0Qd3zk4iu3+PjKUI1vwYinBWdNBCoesKIgipcQe1pCRbZBA4oDV6+/ 7cwtqrFhWZrfyqhMW09az5ehMQ//qZ5zQNiE3jlN48wPtSJR0yoYvQvpMhdJ+qNLM1 jYpAKtLGyYDTIdJ9ZhehVRDYqHLyV4fU+Lw9lUVkZzLIPdzLCHSWFD1odZhtd1KNGD XacjtDTrlUVP2HDq/lEpr6ANPG/yLSiaWm4XLqK6T3Yqd1C2HbKZBOSZpJQYImP7EZ uhvhWTXVGMnwA1as5C1dkSD4gjXr6v1EoyUt1v5KpDMiW1pSqFeYhdU+X3sJO1peoJ ubiXfnS/LTjS2EljWSKUqakDwZs13JCqo4t+kMUMRFbzh/Oz/9L8xobXiwZHJ/c3kv x8lLLYKGA/Fu7G9PHujmYoM799NebgcZEcmxQiWBOc7/Z5F/kwcxEI9vXoNk7z7x5N wAAApknodL+YzZHfVe5IPGDrUm1nikjVmb9lMeux4NdldP4bsaGc0H6LnUQjU0cTCx bYjMSPI0oFbiJwJFc7bBRLm8=
- In-reply-to: <d9b3b2c5efae3387b159acbcd0c17fb0@stamm-wilbrandt.de>
- Mail-followup-to: pari-users@pari.math.u-bordeaux.fr
- References: <d9b3b2c5efae3387b159acbcd0c17fb0@stamm-wilbrandt.de>
On Sun, Feb 11, 2024 at 01:44:24AM +0100, hermann@stamm-wilbrandt.de wrote:
> I searched for "cross" and "vector product" in GP user's guide and found
> nothing.
> I searched mailing lists unsuccessfully as well.
Yes, the cross product almost never occur in number theory.
> Then by Wikipedia definition perhaps simpler:
>
> ?
> cross=(a,b)->[a[2]*b[3]-a[3]*b[2],a[3]*b[1]-a[1]*b[3],a[1]*b[2]-a[2]*b[1]];
Yes this is probably the best.
> First I came up with this:
>
> ? cross=(a,b)->{m=matdet(Mat([[i,j,k]~,a~,b~]));[polcoef(m,1,i),polcoef(m,1,j),polcoef(m,1,k)]};
Just for the record, never use polynomial unknowns for linear algebra.
Instead just compute the values over a basis.
Here you have a linear map
(i,j,k) -> matdet(Mat([[i,j,k]~,a~,b~])) = C[1]*i+C[2]*j+C[3]*k
Just compute the values over the basis (1,0,0) (0,1,0), (0,0,1).
cross(a,b)=[matdet(Mat([[1,0,0]~,a~,b~])),matdet(Mat([[0,1,0]~,a~,b~])),matdet(Mat([[0,0,1]~,a~,b~]))];
a=[a1,a2,a3];b=[b1,b2,b3];
cross(a,b)=[matdet(Mat([[1,0,0]~,a~,b~])),matdet(Mat([[0,1,0]~,a~,b~])),matdet(Mat([[0,0,1]~,a~,b~]))];
cross1(a,b)={m=matdet(Mat([[i,j,k]~,a~,b~]));[polcoef(m,1,i),polcoef(m,1,j),polcoef(m,1,k)]};
cross2(a,b)=[a[2]*b[3]-a[3]*b[2],a[3]*b[1]-a[1]*b[3],a[1]*b[2]-a[2]*b[1]];
cross(a,b)
cross1(a,b)
cross2(a,b)
%5 = [b3*a2-b2*a3,-b3*a1+b1*a3,b2*a1-b1*a2]
%6 = [b3*a2-b2*a3,-b3*a1+b1*a3,b2*a1-b1*a2]
%7 = [b3*a2-b2*a3,-b3*a1+b1*a3,b2*a1-b1*a2]
Good!
Cheers,
Bill