diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml new file mode 100644 index 0000000..ecb97c5 --- /dev/null +++ b/.github/workflows/publish.yml @@ -0,0 +1,38 @@ +name: deploy-book + +# Only run this when the master branch changes +on: + push: + branches: + - jb + +# This job installs dependencies, build the book, and pushes it to `gh-pages` +jobs: + deploy-book: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v3 + + # Install dependencies + - name: Set up Python 3.12 + uses: actions/setup-python@v3 + with: + python-version: 3.12 + + - name: Install dependencies + run: | + pip install -r requirements.txt + + + # Build the book + - name: Build the book + run: | + jupyter-book build . + + # Push the book's HTML to github-pages + - name: GitHub Pages action + uses: peaceiris/actions-gh-pages@v3.9.3 + with: + github_token: ${{ secrets.GITHUB_TOKEN }} + publish_dir: ./_build/html + enable_jekyll: false \ No newline at end of file diff --git a/.gitignore b/.gitignore index 2c62a15..00f1db8 100644 --- a/.gitignore +++ b/.gitignore @@ -160,3 +160,11 @@ cython_debug/ # and can be added to the global gitignore or merged into this file. For a more nuclear # option (not recommended) you can uncomment the following to ignore the entire idea folder. #.idea/ +.DS_Store +scratch.md +_site/ +_draft/ +.jekyll-cache/ +Gemfile.lock +_build/ +_build/* diff --git a/_config.yml b/_config.yml new file mode 100644 index 0000000..53c432e --- /dev/null +++ b/_config.yml @@ -0,0 +1,56 @@ +# Book settings +# Learn more at https://jupyterbook.org/customize/config.html + +title: Lecture Notes from ICHEC +author: ICHEC Team +logo: logo.png + +# Force re-execution of notebooks on each build. +# See https://jupyterbook.org/content/execute.html +execute: + execute_notebooks: force + +# Define the name of the latex output file for PDF builds +latex: + latex_documents: + targetname: book.tex + +# Add a bibtex file so that we can create citations +bibtex_bibfiles: + - references.bib + +# Information about where the book exists on the web +repository: + url: https://github.com/ICHEC/qpcc # Online location of your book + path_to_book: ./ # Optional path to your book, relative to the repository root + branch: jb # Which branch of the repository should be used when creating links (optional) + +# Add GitHub buttons to your book +# See https://jupyterbook.org/customize/config.html#add-a-link-to-your-repository +html: + use_issues_button: true + use_repository_button: true + +html: + extra_footer: "Copyright@2022" + +# remove jupyterbooks copyright info +sphinx: + extra_extensions: + - sphinxcontrib.mermaid + config: + html_show_copyright: false + +parse: + myst_enable_extensions: + - amsmath + - colon_fence + - deflist + - dollarmath + - html_admonition + - html_image + - linkify + - replacements + - smartquotes + - substitution + - tasklist diff --git a/_static/style.css b/_static/style.css new file mode 100644 index 0000000..9e581f1 --- /dev/null +++ b/_static/style.css @@ -0,0 +1,7 @@ +p {text-align: justify;} + +.bd-main .bd-content .bd-article-container { + max-width: 81em; /* default is 60em */ +} + + \ No newline at end of file diff --git a/_toc.yml b/_toc.yml new file mode 100644 index 0000000..7365ade --- /dev/null +++ b/_toc.yml @@ -0,0 +1,13 @@ +# Table of contents +# Learn more at https://jupyterbook.org/customize/toc.html + +format: jb-book +root: index + +chapters: +- file: pyqm-week1/README.md +- file: pyqm-week2/README.md +- file: pyqm-week3/README.md +- file: pyqm-week4/README.md +- file: pyqm-week5/README.md +- file: pyqm-week6/README.md diff --git a/README.md b/index.md similarity index 98% rename from README.md rename to index.md index fae57c9..ee66f85 100644 --- a/README.md +++ b/index.md @@ -3,6 +3,8 @@ title: Python For Quantum Mechanics layout: home --- +# Python For Quantum Mechanics + ## Description Welcome to Python for Quantum Mechanics. This course was designed to give you a solid foundation in the Python programming language for your studies in quantum technology. The course is six sessions long in total, and builds from the ground up a working knowledge of Python, with emphasis on the NumPy, Matplotlib and SciPy libraries. The first three sessions entail the building of a foundation, where you will learn how to manipulate basic data types in the first session, all the way to object-oriented programming in the third session. The final three sessions involve a deep dive into the afore-mentioned libraries. diff --git a/logo.png b/logo.png new file mode 100644 index 0000000..6882a76 Binary files /dev/null and b/logo.png differ diff --git a/pyqm-week1/README.md b/pyqm-week1/README.md index 20ac3e8..b6d7dea 100644 --- a/pyqm-week1/README.md +++ b/pyqm-week1/README.md @@ -1,6 +1,6 @@ -# Week 1 Contents +# Week 1: Variables, data structures, and operations -## 1.1 - Variables - [[Notebook]](./notebooks/pyqm-1.1-variables.ipynb) - [[Video]](https://youtu.be/dU8NKvAxcnE) +## 1.1 - Variables - [Notebook](./notebooks/pyqm-1.1-variables.ipynb) - [Video](https://youtu.be/dU8NKvAxcnE) - Integer and Float Variables - Scientific Notation @@ -8,23 +8,40 @@ - Complex Numbers - Strings - Casting +- None Type - Operator Precedence -## 1.2 - Data Structures - [[Notebook]](./notebooks/pyqm-1.2-data-structures.ipynb) - [[Video]](https://youtu.be/yCQQwTEaMvs) +## 1.2 - Data Structures - [Notebook](./notebooks/pyqm-1.2-data-structures.ipynb) - [Video](https://youtu.be/yCQQwTEaMvs) - Lists - Tuples - Sets - Dictionaries -- Operations With Data Structures: +- Operations with Data Structures - Properties - - Changing, Adding, And Removing Elements - - Slicing And Reorganising + - Changing, Adding, and Removing Elements + - Slicing and Reorganising - Combining Structures - Copying -## 1.3 - Binary Operations - [[Notebook]](./notebooks/pyqm-1.3-binary-operations.ipynb) - [[Video]](https://youtu.be/dMw8E-8cQpc) +## 1.3 - Binary Operations - [Notebook](./notebooks/pyqm-1.3-binary-operations.ipynb) - [Video](https://youtu.be/dMw8E-8cQpc) - Overview Of Binary - Bitwise Operators - Shift Operators + +## 1.4 - Cheatsheet - [Notebook] + +Week1_Supplementary_Material/PyQM_1.4_Cheatsheet.ipynb + +## 1.5 - Tutorial [Tutorial 1](Week1_Exercises/PyQM_Tut.1_sol.ipynb) +1. Matrix Multiplication +2. Matrix Addition/Subtraction +3. Scalar Multiplication Of Matrix +4. Matrix Inverse & Determinant + +## 1.6 Exercise [Exercises 1](Week1_Exercises/PyQM_Ex.1_sol.ipynb) +1. Python as a Calculator +2. Energy Levels of Hydrogen +3. Quantum Qubit Gates & Nested Lists +4. Periodic Function diff --git a/pyqm-week1/pyqm-1-overview.ipynb b/pyqm-week1/pyqm-1-overview.ipynb deleted file mode 100644 index 7387301..0000000 --- a/pyqm-week1/pyqm-1-overview.ipynb +++ /dev/null @@ -1,117 +0,0 @@ -{ - "cells": [ - { - "cell_type": "markdown", - "metadata": { - "cell_id": "00001-724a1d3c-76b1-4daf-8d01-3d692febf397", - "deepnote_cell_type": "markdown", - "tags": [] - }, - "source": [ - "
\n", - " \n", - "# Python For Quantum Mechanics \n", - "# Week 1: Overview\n", - "\n", - "
" - ] - }, - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "## [1.1 Variables](notebooks/pyqm-1.1-variables.ipynb) \n", - "- Integer and Float Variables\n", - "- Scientific Notation\n", - "- Comparison Operators and Boolean Variables\n", - "- Complex Numbers\n", - "- Strings\n", - "- Casting\n", - "- None Type\n", - "- Operator Precedence" - ] - }, - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "## [1.2 Data Structures](notebooks/pyqm-1.2-data-structures.ipynb) \n", - "- Lists\n", - "- Tuples\n", - "- Sets\n", - "- Dictionaries\n", - "- Operations with Data Structures\n", - " - Properties\n", - " - Changing, Adding, and Removing Elements\n", - " - Slicing and Reorganising\n", - " - Combining Structures\n", - " - Copying" - ] - }, - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "## [1.3 Binary Operations](notebooks/pyqm-1.3-binary-operations.ipynb) \n", - "- Overview Of Binary\n", - "- Bitwise Operators\n", - "- Shift Operators" - ] - }, - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "## [1.4 Cheatsheet](Week1_Supplementary_Material/PyQM_1.4_Cheatsheet.ipynb)" - ] - }, - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "## [Tutorial 1](Week1_Exercises/PyQM_Tut.1_sol.ipynb) \n", - "1. Matrix Multiplication\n", - "2. Matrix Addition/Subtraction\n", - "3. Scalar Multiplication Of Matrix\n", - "4. Matrix Inverse & Determinant" - ] - }, - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "## [Exercises 1](Week1_Exercises/PyQM_Ex.1_sol.ipynb) \n", - "1. Python as a Calculator\n", - "2. Energy Levels of Hydrogen\n", - "3. Quantum Qubit Gates & Nested Lists\n", - "4. Periodic Function" - ] - } - ], - "metadata": { - "deepnote": { - "is_reactive": false - }, - "deepnote_execution_queue": [], - "deepnote_notebook_id": "c3dd4414-c48b-4e8b-9619-24631465ef99", - "kernelspec": { - "display_name": "Python 3 (ipykernel)", - "language": "python", - "name": "python3" - }, - "language_info": { - "codemirror_mode": { - "name": "ipython", - "version": 3 - }, - "file_extension": ".py", - "mimetype": "text/x-python", - "name": "python", - "nbconvert_exporter": "python", - "pygments_lexer": "ipython3", - "version": "3.9.6" - } - }, - "nbformat": 4, - "nbformat_minor": 2 -} diff --git a/pyqm-week2/README.md b/pyqm-week2/README.md index 077ef12..2a2092a 100644 --- a/pyqm-week2/README.md +++ b/pyqm-week2/README.md @@ -1,9 +1,9 @@ -# Week 2 Contents +# Week 2: Flow control, comprehensions and file operations ## 2.1 - Flow Control - [[Notebook]](./notebooks/pyqm-2.1-flow-control.ipynb) - [[Video]](https://youtu.be/6IUQ12mOb1A) -- Conditional Statements(if,elif,else) -- Testing Code(try,except) +- Conditional Statements(if, elif, else) +- Testing Code (try, except) - While loops - Range - Zip @@ -13,14 +13,32 @@ ## 2.2 - Compact Code - [[Notebook]](./notebooks/pyqm-2.2-compact-code.ipynb) - [[Video]](https://youtu.be/JBFc9V6BcNY) -- List Comprehensions -- Set Comprehensions -- Dictionary Comprehensions -- Generator Comprehensions +- One-line if and else +- Comprehensions + - list, set, dictionary and more +- Generators +- Maps ## 2.3 - External Data - [[Notebook]](./notebooks/pyqm-2.3-external-data.ipynb) - [[Video]](https://youtu.be/Pjl23pFmk_w) -- Inputting from the terminal/command line -- Copying files -- Reading files -- Writing files -- Creating files +- Basic user input +- Opening, closing and creating file +- Reading and writing files + +## 2.4 - Cheatsheet + +## 2.5 Tutorial [Tutorial 2](Week2_Exercises/PyQM_Tut.2.ipynb) +1. Convert Decimal To Ten Bit Binary String +2. For Loops, Sequence Sum +3. While Loops, Reverse A Number +4. List Comprehensions +5. DNA +6. Collatz Conjecture +7. Fizz Buzz + +## 2.6 Exercise [Exercises 2](Week2_Exercises/PyQM_Ex.2.ipynb) +1. Decimal To/From Binary +2. Balmer Lines +3. Quantum Quibit Gates +4. How many days left do you have to live? +5. Rotating Vectors In 2-Dimensions +6. Quantum Quibit State Normalisation \ No newline at end of file diff --git a/pyqm-week2/pyqm-2.0-overview.ipynb b/pyqm-week2/pyqm-2.0-overview.ipynb deleted file mode 100644 index 6973bbf..0000000 --- a/pyqm-week2/pyqm-2.0-overview.ipynb +++ /dev/null @@ -1,140 +0,0 @@ -{ - "cells": [ - { - "cell_type": "markdown", - "metadata": { - "cell_id": "00001-03624c49-ee43-4d7f-8008-6de8a2bcdd40", - "deepnote_cell_type": "markdown", - "tags": [] - }, - "source": [ - "
\n", - " \n", - "# Python For Quantum Mechanics\n", - "# Week 2: Overview\n", - "\n", - "
" - ] - }, - { - "cell_type": "markdown", - "metadata": { - "cell_id": "00001-89beffad-b01a-413c-a386-a598c4a56553", - "deepnote_cell_type": "markdown", - "tags": [] - }, - "source": [ - "## [2.1 Flow Control](Week2_Notebooks/PyQM_2.1_Flow_Control.ipynb) \n", - "\n", - "- If Statments\n", - "- Try and Except\n", - "- While Loops\n", - "- Range and Zip\n", - "- For Loops\n", - "- Break, Continue, Pass" - ] - }, - { - "cell_type": "markdown", - "metadata": { - "cell_id": "00002-5f79ab1b-a7c0-4640-8bdb-eb0cb2d041c3", - "deepnote_cell_type": "markdown", - "tags": [] - }, - "source": [ - "## [2.2 Compact Code](Week2_Notebooks/PyQM_2.2_Compact_Code.ipynb) \n", - "\n", - "- One-Line If and Else\n", - "- Comprehensions\n", - "- Generators" - ] - }, - { - "cell_type": "markdown", - "metadata": { - "cell_id": "00003-5b99fc1c-1486-4286-b6f7-0a2c282c2c34", - "deepnote_cell_type": "markdown", - "tags": [] - }, - "source": [ - "## [2.3 External Data](Week2_Notebooks/PyQM_2.3_External_Data.ipynb) \n", - "\n", - "- User Input\n", - "- Reading from File\n", - "- Writing to File" - ] - }, - { - "cell_type": "markdown", - "metadata": { - "cell_id": "00004-5d7049ac-4262-49f6-944c-d477b4e49658", - "deepnote_cell_type": "markdown", - "tags": [] - }, - "source": [ - "## [2.4 Cheatsheet](./notebooks/pyqm-2.4-cheatsheet.ipynb)" - ] - }, - { - "cell_type": "markdown", - "metadata": { - "cell_id": "00005-453e6355-5715-4025-8529-a88ae46df8d7", - "deepnote_cell_type": "markdown", - "tags": [] - }, - "source": [ - "## [Tutorial 2](Week2_Exercises/PyQM_Tut.2.ipynb) \n", - "1. Convert Decimal To Ten Bit Binary String\n", - "2. For Loops, Sequence Sum\n", - "3. While Loops, Reverse A Number\n", - "4. List Comprehensions\n", - "5. DNA\n", - "6. Collatz Conjecture\n", - "7. Fizz Buzz" - ] - }, - { - "cell_type": "markdown", - "metadata": { - "cell_id": "00006-19a92260-ea6a-44dd-aae1-0b8729293f00", - "deepnote_cell_type": "markdown", - "tags": [] - }, - "source": [ - "## [Exercises 2](Week2_Exercises/PyQM_Ex.2.ipynb) \n", - "1. Decimal To/From Binary\n", - "2. Balmer Lines\n", - "3. Quantum Quibit Gates\n", - "4. How many days left do you have to live?\n", - "5. Rotating Vectors In 2-Dimensions\n", - "6. Quantum Quibit State Normalisation" - ] - } - ], - "metadata": { - "deepnote": { - "is_reactive": false - }, - "deepnote_execution_queue": [], - "deepnote_notebook_id": "b368b4f3-f8fd-4c11-b467-b445ac7a47a7", - "kernelspec": { - "display_name": "Python 3", - "language": "python", - "name": "python3" - }, - "language_info": { - "codemirror_mode": { - "name": "ipython", - "version": 3 - }, - "file_extension": ".py", - "mimetype": "text/x-python", - "name": "python", - "nbconvert_exporter": "python", - "pygments_lexer": "ipython3", - "version": "3.8.8" - } - }, - "nbformat": 4, - "nbformat_minor": 2 -} diff --git a/pyqm-week3/README.md b/pyqm-week3/README.md index a0889fb..a2a319a 100644 --- a/pyqm-week3/README.md +++ b/pyqm-week3/README.md @@ -1,4 +1,4 @@ -# Week 3 Contents +# Week 3: Functions and Classes ## 3.1 - Functions - [[Notebook]](./notebooks/pyqm-3.1-function.ipynb) - [[Video]](https://www.youtube.com/watch?v=h-TmiynfpCs) @@ -15,3 +15,9 @@ - Methods - Inheritance - Magic Methods + +## [3.3 CheatSheet](./notebooks/pyqm-3.3-cheatsheet.ipynb) + +## 3.4 [Tutorial ](Week3_Exercises/PyQM_Tut.3_sol.ipynb) + +## [Excercise 3](Week3_Exercises/PyQM_Ex.3_sol.ipynb) \ No newline at end of file diff --git a/pyqm-week3/pyqm-3.0-overview.ipynb b/pyqm-week3/pyqm-3.0-overview.ipynb deleted file mode 100644 index 200944a..0000000 --- a/pyqm-week3/pyqm-3.0-overview.ipynb +++ /dev/null @@ -1,91 +0,0 @@ -{ - "cells": [ - { - "cell_type": "markdown", - "metadata": { - "cell_id": "00000-f396f78a-65b4-4fd5-94d2-c6b10fae0abf", - "deepnote_cell_type": "code", - "tags": [] - }, - "source": [ - "
\n", - " \n", - "# Python For Quantum Mechanics \n", - "# Week 3: Overview\n", - "\n", - "
" - ] - }, - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "## [3.1 Functions](./notebooks/pyqm-3.1-function.ipynb) \n", - "- Functions Returning a Value\n", - "- Functions Returning Multiple Values\n", - "- Recursive Functions\n", - "- Implicit Arguments\n", - "- Keyword Arguments, *args, and **kwargs\n", - "- Map, Filter, and Lambda Functions" - ] - }, - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "## [3.2 Classes](./notebooks/pyqm-3.2-classes.ipynb) \n", - "- Attributes\n", - "- Methods\n", - "- Inheritance\n", - "- Magic Methods" - ] - }, - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "## [3.3 CheatSheet](./notebooks/pyqm-3.3-cheatsheet.ipynb)" - ] - }, - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "## [Tutorial 3](Week3_Exercises/PyQM_Tut.3_sol.ipynb)" - ] - }, - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "## [Excercise 3](Week3_Exercises/PyQM_Ex.3_sol.ipynb)" - ] - } - ], - "metadata": { - "deepnote": { - "is_reactive": false - }, - "deepnote_execution_queue": [], - "deepnote_notebook_id": "a8df27d7-ccbf-45b0-b549-be6985c4f91e", - "kernelspec": { - "display_name": "Python 3", - "language": "python", - "name": "python3" - }, - "language_info": { - "codemirror_mode": { - "name": "ipython", - "version": 3 - }, - "file_extension": ".py", - "mimetype": "text/x-python", - "name": "python", - "nbconvert_exporter": "python", - "pygments_lexer": "ipython3", - "version": "3.8.8" - } - }, - "nbformat": 4, - "nbformat_minor": 2 -} diff --git a/pyqm-week4/README.md b/pyqm-week4/README.md index 0a08762..13678ee 100644 --- a/pyqm-week4/README.md +++ b/pyqm-week4/README.md @@ -1,4 +1,4 @@ -# Week 4 Contents +# Week 4: Numpy ## 4.1 - Numpy Basics - [[Notebook]](./notebooks/pyqm-4.1-numpy-basics.ipynb) - [[Video]](https://www.youtube.com/watch?v=508EUmhzjPs) @@ -32,3 +32,10 @@ - Polynomials - Data Analysis - I/O + +## 4.5 [Cheatsheet](./notebooks/pyqm-4.5-cheatsheet.ipynb) + +## 4.6 [Tutorial](PyQM_Tut.4_sol.ipynb) + +## 4.7 [Exercises ](PyQM_Ex.4_sol.ipynb) + diff --git a/pyqm-week4/pyqm-4.0-overview.ipynb b/pyqm-week4/pyqm-4.0-overview.ipynb deleted file mode 100644 index dd47f33..0000000 --- a/pyqm-week4/pyqm-4.0-overview.ipynb +++ /dev/null @@ -1,116 +0,0 @@ -{ - "cells": [ - { - "cell_type": "markdown", - "id": "0a31e3f6", - "metadata": {}, - "source": [ - "#
Python For Quantum Mechanics
\n", - "\n", - "#
Week 4: Overview
" - ] - }, - { - "cell_type": "markdown", - "id": "0aad66d5", - "metadata": {}, - "source": [ - "## [4.1 Numpy Basics](./notebooks/pyqm-4.1-numpy-basics.ipynb) \n", - "\n", - "- Numpy Arrays\n", - "- Copying Arrays\n", - "- Basic Operators\n", - "- Numpy Constants\n", - "- Mathematical Functions\n", - "- 0-Dimensional Arrays\n", - "- Multi-Dimensional Arrays" - ] - }, - { - "cell_type": "markdown", - "id": "ee3f0dae", - "metadata": {}, - "source": [ - "## [4.2 Numpy Array Creation & Manipulation](./notebooks/pyqm-4.2-numpy-array-creation-manipulation.ipynb) \n", - "\n", - "- Methods To Create Numpy Arrays\n", - "- Non-Numerical Data Types\n", - "- Indexing Numpy Arrays\n", - "- Slicing Numpy Arrays\n", - "- Array Manipulation" - ] - }, - { - "cell_type": "markdown", - "id": "67cda282", - "metadata": {}, - "source": [ - "## [4.3 Numpy Linear Algebra ](./notebooks/pyqm-4.3-numpy-linear-algebra.ipynb) \n", - "\n", - "- Scalar Array Operations\n", - "- Element-Wise Operations\n", - "- Matrix Algera\n", - "- Matrix Transformations\n" - ] - }, - { - "cell_type": "markdown", - "id": "00ffdf83", - "metadata": {}, - "source": [ - "## [4.4 Numpy Tools ](./notebooks/pyqm-4.4-numpy-tools.ipynb) \n", - "\n", - "- Random Sampling\n", - "- Binary Operations\n", - "- Polynomials\n", - "- Data Analysis\n", - "- I/O" - ] - }, - { - "cell_type": "markdown", - "id": "93172df0", - "metadata": {}, - "source": [ - "## [4.5 Cheatsheet ](./notebooks/pyqm-4.5-cheatsheet.ipynb) " - ] - }, - { - "cell_type": "markdown", - "id": "599e9dc4", - "metadata": {}, - "source": [ - "## [Tutorial](PyQM_Tut.4_sol.ipynb) " - ] - }, - { - "cell_type": "markdown", - "id": "506f6782", - "metadata": {}, - "source": [ - "## [Exercises ](PyQM_Ex.4_sol.ipynb) " - ] - } - ], - "metadata": { - "kernelspec": { - "display_name": "Python 3 (ipykernel)", - "language": "python", - "name": "python3" - }, - "language_info": { - "codemirror_mode": { - "name": "ipython", - "version": 3 - }, - "file_extension": ".py", - "mimetype": "text/x-python", - "name": "python", - "nbconvert_exporter": "python", - "pygments_lexer": "ipython3", - "version": "3.9.6" - } - }, - "nbformat": 4, - "nbformat_minor": 5 -} diff --git a/pyqm-week5/README.md b/pyqm-week5/README.md index 107b77f..f8a7eb3 100644 --- a/pyqm-week5/README.md +++ b/pyqm-week5/README.md @@ -1,19 +1,42 @@ -# Week 5 Contents +# Week 5: Matplotlib ## 5.1 - Line Plots - [[Notebook]](./notebooks/pyqm-5.1-line-plots.ipynb) - [[Video]](https://www.youtube.com/watch?v=D50f3tPYUiM) - Using plt.plot + - Plotting a line between two points + - Plotting line between multiple points + - Plotting a function + - Plotting two lines in the same figure - Plot Aesthetics + - Changing line colour + - Changing line width + - Changing line style + - Changing marker style - Axis Formatting + - Setting limits + - Changing ticks + - Adding grids - Labels + - Adding a title + - Labeling axes - Error Bars - Asymptotes and Annotations - Log Plots + - Making log-log plots + - Making semi-log plots - Figure Object + - Creating a figure + - Adding axes to figure + - Adjusted functions + - Saving an image ## 5.2 - Multiple and Alternative Plots - [[Notebook]](./notebooks/pyqm-5.2-multiple-and-alternative-plots.ipynb) - [[Video]](https://www.youtube.com/watch?v=842vyBG-apQ) - Subplots + - Making sub-plots using `plt.subplot()` + - Plots in Plots + - Making sub-plots using `fig.add_subplot()` + - Making sub-plots using `plt.subplots()` - Histograms - Scatter Plot - Bar Chart @@ -26,3 +49,23 @@ - Surface Plot - Interactive Backend - Animation + - Making an initialisation function + - Making an animation function + - Animating a plot + - Saving an animation + +## 5.4 [Cheatsheet](./notebooks/pyqm-5.4-cheatsheet.ipynb) + +## 5.5 [Tutorial](Week5_Exercises/PyQM_Tut.5.ipynb) +1. Noise in qubits +2. Particle in a Box +3. Normal Distribution +4. Monte Carlo $\pi$ Estimation +5. Ball Animation + +## 5.6 [Exercises](Week5_Exercises/PyQM_Ex.5.ipynb) +1. Settlers of Histogram +2. Normal Distribution +3. Particle in a Box +4. Plotting a Sphere +5. Snake Animation diff --git a/pyqm-week5/notebooks/first_image.png b/pyqm-week5/notebooks/first_image.png index d141c65..0e568b1 100644 Binary files a/pyqm-week5/notebooks/first_image.png and b/pyqm-week5/notebooks/first_image.png differ diff --git a/pyqm-week5/notebooks/my_animation.gif b/pyqm-week5/notebooks/my_animation.gif index d48aea5..87e0db3 100644 Binary files a/pyqm-week5/notebooks/my_animation.gif and b/pyqm-week5/notebooks/my_animation.gif differ diff --git a/pyqm-week5/pyqm-5.0-overview.ipynb b/pyqm-week5/pyqm-5.0-overview.ipynb deleted file mode 100644 index 4dd161c..0000000 --- a/pyqm-week5/pyqm-5.0-overview.ipynb +++ /dev/null @@ -1,148 +0,0 @@ -{ - "cells": [ - { - "cell_type": "markdown", - "metadata": { - "cell_id": "00000-0c627834-4356-498b-9c36-749c9e64d4a1", - "deepnote_cell_type": "code", - "tags": [] - }, - "source": [ - "#
Python For Quantum Mechanics
\n", - "#
Overview: Week 5
" - ] - }, - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "## [5.1 Line Plots](./notebooks/pyqm-5.1-line-plots.ipynb)\n", - "\n", - "- Using plt.plot\n", - " - Plotting a line between two points\n", - " - Plotting line between multiple points\n", - " - Plotting a function\n", - " - Plotting two lines in the same figure\n", - "- Plot Aesthetics\n", - " - Changing line colour\n", - " - Changing line width\n", - " - Changing line style\n", - " - Changing marker style\n", - "- Axis Formatting\n", - " - Setting limits\n", - " - Changing ticks\n", - " - Adding grids\n", - "- Labels\n", - " - Adding a title\n", - " - Labeling axes\n", - "- Error Bars\n", - "- Asymptotes and Annotations\n", - "- Log Plots\n", - " - Making log-log plots\n", - " - Making semi-log plots\n", - "- Figure Object\n", - " - Creating a figure\n", - " - Adding axes to figure\n", - " - Adjusted functions\n", - " - Saving an image" - ] - }, - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "## [5.2 Multiple and Alternative Plots](./notebooks/pyqm-5.2-multiple-and-alternative-plots.ipynb)\n", - "\n", - "- Subplots\n", - " - Making sub-plots using `plt.subplot()`\n", - " - Plots in Plots\n", - " - Making sub-plots using `fig.add_subplot()`\n", - " - Making sub-plots using `plt.subplots()`\n", - "- Histograms\n", - "- Scatter Plot\n", - "- Bar Chart\n", - "- Pie Chart" - ] - }, - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "## [5.3 3D Plots and Animations](./notebooks/pyqm-5.3-3d-plots-and-animations.ipynb)\n", - "- 3D Line Plot\n", - "- Heatmap\n", - "- Surface Plot\n", - "- Interactive Backend\n", - "- Animation\n", - " - Making an initialisation function\n", - " - Making an animation function\n", - " - Animating a plot\n", - " - Saving an animation" - ] - }, - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "## [5.4 Cheatsheet](./notebooks/pyqm-5.4-cheatsheet.ipynb) " - ] - }, - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "## [Tutorial 5](Week5_Exercises/PyQM_Tut.5.ipynb) \n", - "1. Noise in qubits\n", - "2. Particle in a Box\n", - "3. Normal Distribution\n", - "4. Monte Carlo $\\pi$ Estimation\n", - "5. Ball Animation" - ] - }, - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "## [Exercises 5](Week5_Exercises/PyQM_Ex.5.ipynb) \n", - "1. Settlers of Histogram\n", - "2. Normal Distribution\n", - "3. Particle in a Box\n", - "4. Plotting a Sphere\n", - "5. Snake Animation" - ] - }, - { - "cell_type": "code", - "execution_count": null, - "metadata": {}, - "outputs": [], - "source": [] - } - ], - "metadata": { - "deepnote": { - "is_reactive": false - }, - "deepnote_execution_queue": [], - "deepnote_notebook_id": "38861478-975f-4137-b527-c4aa3d4bf9cf", - "kernelspec": { - "display_name": "Python 3", - "language": "python", - "name": "python3" - }, - "language_info": { - "codemirror_mode": { - "name": "ipython", - "version": 3 - }, - "file_extension": ".py", - "mimetype": "text/x-python", - "name": "python", - "nbconvert_exporter": "python", - "pygments_lexer": "ipython3", - "version": "3.8.8" - } - }, - "nbformat": 4, - "nbformat_minor": 2 -} diff --git a/pyqm-week6/README.md b/pyqm-week6/README.md index 369b93c..8f7b2e7 100644 --- a/pyqm-week6/README.md +++ b/pyqm-week6/README.md @@ -1,4 +1,4 @@ -# Week 6 Contents +# Week 6: SciPy ## 6.1 - Scipy Linear Algebra - [[Notebook]](./notebooks/pyqm-6.1-scipy-linear-algebra.ipynb) - [[Video]](https://youtu.be/EQWi8rliCqY) @@ -37,3 +37,9 @@ - ODE - Finite Difference Method - PDE + +## 6.5 [Cheatsheet](./notebooks/pyqm-6.6-cheatsheet.ipynb) + +## 6.6 [Tutorial](PyQM_Tut.6_sol.ipynb) + +## 6.7 [Exercises](PyQM_Ex.6_sol.ipynb) \ No newline at end of file diff --git a/pyqm-week6/pyqm-6.0-overview.ipynb b/pyqm-week6/pyqm-6.0-overview.ipynb deleted file mode 100644 index 2c1f39a..0000000 --- a/pyqm-week6/pyqm-6.0-overview.ipynb +++ /dev/null @@ -1,127 +0,0 @@ -{ - "cells": [ - { - "cell_type": "markdown", - "id": "b30fbde7", - "metadata": {}, - "source": [ - "
\n", - "\n", - "# Python For Quantum Mechanics\n", - "# Week 6: Overview\n", - "\n", - "
" - ] - }, - { - "cell_type": "markdown", - "id": "21ce6bb1", - "metadata": {}, - "source": [ - "## [6.1 Scipy Linear Algebra](./notebooks/pyqm-6.1-scipy-linear-algebra.ipynb) \n", - "\n", - "- Linear Systems\n", - "- Matrix Functions\n", - "- Spectral Decomposition\n", - "- Special Matrices\n", - "\n", - "- Sparse Matrix\n", - "- Matrix Exponential\n", - "\n", - "- Unitary Matrix\n", - "- Tensor Product\n", - "\n", - "- Linalg Least Square Fit\n", - "\n", - "- Single Value Decomposition\n", - "- Schur Decomposition" - ] - }, - { - "cell_type": "markdown", - "id": "dbfeddb1", - "metadata": {}, - "source": [ - "## [6.2 Scipy Optimization](./notebooks/pyqm-6.2-scipy-optimization.ipynb) \n", - "\n", - "- Function Minimum\n", - "- Global Optimization\n", - "- Function Roots\n", - "- Optimize Least Square Fit\n", - "- Curve Fit" - ] - }, - { - "cell_type": "markdown", - "id": "cfa7f8dd", - "metadata": {}, - "source": [ - "## [6.3 Scipy Fourier Transform](./notebooks/pyqm-6.3-scipy-fourier-transform.ipynb) \n", - "\n", - "- The Fourier Transform\n", - "- Wave Packet\n", - "- The Uncertainty Principle\n", - "- Quantum Fourier Transform\n", - "- The Bloch Sphere" - ] - }, - { - "cell_type": "markdown", - "id": "97146fc7", - "metadata": {}, - "source": [ - "## [6.4 Scipy ODEs & PDEs](./notebooks/pyqm-6.4-scipy-ode-pde.ipynb) \n", - "\n", - "- Integration\n", - "- ODE\n", - "- Finite Difference Method\n", - "- PDE" - ] - }, - { - "cell_type": "markdown", - "id": "d55025e6", - "metadata": {}, - "source": [ - "## [6.6 Cheatsheet ](./notebooks/pyqm-6.6-cheatsheet.ipynb) " - ] - }, - { - "cell_type": "markdown", - "id": "95eb02de", - "metadata": {}, - "source": [ - "## [Tutorial](PyQM_Tut.6_sol.ipynb) " - ] - }, - { - "cell_type": "markdown", - "id": "2e0303d3", - "metadata": {}, - "source": [ - "## [Exercises ](PyQM_Ex.6_sol.ipynb) " - ] - } - ], - "metadata": { - "kernelspec": { - "display_name": "Python 3 (ipykernel)", - "language": "python", - "name": "python3" - }, - "language_info": { - "codemirror_mode": { - "name": "ipython", - "version": 3 - }, - "file_extension": ".py", - "mimetype": "text/x-python", - "name": "python", - "nbconvert_exporter": "python", - "pygments_lexer": "ipython3", - "version": "3.9.6" - } - }, - "nbformat": 4, - "nbformat_minor": 5 -} diff --git a/references.bib b/references.bib new file mode 100644 index 0000000..e69de29 diff --git a/requirements.txt b/requirements.txt new file mode 100644 index 0000000..6ac4fd6 --- /dev/null +++ b/requirements.txt @@ -0,0 +1,7 @@ +jupyter-book +jupytercards +jupyterquiz +matplotlib +numpy +sphinxcontrib.mermaid +sphinxcontrib.tikz