he paper considers the implementation of a finite quantum automaton, recognizing the unary language MOD_p using the qiskit library and the language python programming. We also present an optimization of the quantum schemes for implementing the distributed controlled algorithm rotation used in the implementation of the aforementioned quantum machine.