It seems to us that you are using some unoptimized functions for composition and reduction that we wrote mainly for experimenting. For example the reduce function in https://github.com/KZen-networks/class-groups/blob/master/src/lib.rs outputs the reduction matrix which is not needed for the encryption scheme. Using directly the gmul pari C function will probably be more efficient to compute composition of two forms followed by a reduction.
Basically - gmul should be used directly in compose function
based on remark from reviewers:
Basically -
gmul
should be used directly in compose function