  This paper studies the construction for quantum codes with parameters
$((n,K,d))_{p}$ by use of an \textit{n}-variable logic function with APC
distance $d'\ge 2$ over ${\rm {\mathbb F}}_{p} $, where $d$ is related to $d'$.
We obtain $d\le d'$ and the maximal $K$ for all $d=d'-k$, $0\le k\le d'-2$. We
also discuss the basic states and the equivalent conditions of saturating
quantum Singleton bound.
