Feature #723
Referring to indets with multiple indices from a polyring
Description
I would like to be able to refer to multi-index indets in a poly ring using their multiple indices... where the ring has been passed in as a parameter.
Related issues
History
#1 Updated by John Abbott about 9 years ago
Here is an example I want to run (NB it is very slow)
p := 3; n := 3; use ZZ/(p)[s[1..n,1..n,1..n]]; define MortenPolyList(n) TopLevel s; PolyList := []; for i := 1 to n do for j := 1 to n do for k := 1 to n do for m := 1 to n do f := sum([s[i,j,l]*s[l,k,m] - s[j,k,l]*s[i,l,m] | l in 1..n]); append(ref PolyList, f); endfor; endfor; endfor; endfor; return PolyList; enddefine; -- MortenPolyList L := MortenPolyList(n); solns := RationalSolve(L);
Note that I have "uncleanly" used TopLevel s;
inside the function. What I wanted to do was pass in the poly ring as an argument (or have the function create the poly ring). But then how do I write the rest of the function neatly using the triple-indexed indets?
PS if we get this right then we're far neater than GAP >-}
#2 Updated by John Abbott about 9 years ago
The existing function indets("s")
almost does what I want except that the result is a list rather than an INTMAP
. For my example, I need a version which produces an INTMAP
.
I do have some doubts about "clean" this proposal is. Suppose we changed indets("s")
to produce what I want... Then a program indexing into the result presupposes a certain arity for the indices; and not only the arity, but also that the available valid tuples of indices are also "suitable". These are quite strong suppositions, but certainly reasonable if the ring has been created inside the function; they are possibly also reasonable for not-very-public functions where we can be fairly sure the caller won't do anything silly.
Opinions? Suggestions? Other ideas?
#3 Updated by Anna Maria Bigatti about 9 years ago
Is this what you want? (From the manual ;-)
/**/ S ::= QQ[x,y,z[1..4,3..7]]; /**/ 7*RingElem(S, ["z",2,5]); 7*z[2,5]
#4 Updated by John Abbott about 9 years ago
Yes and no. I thought the topic had come up recently, but did not find it on redmine.
Perhaps the manual page for indets
should include a reference to an example like yours.
What I do not like about your example is that it is cumbersome -- it is not so easy to read an expression containing RingElem(S, ["z",1,2])
certainly compared to z[1,2]
. My example above beats GAP exactly because it is so simple and clear.
I would definitely prefer something like:
S ::= QQ[x,y,z[1..4,3..7]]; z := IndetIndexer(S,"z"); // yes, this is a bit ugly 7*z[1,2];
We would also need a good name (instead of IndetIndexer
). Since we have already defined the type INTMAP
is seems a shame not to make it more accessible...
#5 Updated by John Abbott almost 6 years ago
The example comment 1 gives ERROR: Value must be non-zero
when calling RationalSolve
. This cannot be right!
#6 Updated by John Abbott almost 6 years ago
- Related to Bug #1215: RationalSolve: gives "Error: must be non-zero" added
#7 Updated by John Abbott over 3 years ago
- Related to Feature #1469: Get indexed indets from a polyring added
#8 Updated by John Abbott over 3 years ago
- Target version changed from CoCoA-5.?.? to CoCoA-5.4.2
#9 Updated by John Abbott over 3 years ago
The example in comment 2 is slow because it takes along time to test IsZeroDim
i.e. compute a GB.
I stopped the GB calc after 6500 elems in the partial GB.