Let $B$ be a finite dimensional algebra over a field $K$ with dimension $n$ over $K$. Sage can give us a $K$-basis of this algebra that we denote by $e_i$. Here is an example:
B = SymmetricGroup(4).algebra(QQ)
U=B.basis()
display(list(U))
The structure constants $c_{l,i,j} $ of the algebra $B$ are defined by the condition: $e_i e_j = \sum\limits_{l}^{}{c_{l,i,j} e_l }$. For a list $A=[a_1,...,a_n]$ with field elements $a_i$ define the $n \times n$-matrix $P_A$ by $(P_A)_{i,j}= \sum\limits_{l}^{}{c_{l,i,j} a_l }$.
Question: How can one obtain the $P_A$ with Sage and check whether there exists a list A such that $P_A$ has non-zero determinant?
The background of this question is that this is satisfied precisely when $B$ is a Frobenius algebra, see for example theorem 16.82 in the book "Lectures on Modules and Rings" by Lam.