We study trace codes with defining set $L,$ a subgroup of the multiplicative group of an extension of degree $m$ of the alphabet ring $\mathbb{ F}_3+u\mathbb{ F}_3+u^{ 2}\mathbb{ F}_{ 3},$ with $u^{ 3}=1.$ These codes are abelian, and their ternary images are quasi-cyclic of co-index three (a.k.a. cubic codes). Their Lee weight distributions are computed by using Gauss sums. These codes have three nonzero weights when $m$ is singly-even and $|L|=\frac{ 3^{ 3m}-3^{ 2m}}{ 2}.$ When $m$ is odd, and $|L|=\frac{ 3^{ 3m}-3^{ 2m}}{ 2}$, or $|L|={ 3^{ 3m}-3^{ 2m}}$ and $m$ is a positive integer, we obtain two new infinite families of two-weight codes which are optimal. Applications of the image codes to secret sharing schemes are also given.
Categories: cs.IT math.IT