Algebra using sage

Can anyone help in writing a code to find the list of idempotent and primitive elements of a group algebra, the examples goes like this. Let $$p$$ be an odd prime such that $$\bar2$$ generates $$U(\mathbf{Z}_{p^2})$$ and $$G=*$$ an abelian group, with $$o(a) = p^2$$ and $$o(b)=p$$. Then $$\mathbf{F_2}G$$ has four inequivalent minimal codes, namely, the ones generated by the idempotents $$e_0=\hat{G}$$, $$e_1=\hat{b}-\hat{*}$$(note: its a big hat), $$e_2=\hat{a}-\hat{G}$$ and $$e_3=\hat{*}-\hat{G}$$.