GAP 4.8.9 installation with standard packages -- copy to your CoCalc project to get it
#include"typedef.h"1#include"matrix.h"2/**************************************************************************\3@---------------------------------------------------------------------------4@---------------------------------------------------------------------------5@ FILE: kron_mat.c6@---------------------------------------------------------------------------7@---------------------------------------------------------------------------8@9\**************************************************************************/1011/**************************************************************************\12@---------------------------------------------------------------------------13@ matrix_TYP *kron_mat(A,B)14@ matrix_TYP *A, *B;15@16@ calculates the Kronecker product of the matrices A and B.17@---------------------------------------------------------------------------18@19\**************************************************************************/2021matrix_TYP *kron_mat(A,B)22matrix_TYP *A, *B;23{2425int i,j,k,l,r,c;26int rows, cols;27matrix_TYP *C;2829rows = A->rows *B->rows;30cols = A->cols *B->cols;31C = init_mat(rows,cols, "");32for(i=0; i<A->rows;i++)33for(j=0;j<A->cols;j++)34{35/* changed 15/4/97 tilman36r = i*A->rows; */37r = i*B->rows;38for(k=0;k<B->rows;k++)39{40/* changed 15/4/97 tilman41c = j*A->cols; */42c = j*B->cols;43for(l=0;l<B->cols;l++)44{45C->array.SZ[r][c] = A->array.SZ[i][j] * B->array.SZ[k][l];46c++;47}48r++;49}50}51return(C);52}535455