# Software package for decomposing quantum circuits

+ 12 like - 0 dislike
206 views

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

This post has been migrated from (A51.SE)
I wonder whether there is a more efficient algorithm to do it on a *quantum* computer :)

This post has been migrated from (A51.SE)

+ 8 like - 0 dislike

This package (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.

This post has been migrated from (A51.SE)
answered Jan 20, 2012 by (180 points)
I did not find free version of that

This post has been migrated from (A51.SE)
@AlexV: I found it [here](http://cpc.cs.qub.ac.uk/summaries/AEJM_v1_0.html). But it was unusually difficult to track down!

This post has been migrated from (A51.SE)
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. ..."

This post has been migrated from (A51.SE)
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?

This post has been migrated from (A51.SE)
Indeed, and after all, it is not clear, if there is a version for free Mathematica Player

This post has been migrated from (A51.SE)
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.

This post has been migrated from (A51.SE)
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.

This post has been migrated from (A51.SE)
Maybe, for coding on favorite language it is better to read something like http://arxiv.org/abs/quant-ph/0406176 instead

This post has been migrated from (A51.SE)
+ 7 like - 0 dislike

There was a paper up about 6 years ago on implementing and optimising the Barenco decomposition: http://arxiv.org/abs/quant-ph/0607123 I don't know if they've released their software, or if you need to ask them nicely for it.

This post has been migrated from (A51.SE)
answered Jan 20, 2012 by (180 points)
+ 6 like - 0 dislike

This website - Quantum Compiler.org - has sourcecode for a python library that does this, in two models, Solovay-Kitaev and Kitaev-Shen-Vyalyi.

This post has been migrated from (A51.SE)
answered Jan 25, 2012 by (60 points)
+ 3 like - 0 dislike

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

This post has been migrated from (A51.SE)
answered Jan 24, 2012 by (300 points)
+ 2 like - 0 dislike

In addition to the previous answers, there is a package that computes Fourier transforms for solvable non-commutative groups based on this algorithm. 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.

This post has been migrated from (A51.SE)
answered Jan 20, 2012 by (285 points)

 Please use answers only to (at least partly) answer questions. To comment, discuss, or ask for clarification, leave a comment instead. To mask links under text, please type your text, highlight it, and click the "link" button. You can then enter your link URL. Please consult the FAQ for as to how to format your post. This is the answer box; if you want to write a comment instead, please use the 'add comment' button. Live preview (may slow down editor)   Preview Your name to display (optional): Email me at this address if my answer is selected or commented on: Privacy: Your email address will only be used for sending these notifications. Anti-spam verification: If you are a human please identify the position of the character covered by the symbol $\varnothing$ in the following word:p$\hbar$ysicsO$\varnothing$erflowThen drag the red bullet below over the corresponding character of our banner. When you drop it there, the bullet changes to green (on slow internet connections after a few seconds). To avoid this verification in future, please log in or register.