<p><a href="http://arxiv.org/abs/1201.3538">This package</a> (CUGates.m) was announced on the arXiv a couple of days ago which could be useful for you. It uses Mathematica. I haven't tried it out though, and it may or may not do what you need. From the abstract:</p>

<blockquote>
  <p>This paper presents a highly efficient decomposition scheme and its
  associated Mathematica notebook for the analysis of complicated
  quantum circuits comprised of single/multiple qubit and qudit quantum
  gates. In particular, this scheme reduces the evaluation of multiple
  unitary gate operations with many conditionals to just two matrix
  additions, regardless of the number of conditionals or gate
  dimensions. This improves significantly the capability of a quantum
  circuit analyser implemented in a classical computer. This is also the
  first efficient quantum circuit analyser to include qudit quantum
  logic gates.</p>
</blockquote>

CC BY-SA 3.0
2012-02-16T18:54:37.010Z
I did not find free version of that
Alex 'qubeat'
CC BY-SA 3.0
2012-02-17T01:05:23.677Z
@AlexV: I found it [here](http://cpc.cs.qub.ac.uk/summaries/AEJM_v1_0.html). But it was unusually difficult to track down!
qubyte
CC BY-SA 3.0
2012-02-17T14:39:59.530Z
It is not free. "Your IP address is not registered with CPC. 
... If your institute is not a current subscriber to CPC you can take out an individual subscription to the Program Library. ..."
Alex 'qubeat'
CC BY-SA 3.0
2012-02-17T23:43:06.217Z
You could try contacting the authors. I'm certain that they'd be happy to send you a copy. In any case, where in the question does it stipulate that the software be free?
qubyte
CC BY-SA 3.0
2012-02-18T17:26:19.360Z
Indeed, and after all, it is not clear, if there is a version for free Mathematica Player
Alex 'qubeat'
CC BY-SA 3.0
2012-02-18T17:31:08.277Z
Whilst the software may not be free to download, the algorithm is available via the linked to arXiv paper. It's obviously not optimal, but the algorithm can be coded in whatever your favourite language is. I'd personally recommend Octave or Python for this purpose.
qubyte
CC BY-SA 3.0
2012-02-19T19:37:47.933Z
In fact, most likely, the paper may be quite far from initial question, because uses term "composition" for sum of matrixes (for presentation of conditional gates), not for product.
Alex 'qubeat'
CC BY-SA 3.0
2012-02-19T20:06:52.883Z
Maybe, for coding on favorite language it is better to read something like http://arxiv.org/abs/quant-ph/0406176 instead
Alex 'qubeat'
CC BY-SA 3.0
2012-01-20T01:57:23.590Z
2012-01-20T01:57:23.590Z
qubyte
<p>This website - <a href="http://quantum-compiler.org/">Quantum Compiler.org</a> - has <a href="https://github.com/ppham/skc-python">sourcecode</a> for a python library that does this, in two models, <a href="http://arxiv.org/abs/quant-ph/0505030">Solovay-Kitaev</a> and Kitaev-Shen-Vyalyi.</p>

CC BY-SA 3.0
2012-01-25T10:19:00.897Z
2012-01-25T10:26:08.653Z
Noon Silk
<p>There is a program “Qubiter” by R.R.Tucci that uses CS decomposition, described in <a href="http://arxiv.org/abs/quant-ph/9902062" rel="nofollow">http://arxiv.org/abs/quant-ph/9902062</a> and distributed free via source code (C++). I just have seen  – a link in e-print still valid, the last version is 1-11, but I never used the program myself and so may not comment that.</p>

<p>[EDIT] There are (at least) two packages for decomposition in list <a href="http://www.quantiki.org/wiki/List_of_QC_simulators" rel="nofollow">http://www.quantiki.org/wiki/List_of_QC_simulators</a></p>

CC BY-SA 3.0
2012-01-24T12:47:17.353Z
2012-02-16T18:53:46.810Z
Alex 'qubeat'
<p>In addition to the previous answers, there is a <a href="http://www.ece.cmu.edu/~smart/arep/arep.html" rel="nofollow">package</a> that computes Fourier transforms for solvable non-commutative groups based on <a href="http://arxiv.org/abs/quant-ph/9807064" rel="nofollow">this algorithm</a>. The software has a tool to decompose Fourier transforms into simpler matrices. Such decomposition is essentially an efficient quantum circuit to implement a non-abelian quantum Fourier transform.</p>

<p>Although it is not a general-purpose package it is a nice tool if you work with this class of (rather complicated) unitaries. In this context there are no alternatives that I know.</p>

CC BY-SA 3.0
2012-01-20T18:13:13.690Z
2012-02-03T10:29:42.783Z
Juan Bermejo Vega
<p>Is there any software package allowing decomposition of unitaries from $U(2^n)$ into quantum circuits over a predefined universal gate set? </p>

CC BY-SA 3.0
2012-02-17T07:24:21.717Z
I wonder whether there is a more efficient algorithm to do it on a *quantum* computer :)
Vanessa
<quantum-computing><software>
Software package for decomposing quantum circuits
Marcin Kotowski
# Software package for decomposing quantum circuits

