  A concise study of ternary and cubic algebras with $Z_3$ grading is
presented. We discuss some underlying ideas leading to the conclusion that the
discrete symmetry group of permutations of three objects, $S_3$, and its
abelian subgroup $Z_3$ may play an important role in quantum physics. We show
then how most of important algebras with $Z_2$ grading can be generalized with
ternary composition laws combined with a $Z_3$ grading.
  We investigate in particular a ternary, $Z_3$-graded generalization of the
Heisenberg algebra. It turns out that introducing a non-trivial cubic root of
unity, $j = e^{\frac{2 \pi i}{3}}$, one can define two types of creation
operators instead of one, accompanying the usual annihilation operator. The two
creation operators are non-hermitian, but they are mutually conjugate.
Together, the three operators form a ternary algebra, and some of their cubic
combinations generate the usual Heisenberg algebra.
  An analogue of Hamiltonian operator is constructed by analogy with the usual
harmonic oscillator, and some properties of its eigenfunctions are briefly
discussed.
