Software package for decomposing quantum circuits
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.