Karim Belabas on Sat, 19 Nov 2022 22:00:32 +0100
|
[Date Prev] [Date Next] [Thread Prev] [Thread Next] [Date Index] [Thread Index]
Re: [proposal] forvec over cyc
|
- To: Pascal Molin <molin@math.univ-paris-diderot.fr>
- Subject: Re: [proposal] forvec over cyc
- From: Karim Belabas <Karim.Belabas@math.u-bordeaux.fr>
- Date: Sat, 19 Nov 2022 21:59:12 +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=1668891551; c=relaxed/relaxed; bh=EwccJYLe/kD1XN3beilDN6IbS/B8pfLf6u1ncnXHrA8=; 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=gtZ5IC2nFXodqcFwZZRCrzZAz7Z+I/fmzAONpW5cbfjNV5RMb1ANWiVoXqX+qwdglXUw0z+drEETqTXdDXRcQTYGJPJD1KFb4IOdet7aLbNrz/d0yR8VlBfk6Cp7bpihiycPIdII6rrXmNl1AFu2N71j0C+X5OMwKrAGPz0t1RBe/nHJdtWNMAxwuQvJGc4eJUixtxlfZnd1Nbb5BmGhXDV5TCKiBEqj4CH4jm/+TSafPmvhUWIcl/Uzkis08HxGtSltiyeSysGhkOIWZgNgOfQwjlnLSKeuz+pCf2cFblXc5j6lMOjLrJRNlGvIT1CrG1Q7j45Jdv76XIULNvYknJu1OqpMXkqvdoC6Iq+IVZpkEWCQQT6jaT9GyxOsa3VWfpRyuytoIhNiRrgtwjQA8KwWTZASNMRrLcDMWjn/mky7EBP7H37aQFWsTocYn1T0fulru6uc0eKGAouFZBcD24KXP7gvRqx/G5H3+y0soP7rmAgBRDG3aw13X514yjgeh/BzknvDKL1V432VzMO0qBiP5Veos4cGd651thCM9VcyF3NNWRqpS3STBxSq2Nh0qGs419myFmW7XtGle9D+vRGrCo2+MCL4MclJ7dr8zqZupv5I7Ur+JrWAswKY8F4bs4qCN0XwB0Ou7WxW/QznvXXAAQ+EWAz9jqN4iUnwTks=
- Arc-seal: i=1; a=rsa-sha256; d=math.u-bordeaux.fr; s=openarc; t=1668891551; cv=none; b=z4tLSpGEs8tKluVjUKdoP6mgMAvQugTGFpZFVmoR8qxBPZo7JFjAPRqumt75qhHZbgbjJcp9B0gy9GTYOusroCX6M4OKCXMIlZcHcTELYUL0aT2gNA2FnfHFf+zw5QaGXM3ZvL0CHdXclnWCPmP3s4LI0SJo+drAMt6fQjo340jctSJFx8CrkEPv2J2FlLTpsf1li7brbeGKZcqzYh1AY6XTEAP0qgP1pGbUFci2IvJx/m/gotlmHBKRlMMhAPgOAWElvTnTBNV25fSeDYIThAaK32FE4duX6C69Km/jh52qKxuZLwA+HmBcV8zzpEY/dy3mI98NRGs31vdL7GA3scXIdKki6f7ueVLKxyBlUjU37zgRhaNbA/YfpTwHe1GA/FjzlWaY0ffkJhlgWs65RtrpInVmN/YlHDo7BqCiZ0eT6wwWuh8eGH6ZHsSdCcR0OcMkdq7KLcru4lGFmQ3kLEPEWtvHoJjq4BRAX/euQtVolKqOOM1W3XhoOp9Da1pQ8J8yqbQJJcfYIhfwkG50Zw2jN8mfWaFxnX+bSxvrOX5D6yb38wslBjZBsqarep0WR0T9vt4ZIt1lz27vvYpEJUROZJbhn9AhMop8ubmdfrb7BXSIMDV0RESlYFN9wF41iFGgw9GJrDTE/fUlqnXzgRX4B3oWfn8Dn0JKIumTyOU=
- Authentication-results: smail; arc=none
- Cc: pari-dev@pari.math.u-bordeaux.fr
- Delivery-date: Sat, 19 Nov 2022 22:00:32 +0100
- Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=math.u-bordeaux.fr; s=2022; t=1668891551; bh=EwccJYLe/kD1XN3beilDN6IbS/B8pfLf6u1ncnXHrA8=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=jNMcFQ5AHP+0IUresDCevqRL2lkcxBQSdn/8XqykkqhOHZeo9bT1Nl2p3iy8WvOb5 ki1Q9qxmavPkQ11Lx/lzERiix5NA8vZoSIQitoaap4aqehQcHZIH65r3LTl0CffBO1 irGLfKRtOA/3EUca5w4aJgBzkp1aCRlTYPsakPmc/kRYoQ8OCSk50LXlhgPdFfDLHK gR9FfHmB2pJh2GpZ49Nrv/qoQVcWQNfEhuxGYbzDxOArEQl6hDLcBPLFz1hO5DHPAF 2ndGGDt3takHgCqSbsRoDV1Udmp9FzhKfzZPJxAxMzWWMgcfWZRcbw9aE3D3d5ahat wRldPDrS7Z0+iwDYVRE6AiMLNBJH2m8ic2k1bw9Mvx7kCvb6JCDmuNkI4ZImRlCMnd ujNmDe6/R4i8LhrgaoNcNYwaLZL1Dw8tewPgxG36s8pYyCEHiQRhKUZg/Uhw3E+0dR a7FDPVvknlcC2wnOQ433f80Z/ifpIvCLp8KgDr3iTteAMlpCXn+hXTz50SetW7pO0v uTqMouVsmV4l8J8N25UwDBof+nSJSFmJs/4KqR16uHHdP33+QjEsyntN1/I1hyw+7G kLO/X61f1VWzJbQSIrzVhSPO8aImx8lm459Uv3K6n2kiEuxuuiygE5hagx1bfdDayl k1q8HsBPwZUjWCm+oNm/KxrM=
- In-reply-to: <CAAuMLA=rmMeoeTsYNCW_vMdGmFBNw+uBE4pvGHkWenu2uTbfVw@mail.gmail.com>
- Mail-followup-to: Pascal Molin <molin@math.univ-paris-diderot.fr>, pari-dev@pari.math.u-bordeaux.fr
- References: <CAAuMLA=rmMeoeTsYNCW_vMdGmFBNw+uBE4pvGHkWenu2uTbfVw@mail.gmail.com>
Thanks for the pull request. Merged to master. :-)
Cheers,
K.B.
* Pascal Molin [2022-11-14 14:00]:
> Dear Pari devs,
>
> I consider the forvec loop one of the top features of GP programming:
> really useful, and painful to write.
> Still:
> - I find myself writing quite a lot forvec(x=vector(#c,i,[0,c[i]-1]), ... )
> - I also need to iterate over the lattice Z^n
>
> I propose to improve on these two aspects by extending forvec with the
> following additional syntax: if if cyc is a vector of nonnegative integers,
> forvec(x=cyc, ) would iterate on representatives of Z^n/cyc Z^n.
>
> In particular, if c has positive entries, forvec(x=c, ...) is a shortcut
> for the former forvec(x=vector(#c,i,[0,c[i]-1]), ... )
> And if c=[0,0..0], it would loop on Z^n. A choice has to be made on the
> ordering used, I consider the consider lexicographic ordering graded by
> L^1-norm.
>
> Specifically, for n = 3, the loop forvec(x=[0,0,0],print(x)) gives
> [0, 0, 0]
> [-1, 0, 0]
> [0, -1, 0]
> [0, 0, -1]
> [0, 0, 1]
> [0, 1, 0]
> [1, 0, 0]
> [-2, 0, 0]
> [-1, -1, 0]
> [-1, 0, -1]
> ...
> (the loop is infinite)
>
> Finally, if c is a mixed vector of zero and positive values, forvec(x=c, )
> does what I think the most useful : loop on graded-lex elements, with
> torsion components having L1 weight 0 (so one always iterates over torsion
> elements before moving to the next lattice element).
>
> So that forvec(x=[2,0],print(x)) gives
> [0, 0]
> [1, 0]
> [0, -1]
> [1, -1]
> [0, 1]
> [1, 1]
> [0, -2]
> [1, -2]
> [0, 2]
> [1, 2]
> ...
>
> I made a branch pascal-forvec-cyc which adds this syntax.
> I used it myself for some time, if this sounds useful for others and
> reasonable for gp syntax I would be happy to have it merged.
>
> Remark: I did not implement flags, one I could think of is to iterate on
> centerlifts of the quotient.
>
> Pascal
K.B.
--
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/
`