(Asked by: username_0 on 2012-01-20)

Is there any software package allowing decomposition of unitaries from $U(2^n)$ into quantum circuits over a predefined universal gate set?

**Tags:** quantum-computing, software

> **Comments:**
> **username_1**: I wonder whether there is a more efficient algorithm to do it on a *quantum* computer :)  

---

## 4 answers

### Answer by username_2 on 2012-01-20. Score: 9

[This package](http://arxiv.org/abs/1201.3538) (CUGates.m) was announced on the arXiv a couple of days ago which could be useful for you. It uses Mathematica. I haven't tried it out though, and it may or may not do what you need. From the abstract:

> This paper presents a highly efficient decomposition scheme and its
> associated Mathematica notebook for the analysis of complicated
> quantum circuits comprised of single/multiple qubit and qudit quantum
> gates. In particular, this scheme reduces the evaluation of multiple
> unitary gate operations with many conditionals to just two matrix
> additions, regardless of the number of conditionals or gate
> dimensions. This improves significantly the capability of a quantum
> circuit analyser implemented in a classical computer. This is also the
> first efficient quantum circuit analyser to include qudit quantum
> logic gates.

> **Comments:**
> **username_3**: I did not find free version of that  
> **username_2**: @AlexV: I found it [here](http://cpc.cs.qub.ac.uk/summaries/AEJM_v1_0.html). But it was unusually difficult to track down!  
> **username_3**: It is not free. "Your IP address is not registered with CPC.  ... If your institute is not a current subscriber to CPC you can take out an individual subscription to the Program Library. ..."  
> **username_2**: You could try contacting the authors. I'm certain that they'd be happy to send you a copy. In any case, where in the question does it stipulate that the software be free?  
> **username_3**: Indeed, and after all, it is not clear, if there is a version for free Mathematica Player  
> **username_2**: Whilst the software may not be free to download, the algorithm is available via the linked to arXiv paper. It's obviously not optimal, but the algorithm can be coded in whatever your favourite language is. I'd personally recommend Octave or Python for this purpose.  
> **username_3**: In fact, most likely, the paper may be quite far from initial question, because uses term "composition" for sum of matrixes (for presentation of conditional gates), not for product.  
> **username_3**: Maybe, for coding on favorite language it is better to read something like http://arxiv.org/abs/quant-ph/0406176 instead  

---

### Answer by username_4 on 2012-01-25. Score: 7

This website - [Quantum Compiler.org](http://quantum-compiler.org/) - has [sourcecode](https://github.com/ppham/skc-python) for a python library that does this, in two models, [Solovay-Kitaev](http://arxiv.org/abs/quant-ph/0505030) and Kitaev-Shen-Vyalyi.


---

### Answer by username_3 on 2012-01-24. Score: 4

There is a program “Qubiter” by R.R.Tucci that uses CS decomposition, described in <http://arxiv.org/abs/quant-ph/9902062> and distributed free via source code (C++). I just have seen – a link in e-print still valid, the last version is 1-11, but I never used the program myself and so may not comment that.

[EDIT] There are (at least) two packages for decomposition in list <http://www.quantiki.org/wiki/List_of_QC_simulators>


---

### Answer by username_5 on 2012-01-20. Score: 2

In addition to the previous answers, there is a [package](http://www.ece.cmu.edu/~smart/arep/arep.html) that computes Fourier transforms for solvable non-commutative groups based on [this algorithm](http://arxiv.org/abs/quant-ph/9807064). The software has a tool to decompose Fourier transforms into simpler matrices. Such decomposition is essentially an efficient quantum circuit to implement a non-abelian quantum Fourier transform.

Although it is not a general-purpose package it is a nice tool if you work with this class of (rather complicated) unitaries. In this context there are no alternatives that I know.


---

