Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 11 additions & 1 deletion course_info/activities.md
Original file line number Diff line number Diff line change
Expand Up @@ -58,4 +58,14 @@
3. _Practice_: [Tutorialize continuous variable states](../exercises/tutorialize_continuous_variables.md)
4. _Demo_: Profiling and optimising code

11:45: Visit by Marjan and Ingrid from Skylab who will present their innovation and entrepreneurship opportunities
11:45: Visit by Marjan and Ingrid from Skylab who will present their innovation and entrepreneurship opportunities


## Day 6

1. _Practice_: Finalise the [Tutorialize continuous variable states](../exercises/tutorialize_continuous_variables.md) exercise
2. _Peer review_: Give feedback on each other's notebooks
3. _Practice_: [Profile your code](../exercises/profile-your-code.md)
4. _Demo_: QuTiP
5. _Practice_: [Try out QuTiP](../exercises/try-out-qutip.md)
6. _Practice_: If you have time left, start or continue the [Random circuit sampling](../exercises/random-circuit-sampling.md) exercise
10 changes: 5 additions & 5 deletions course_info/schedule.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,11 @@ The schedule is loosely defined and likely to change.
| ----- | ------- | ------------------------------------------------------------ | ----------------------------------------------------- |
| 1 | 3/8 | intro to course and to scientific computing;<br>environments, workflows | |
| 2 | 4/8 | version control<br />NumPy | qubits, quantum circuit simulation |
| 3 | 5/8 | more NumPy | quantum circuit simulation<br>~~random circuit sampling~~ |
| 4 | 6/8 | visualisation | continuous-variable states |
| 5 | 7/8 | QuTiP;<br>profiling code | continuous-variable states<br>cavity QED |
| 6 | 10/8 | data analysis;<br>file I/O | realistic squeezed light |
| 7 | 11/8 | packaging<br>speeding up<br>other relevant packages and tools | teleportation simulation |
| 3 | 5/8 | more NumPy | quantum circuit simulation |
| 4 | 6/8 | visualisation | parametrized circuits |
| 5 | 7/8 | notebook presentation;<br>profiling code | continuous-variable states |
| 6 | 10/8 | QuTiP | continuous-variable states<br>cavity QED |
| 7 | 11/8 | data analysis;<br>file I/O;<br>(packaging?) | realistic squeezed light |
| 8 | 12/8 | guided mini-project:<br />modeling, simulation, analysis, presentation | quantum state generation + tomography |
| 9–13 | 13–19/8 | Project work | your choice! |
| 14–15 | 20–21/8 | Project presentations + feedback | |
Expand Down
341 changes: 341 additions & 0 deletions exercises/cv_submissions/cv_tutorial_leif.ipynb

Large diffs are not rendered by default.

12 changes: 12 additions & 0 deletions exercises/profile-your-code.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
# Profile your code

_Practice_

Take another look at some of the code, you have built during this course. For example the quantum circuit simulator or some of the continuous-variable state calculations.

