CoCoA-5: Issueshttps://cocoa.dima.unige.it/redmine/https://cocoa.dima.unige.it/redmine/redmine/favicon.ico?15088260392023-07-03T16:13:29ZCoCoA Project
Redmine Support #1751 (In Progress): Manual of functions vs ManExampleshttps://cocoa.dima.unige.it/redmine/issues/17512023-07-03T16:13:29ZAnna Maria Bigatti
<p>In the manual we have things like these:<br /><pre>
/**/ define fn(X)
/**/ assert(X > 0);
/**/ return FloorSqrt(X);
/**/ enddefine;
</pre><br />so that ManExamples can extract the input code.<br />Should we have something like<br /><pre>
---- function definition ----
define fn(X)
assert(X > 0);
return FloorSqrt(X);
enddefine;
-----------------------------
</pre><br />(and the same for package) so that the manual looks more natural? (and with coloured syntax!)</p> Bug #1639 (New): RealRoots: crashes after interruptinghttps://cocoa.dima.unige.it/redmine/issues/16392021-12-07T16:49:17ZJohn Abbott
<p>Naturally I discovered this while giving a demo to my students...</p>
<pre>
/**/ use QQ[x,y,z];
/**/ f := product([x-k | k in 0..1000]);
/**/ RR:=RealRoots(f);
C-c C-c***ERROR*** UNCAUGHT UNKNOWN EXCEPTION
Process cocoa5 exited abnormally with code 1
</pre> Bug #1593 (New): CanonicalHomhttps://cocoa.dima.unige.it/redmine/issues/15932021-05-07T06:20:13ZJulian Danner
<p>Hi,</p>
<p>I was just playing around with the function <code>PolyAlgebraHom</code> and noticed that there is a weird behavior when working with an affine algebra over an extension field. In particular I constructed the following algebra:<br /><pre><code> use QQi_::=QQ[i];
Qi := QQi_/ideal(i^2+1);
use P::=Qi[x];
I:=ideal(x^2+x+1);
A:=P/I;
Kt := NewPolyRing(Qi, "t");
</code></pre></p>
<p>Now I want the hom phi: K[t] -> A given by phi(t)=x+I. The straightforward implementation <br /><pre><code> phi:=PolyAlgebraHom(Kt, A, "x");
</code></pre>however gives an error (<code>Unable to construct canonical homomorphism.</code>).<br />(Might it be fixed by just replacing some call to <code>CanonicalHom</code> with <code>ChainCanonicalHom</code>?<br />In general I do not quite see as to why there even is the function <code>CanonicalHom</code>, since <code>ChainCanonicalHom</code> can do the same, but kind of better.)</p>
<p>Anyway, as a workaround, one can construct phi as follows:<br /><pre><code> eps := QuotientingHom(A);
phi_:= PolyAlgebraHom(Kt, P, "x");
phi := eps(phi_);
</code></pre><br />But it would be a lot better if the 'obvious' implementation would just work as expected. (In particular it does for the 'standard' fields <code>QQ</code> and <code>ZZ/(p)</code>.)</p> Support #1586 (In Progress): Profiling with clanghttps://cocoa.dima.unige.it/redmine/issues/15862021-04-02T07:28:49ZAnna Maria Bigatti
<p>pg does not work.</p>
<pre>
clang: error: the clang compiler does not support -pg option on versions of OS X 10.9 and later
</pre>
<p>How can I do?</p> Bug #1574 (New): ApproxSolveTFhttps://cocoa.dima.unige.it/redmine/issues/15742021-02-03T16:46:13ZJohn Abbott
<p><code>ApproxSolveTF</code> is not documented. Maybe that is a good thing...</p>
<pre>
use QQ[x,y,z];
D := 7;
N := 2^17;
L := [z^D - (N*z-1)^2, y*(z-1/N)-1, x^D - (y^2*x-1)^2];
Pts := ApproxSolveTF(L);
indent([[ FloatStr(coord) | coord in pt] | pt in Pts]);
[
["0.0000", "0.0000", "0.0000"],
["0.0000", "0.0000", "0.0000"],
["0.0000", "0.0000", "0.0000"],
["0.0000", "0.0000", "0.0000"],
["0.99998", "0.0089742", "111.43"],
["0.0000", "0.0000", "0.0000"],
["0.0000", "0.0000", "0.0000"]
]
</pre>
<p>I'm not quite sure what happened there. <code>ApproxSolve</code> can handle this (if I increase the internal precision enough): it finds these solutions:<br /><pre>
[
["8.7581*10^(-47)", "-1.0685*10^23", "0.0000076294"],
["8.7581*10^(-47)", "-1.0685*10^23", "0.0000076294"],
["8.7581*10^(-47)", "1.0685*10^23", "0.0000076294"],
["8.7581*10^(-47)", "1.0685*10^23", "0.0000076294"],
["0.99998", "0.0089742", "111.43"],
["2.6487*10^18", "1.0685*10^23", "0.0000076294"],
["2.6487*10^18", "-1.0685*10^23", "0.0000076294"]
]
</pre></p> Bug #1552 (New): subst: not checking args properlyhttps://cocoa.dima.unige.it/redmine/issues/15522020-12-13T16:13:53ZJohn Abbott
<p>The following shows that <code>subst</code> can behave wrongly:<br /><pre>
use QQ[x];
f := x;
use ZZ/(2)[x];
subst(f,x,x+2); --> NO ERROR !?!?
</pre></p>
<p>The call to <code>subst</code> should produce an error because <code>x</code> belongs to a different ring from <code>f</code>.<br />For instance <code>subst(f,x,x+1)</code> <strong>does</strong> produce an error.</p>
<p>Rectify.</p> Feature #1304 (New): Hermite normal formhttps://cocoa.dima.unige.it/redmine/issues/13042019-08-29T12:43:59ZFlorian Walsh
<p>I created a prototype implementation for computing the Hermite normal form and for solving linear systems over the integers.<br />So far it only works for the ring of integers. It doesn't work for polynomial rings yet.</p> Slug #1229 (New): append is slowhttps://cocoa.dima.unige.it/redmine/issues/12292018-10-05T15:44:24ZJohn Abbott
<p>Creating a long list by calling <code>append</code> in a loop has run-time quadratic in the final list length.</p> Support #1175 (New): intersectionhttps://cocoa.dima.unige.it/redmine/issues/11752018-04-05T07:29:18ZElisa Palezzatopalezzato@dima.unige.it
<p>The intersection of MODULEs need to be exported.</p> Feature #770 (New): CoCoA type "cone"https://cocoa.dima.unige.it/redmine/issues/7702015-09-03T15:00:03ZAnna Maria Bigatti
<p>Make the type cone for CoCoA (when class cone is defined for CoCoALib)</p> Feature #633 (New): New operations? ScalarProduct(MODULELEM,LIST), MATRIX * MODULELEMhttps://cocoa.dima.unige.it/redmine/issues/6332014-10-14T11:05:36ZAnna Maria Bigatti
<p>I think that ScalarProduct(MODULELEM,LIST) is OK<br />but MATRIX * MODULELEM may be ambiguous (row or col?)<br />For sure we should add examples to the manual</p> Feature #453 (In Progress): Automatic conversion from INT (or RAT) to RINGELEMhttps://cocoa.dima.unige.it/redmine/issues/4532014-03-03T16:00:48ZJohn Abbott
<p>C5 does not allow computing <code>GenRepr(1, I)</code> because it wants a <code>RINGELEM</code> where I supplied the value <code>1</code> which has type <code>INT</code>.</p>
<p>I note that <code>1 IsIn I</code> is accepted -- this is inconsistent!</p>
<p>I'm sure these comments apply to several other fns too.</p> Bug #422 (New): Bug or feature for protected name? (Use command)https://cocoa.dima.unige.it/redmine/issues/4222014-01-06T23:35:07ZJohn Abbott
<p>From email of 2010-11-19</p>
<p>Is this the behaviour we want?<br /><pre>
Use A ::= QQ[P,Q,R];
Use R ::= QQ[x,y]; --> Gives error because R is protected.
</pre></p>
<p>JAA thinks this is a bug, but it is probably not very serious (how often would one use the same name for an indet in once ring, and then for the next ring?)</p>
<p>It is easy to work around: just execute <code>Use QQ;</code> in between!</p> Feature #421 (New): Allow user to give a name to a ring (in C5)https://cocoa.dima.unige.it/redmine/issues/4212014-01-06T23:26:30ZJohn Abbott
<p>In C4 the command <code>R ::= QQ[x,y];</code> automatically gave the name <code>R</code> to the created ring.<br />There was a <em>trick</em> to cater for several successive rings each called <code>R</code>, namely the name changed to <code>R#1</code>, <code>R#2</code> and so on.</p>
<p>Users should be allowed to specify (convenient) names for rings they create.<br />It does seem difficult to emulate the behaviour of C4, and I'm not sure we should even try to do so.<br />Perhaps there should be a new syntax? for instance <code>R :::= QQ[x,y];</code><br />Or maybe simply <code>R ::= QQ[x,y],printname="blah";</code></p> Slug #230 (New): More curiously slow code -- squaring a polynomialhttps://cocoa.dima.unige.it/redmine/issues/2302012-09-21T12:22:14ZJohn Abbott
<p>The function <code>SquaredPoly</code> should be of quadratic complexity, so doubling the degree should increase computation by about a factor of 4. Instead the time increases by a rather larger factor. Here is some sample code:<br /><pre>
Define SquaredPoly(V)
L := Len(V);
If Len(V) = 0 Then Return V; EndIf;
N := 0;
For I := L To 1 Step -1 Do If V[I] <> 0 Then N := I; Break; EndIf; EndFor;
If N = 0 Then Return [0]; EndIf;
N := N-1;
Q := NewList(2*N+1, 0);
For I := 0 To N-1
Do For J := I+1 To N
Do Q[I+J+1] := Q[I+J+1] + V[I+1]*V[J+1];
EndFor;
EndFor;
For I := 1 To 2*N+1 Do Q[I] := 2*Q[I]; EndFor;
For I := 0 To N Do Q[2*I+1] := Q[2*I+1] + V[I+1]^2; EndFor;
Return Q;
EndDefine;
Define L2F(L)
TopLevel x;
Return Sum([L[I]*x^(I-1) | I In 1..Len(L)]);
EndDefine; -- L2F
Define RndPoly(D)
TopLevel CurrentRing;
Return [Rand(-99,99)*one(CurrentRing) | I In 0..D];
EndDefine; -- RndPoly
Use ZZ/(29641)[x];
PolyDeg := 500;
NumberOfTests := 3;
PolyList := [RndPoly(PolyDeg*2^I) | I In 0..NumberOfTests-1];
For I := 1 To NumberOfTests Do
t0 := CpuTime();
S := SquaredPoly(PolyList[I]);
delta_t := DecimalStr(CpuTime()-t0);
PrintLn "SquaredPoly, polinomio ", I, ": ", delta_t;
F := L2F(PolyList[I]);
t0 := CpuTime();
S := F^2;
delta_t := DecimalStr(CpuTime()-t0);
PrintLn "Quadrato CoCoA, polinomio ", I, ": ", delta_t;
EndFor;
</pre></p>