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?
EDIT:
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.
EDIT 2:
This code I wrote to Circuit editor:
OPENQASM 2.0;
include "qelib1.inc";
qreg q[5];
creg c[5];
x q[1]; //ancila
h q[0]; //init
h q[1];
h q[2];
//Oracle f = 11.x
cx q[0],q[1];
cx q[2],q[1];
//measurement in Hadamard basis
h q[0];
h q[2];
measure q[0] -> c[1];
measure q[2] -> c[0];
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[5];
creg c[5];
h q[0];
x q[1];
h q[2];
h q[1];
cx q[0],q[1];
h q[0];
cx q[2],q[1];
h q[2];
measure q[0] -> c[1];
measure q[2] -> c[0];
So, the code is changed to transpiled code. I would like to avoid this behavior.