GAP 4.8.9 installation with standard packages -- copy to your CoCalc project to get it
1\\ calculates the exponentsvectors of the fractional ideals 2\\ generated by elms corresponding to the prime ideals 3\\ arrissing in the factorization 4 5nf = nfinit(f); 6 7\\ factorize all ideals generated by the elements of a and collect all 8\\ primideals which occur 9primId=eval(Set(concat(vector(#elms-1,i,idealfactor(nf,Polrev(elms[i]))[,1])))); 10 11\\ write for every element in a the exponentfactor corresponding to the 12\\ ideals in primId in a row 13\\ so we will have a matrix 14mat = matrix(#elms-1,#primId,i,j,idealval(nf,Polrev(elms[i]),primId[j])); 15print("[ "); 16{ 17 for(i=1,matsize(mat)[1], 18 print(mat[i,],","); 19 ); 20 print("];"); 21} 22 23