In this paper, we present a general quantum computation compiler, which maps any given quantum algorithm to a quantum circuit consisting a sequential set of elementary quantum logic gates based on recursive cosine–sine decomposition. The resulting quantum circuit diagram is provided by directly linking the package output written in LaTeX to Qcircuit.tex <http://www.cquic.org/Qcircuit >. We illustrate the use of the Qcompiler package through various examples with full details of the derived quantum circuits. Besides its accuracy, generality and simplicity, Qcompiler produces quantum circuits with significantly reduced number of gates when the systems under study have a high degree of symmetry. Program summaryProgram title: QcompilerCatalogue identifier: AENX_v1_0Program summary URL:http://cpc.cs.qub.ac.uk/summaries/AENX_v1_0.htmlProgram obtainable from: CPC Program Library, Queen’s University, Belfast, N. IrelandLicensing provisions: Standard CPC licence, http://cpc.cs.qub.ac.uk/licence/licence.htmlNo. of lines in distributed program, including test data, etc.: 4321No. of bytes in distributed program, including test data, etc.: 50943Distribution format: tar.gzProgramming language: Fortran.Computer: Any computer with a Fortran compiler.Operating system: Linux, Mac OS X 10.5 (and later).RAM: Depends on the size of the unitary matrix to be decomposedClassification: 4.15.External routines: Lapack (http://www.netlib.org/lapack/)Nature of problem:Decompose any given unitary operation into a quantum circuit with only elementary quantum logic gates.Solution method:This package decomposes an arbitrary unitary matrix, by applying the CSD algorithm recursively, into a series of block-diagonal matrices, which can then be readily associated with elementary quantum gates to form a quantum circuit.Restrictions:The only limitation is imposed by the available memory on the user’s computer.Additional comments:This package is applicable for any arbitrary unitary matrices, both real and complex. If the unitary matrix is real, its corresponding quantum circuit is much simpler, with only half the number of quantum gates in comparison with complex matrices of the same size.Running time:Memory and CPU time requirements depend critically on the size of the unitary matrix to be decomposed. Run-time is dominated by the recursive CSD. Most examples presented in this paper require a few minutes of CPU time on Intel Pentium Dual Core 2 Duo E2200 2.2 GHz.