Inspired by the code given by @qubyte HERE and after adding some new quantum logic gates and patience, drawing the plot is possible.
Information: more inform
% `operator' will only be used by Hadamard (H) gates here.
% `operator2' is for large U gates
% `phase' is used for controlled phase gates (dots).
The following MWE provides a starred version of \resistor which sets a +/- instead of an arrow:
I realise this is an old question, and I used some of the excellent answers already present in what I've done, but I have recently produced a tikz library called quantikz that helps to typeset quantum circuits. There's a full tutorial available here. (It's also a route to downloading the package, by looking at the source code, but hopefully in a day or two, ...
You're using the wrong order; first you have to set \everymath and then set a box to initialize the mechanism. If you set \everymath inside the pspicture, the effect will vanish with its end.
qasm2png is looking for /bin/csh to interpret the code but it seems that this does not exist on your system. This is almost certainly because you do not have csh installed. You can install it using Ubuntu's package manager. The package might be called something like tcsh rather than csh. (On my system /bin/csh is provided by tcsh which is an enhanced/...
The swap gate is implemented using two bipoles. The disadvantage is that you have to add a line between the two centers. The advantage is that you don't have to worry about how far apart they are.
I moved the default label location to the bottom so as to avoid the control anchor.