Test the run time of your code using some of the tools from the [Profiling and optimising code](../demos/Profiling%20and%20optimising%20code.ipynb) notebook – especially `%timeit`, `%prun` and `%lprun` (and the equivalent for multiline cells, `%%timeit` and `%%prun`). The heatmap `%%heat` mentioned [here](https://www.python4data.science/en/latest/performance/ipython-profiler.html) also looks useful (I haven't tested it yet).

If you have your code as normal `.py` Python files instead of notebooks, there are equivalent command-line commands to run your scripts through these profilers:
[timeit](https://docs.python.org/3/library/timeit.html), [profile/cProfile](https://docs.python.org/3/library/profile.html) and [line_profiler](https://kernprof.readthedocs.io/en/latest/).

See if you can identify bottlenecks. Can you think of ways to speed up your code by rewriting it? You could also try to speed it up using Numba, JAX, numexpr, multiprocessing, or similar (see the [Profiling and optimising code](../demos/Profiling%20and%20optimising%20code.ipynb) notebook for very basic examples of usage).
13 changes: 13 additions & 0 deletions exercises/try-out-qutip.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
# Try out QuTiP

**NOTE: NOT FINISHED YET**


1. Browse through the many tutorials on [QuTiP's website](https://qutip.org/qutip-tutorials/). If some of them are aligned with your quantum science interests, then feel free to dig into them and code along.

Solving master equations with QuTiP

2. Starting from [this QuTiP tutorial](https://nbviewer.org/urls/qutip.org/qutip-tutorials/tutorials-v5/time-evolution/006_photon_birth_death.ipynb) which replicates [one of the papers on cavity QED](http://dx.doi.org/10.1038/nature05589) that contributed to the 2012 Nobel prize of Serge Haroche, try to come up with new ways to visualise the results. This could be as a static plot, an animation, or an interactive plot.
3. Change the parameters of the simulation, like changing the initial state, the time steps, the number of trajectories, the coupling rate, environment temperate, etc. - you may discover something interesting by varying these.

Note that you can store all trajectories with the `keep_runs_results` option to `mcsolve` described [here](https://qutip.readthedocs.io/en/stable/guide/dynamics/dynamics-monte.html) (under Monte Carlo Solver Result), and then access e.g. the expectation of the operators in `e_ops` at each time with the result's `runs_expect` property.
15 changes: 13 additions & 2 deletions exercises/tutorialize_continuous_variables.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,12 +10,14 @@ Some of you are almost experts on CV quantum optics, some of you may have only b
2. Start playing around with ways to visualise or otherwise present some basic and/or advanced concepts from continuous variables (see suggestions below if you don't know where to start).
3. Gradually combine your findings into a nicely formatted single notebook. Include Markdown cells with section headers, explanatory text and formulas. Try to make a coherent narrative throughout. Don't worry too much about getting everything perfectly right – think of this as a first draft you might improve upon later.
4. At the end of the day, submit your notebook as a pull request on the sciqis Github repository (instructions below). On Monday, you will give feedback to each other.
5. (Monday) Give feedback on two fellow students' notebook.

There are four objectives of this exercise:
There are five objectives of this exercise:
* Practice writing a computational narrative in the form of a notebook with text, code, and static + interactive/animated plots.
* Learn about continuous variables and Gaussian states.
* Get more experience with visualising data or functions in an informative way, perhaps using interactive plots with ipywidgets or animated plots with Matplotlib's animation module.
* Try out a Github pull request workflow.
* Practice 1) reading other people's code and 2) giving constructive feedback.


### References
Expand Down Expand Up @@ -60,4 +62,13 @@ Instead of just sharing your notebook on Discord, you will practice a Github pul
4. Going to your forked repository on Github, switch to your new branch. You should now see a green button called "Compare & pull request" or similar. Choose `submissions` as the branch to merge into. Complete the form (quick title and description, nothing fancy - would be good to include your name or username in the description) and Create Pull Request. Detailed instructions are [here](https://docs.github.com/en/pull-requests/how-tos/create-pull-requests/creating-a-pull-request).
5. Confirm that the pull request is visible in the main course repository: https://github.com/qpit/sciqis/pulls

In case this doesn't work at all, the fallback solution is to send your notebook to me by direct message on Discord.
In case this doesn't work at all, the fallback solution is to send your notebook to me by direct message on Discord.

### Instructions for giving peer feedback

1. Install Github CLI if you don't already have it (if you can run the `gh` command in your terminal, it's installed). Run `gh auth login` to authorize `gh` against the Github servers through browser login.
2. You will be assigned two fellow students' notebooks to review. They should belong to a specific [pull request](https://github.com/qpit/sciqis/pulls), each with a specific PR number.
3. In your terminal, go to the folder containing your fork of the qpit/sciqis repository. Now download and check out the branch containing the assigned pull request using `gh pr checkout <PR number>`. You should now be able to see your fellow student's notebook and open it in Jupyter Lab, VS Code, etc.
4. Read the notebook. Run the code if needed. Study the plots. Spend 10-15 minutes max.
5. Now, go to the pull request on Github, https://github.com/qpit/sciqis/pull/PR-number (replace PR-number), and add your feedback as a comment at the bottom: What did you like about the notebook? Did you understand what was presented? Were the visuals interesting and informative? Did the code run without problems? Any other comments?
6. Now, repeat with the other assigned notebook.