  We propose an algorithm for calculating the determinant of a square matrix,
and construct the quantum circuit realizing it, using multiqubit control gates
(representable in terms of Toffoli gates, CNOTs and SWAPs), Hadamard
transformations and $Z$-operators. Each row of the matrix is encoded as a pure
state of some quantum system. The admitted matrix is therefore arbitrary up to
the normalization of quantum states of those systems. The depth of the proposed
algorithm is $O(N^3\log \, N)$ for the $N\times N$ matrix.
