mvwf / qublitz

8 stars 8 forks source link

[Unitary Hack] - BUG - "Add Square Pulse" not always working, pulse disappears #10

Open Neo-Cai opened 2 months ago

Neo-Cai commented 2 months ago

Expected

In free play mode under pulse parameters, the user should be able to:

  1. run a 200ns square pulse in the X-Channel and run the simulation accordingly.
  2. then clear pulses and change to a 20 ns (or any other number of nanoseconds) square pulse and run the sim accordingly.

Actual

When doing step 2, there is a bug that retains the previous square pulse time. So after setting the first square pulse, you cannot set another square pulse with a different duration. Here is the result of doing step 2 screenshotted below: image

anushkrishnav commented 1 month ago

Let me take a look at this , how do I reproduce this bug ?

Neo-Cai commented 1 month ago

Thank you! if you go to free play mode here are the steps to reproduce the bug:

There are a few bugs when you change the pulse to something else (eg. 10-30):

  1. It can reproduce the previous pulse instead of the updated one including the pulse graph of the previous pulse (20 ns) image
  2. I cleared the pulse and added the 10-30 pulse again but the graph is just displaying 0-30 ns. However, when you click run simulation, it reverts back to the 0-20 ns pulse image
  3. after running simulation, you can click add the 10-30 pulse again and it will display the correct pulse pictured below, but when you click run simulation again, it still reverts to the 20ns pulse image
  4. Sometimes there is no pulse at all and the graphs are empty which was described above.

You may have to fiddle with the order of "clear pulse" and "add pulse" to stress test the pulse generator but it is not difficult to reproduce one of these bugs.

anushkrishnav commented 1 month ago

OKay, I see the problem , will send in a PR shortly

anushkrishnav commented 1 month ago

@Neo-Cai I think the pulse_vector and updated_pulse vector persist the data since we don't clear it when the button is pressed, only the sigma x and y vectors are cleared, Once I cleared the data from these 2 explicitly, the adding of square pulse seems to work well.