I wrote some code in QASM in the IBM Q Experience web interface and then I added some comments. After that I saved the code and run it. However, the code was rearranged (for example some gates were moved on other places - probably because of optimization). Moreover, all comments were removed. The same occurs when I save the code and return to it later Fortunately more recent codes are intact, i.e. there are comments I put there previously, but I was afraid to run them because of a risk of losing comments.
I am used to this behavior when I write a code and then do some edits in composer. In that case comments are also removed and the code is rearranged. But the above described issue seems to be a bug.
Does anyone face similar problems? Can anybody from IBM check this and fix?
As there was a misunderstanding when the comments disappear, here is a screenshot which place of web interface I meant. The code is of course rearranged during transpiling process. However, the problem is that IBM Q erase comments and rearrange code in Circuit editor.
This code I wrote to Circuit editor:
OPENQASM 2.0; include "qelib1.inc"; qreg q; creg c; x q; //ancila h q; //init h q; h q; //Oracle f = 11.x cx q,q; cx q,q; //measurement in Hadamard basis h q; h q; measure q -> c; measure q -> c;
Then I clicked on Save, closed the the circuit, opened again from Dashboard and the code changed to this:
OPENQASM 2.0; include "qelib1.inc"; qreg q; creg c; h q; x q; h q; h q; cx q,q; h q; cx q,q; h q; measure q -> c; measure q -> c;
So, the code is changed to transpiled code. I would like to avoid this behavior.