Let $k$ be a field or a commutative ring with unit and let $F:M_n(k)\to M_n(k)$ be a $k$-linear map. Suppose that $F$ is given in the form $F(X) = A_1XB_1 + \cdots + A_m X B_m$ for some $A_i,B_i\in M_n(k)$ (note that any $k$-linear $F$ can be written in this form, though not uniquely).

Is there a formula that allows one to determine $\mathrm{det}(F)$ (no pun intended) or $\mathrm{tr}(F)$ directly from the matrices $A_i, B_i$ ($1\leq i\leq m$), i.e. without having to compute a representation matrix of $F$?