mvwf / qublitz

8 stars 8 forks source link

[Unitary Hack] - FEATURE - Step Pulse Tutorial and Step Pulse Challenge #9

Open Neo-Cai opened 3 months ago

Neo-Cai commented 3 months ago

Overview

The Step Pulse challenge is meant to build off of the gates challenge by introducing users to the engineering of microwave pulses that happens behind the scenes when a computer scientist executes a gate. This feature will have a tutorial and a challenge similar to the Gates challenge.

General Requirements

To collect the bounty you must implement:

Figma

The Figma for all of the requirements can be found here

Requirement Specs

Bloch Sphere

The Bloch sphere is a representation of all of the possible states on a Qubit. Using X-Gates and Y-Gates, we can flip the Qubit State between two poles of the Bloch sphere, |0〉and |1〉. This is similar to how a transistor flips between 1 and 0 for computational purposes. The Bloch Sphere is plotted using plotly.graph_objects and takes in x, y, and z values that are outputted from the quantum_simulator package already installed in the Challenge Mode home page. image

Square Pulse Generator

The Square pulse generator feeds data into the quantum simulator as an input. It produces rotations around the Bloch sphere that are illustrated in the Figma and below. image Most of the generator code can be taken from the Free Play Mode page and modified as illustrated below: image Required Changes:

The last two can be better understood through their use case. For example, a user may want to run a pulse for 40 ns in just the X-Channel. They will change the settings like so, image and then, they will click "RUN SIMULATION" which will both graph the square pulse on the square pulse timeline and update the "start time" to be at 40 seconds. image

Now, if the user wants to do a pulse afterwards, the start time is changed to "40 ns" to keep track of the 40 ns square pulse that was already added prior. This is basically the time the user has already spent making previous pulses. Note: sending pulses in sequence is important because sending all of these at the same time would yield a very different plot.

To add a y-channel pulse, before clicking RUN SIMULATION, the user will switch the channel to Y and change the stop time to 40 ns. (They generally will not need to touch the start time, that should automatically update as described above). image

Finally, they press add pulse, the start time automatically updates to 80 ns and the square pulse timeline updates to graph the additional Y-pulse added after the original pulse: image

Square Pulse Timeline

The square pulse timeline displays all of the square pulses the user has done in a single experiment. Below we can see a timeline of a sequence of X then Y then X then Y pulses. image

The timeline is a graphical display using the plotly.graph_objects library that just displays the square pulse inputted by the Square Pulse Generator.

Notice in the image above that the square pulses are really thin because each pulse is only 20 ns but the domain of the graph is a fixed 1000 ns. In the Pulse Challenge, we want to domain to be only as long as all the pulses that the user is inputting. Otherwise, the program is simulating 920 ns where nothing is happening. This takes up unnecessary processing power and time. In this case, if there are 4 20ns pulses, we only need to simulate say 80 ns + a buffer of 10 ns. If instead there was only one pulse of 20 ns, we would only need to simulate the qubit behavior for 30 ns.

Required Change: Make the domain of the square pulse timeline/grapher dynamically change according to the pulses that the user inputs. You should add an offset of 10 for the total simulation time that contains significant information.

Like "start time" although it automatically changes, there should also be an option to manually change the timeline domain (NOT pictured in the figmas)

Gate Timeline

The gate timeline displays the qubit state based on the pulse that the user defines. image

If the user defines a pulse that is an X or Y Gate, update the gate timeline with an X or Y Gate and the corresponding state. To check if the pulse is an X or Y gate, the pulse channel will indicate either X or Y and the pulse duration must be 1/[Rabi_Rate] * 10^3 nano seconds.

If the user entered pulse does not satisfy either of those, throw an error indicating that the pulse duration is not a valid gate.

Menu

The menu allows the user to navigate between pages. For now, the levels and pulse challenge buttons can link to placeholder pages while the gate challenge and tutorial buttons should link to the pages created in this issue. image The page that you are on should be highlighted in a difference shade of blue as pictured above.

Tutorial Sequence

Tutorial sequence should be made as an independent page called "pulse_tutorial_sequence" This takes users through a pre-arranged set of lessons that are displayed in the figma.

Challenge Sequence

Challenge sequence should be made as an independent page called "pulse_challenge_sequence" This takes users through a set of challenges:

  1. Generate an X-Gate Pulse - check that the user entered the correct pulse
  2. Navigate from |1〉to -i|0〉- here you would check that the user entered the correct pulse
  3. Navigate from -i|0〉to |0〉- check that the user entered the correct pulses
  4. Find the Rabi Rate given an X-Gate takes 5 ns - check that the user entered the correct Rabi Rate
  5. Find the X-Gate given the Rabi Rate is 13 Mhz - check that the user entered the correct pulse

Each dialogue box will display the navigation challenge. When the user completes objective, they progress to the next challenge. After each challenge is completed, the Challenge ticker will update.