# How to draw quantum circuit with mathematica?

How to draw quantum circuit as the following one with mathematica? I only find the quantum package which is designed for MMA 7.0 as the author said. But the version of my Mathematica is 9.0 and when I try that package there is an error as following

How to get over this problem? Is there any other method or package to draw quantum circuit?

• Please provide the input expression (cell expression) that does not work. – Mr.Wizard Sep 13 '14 at 2:45
• @Mr.Wizard Thanks! I update the question. If you cannot download it, please let me know. – Eden Harder Sep 13 '14 at 5:08
• I guess you copied the expression from the notebook. If you type the expression using error using the palettes in the quantum package, then the error is gone. – xslittlegrass Sep 13 '14 at 7:33
• see this – xslittlegrass Sep 13 '14 at 7:40
• @xslittlegrass Great observation! It still doesn't explain why the old expression works in v7 yet is broken in v10. – Mr.Wizard Sep 13 '14 at 7:46

I have not yet figured out why different definitions for MakeBoxes occur, but it seems that adding this definition in version 10 allows your specific example to parse and evaluate as desired:

Needs["QuantumComputing"]
Needs["QuantumNotation"]
SetComputingAliases[];

MakeExpression[
TagBox[SuperscriptBox[
RowBox[{"(",
TagBox[QuantumComputingPrivatea_, zz020TPdat,
QuantumComputingPrivateopts1___], ")"}],
TagBox[QuantumComputingPrivaten_, zz020TPend,
QuantumComputingPrivateopts2___]}]], zz020TP,
QuantumComputingPrivateopts0___], QuantumComputingPrivateform_] :=
RowBox[{"zz020TensorPower", "[", QuantumComputingPrivatea, ",",
QuantumComputingPrivaten, "]"}], QuantumComputingPrivateform]

• @Eden I did spend some time on it and I couldn't figure out why. I don't want to have to read the entire package code to track it down. I think this is the only definition (for MakeExpression`) that is missing in v10. Would you please try using it for a while and see if other problems appear? – Mr.Wizard Sep 15 '14 at 0:55