A code editor. It's free, open source, and runs everywhere (even your Ipad).
- Really good IntelliSense
- Debugging
- Integrated version control (Git)
- Highly customizable
- ctrl+shift+p -> Most useful, opens the command palette
- ctrl+k, ctrl+s -> Keyboard shortcuts, away with the mouse!
- ctrl+b -> Toggle Explorer
- ctrl+` -> Toggle Terminal
ChatGPT in your editor
Isolate workspaces on a per-project basis
Template Project Structure:
- project_name
- .venv
- .vscode
- .gitignore
- project_name
- __init__.py
- main.py
- requirements.txt
Steps
-
ctrl+shift+p
-> Python: Create Environment -
ctrl+shift+` to open new terminal in .venv
-
pip install -r requirements.txt
-
Create repo online and initialize it locally
echo "# project_name" >> README.md git init git add README.md git commit -m "first commit" git remote add origin git@github.com:username/project_name.git git push -u origin master
For management of different python environments use pyenv
Python Development
Extensions:
Remote development:
Capabilities:
CoPilot Example:
Code Generation:Function that gets the ground state of a given Hamiltonian H
-
Code generation Function that gets the ground state of a given Hamiltonian $H=\begin{bmatrix} 0 & 1 & 1 & 0\ 1 & 0 & 0 & -1\ 1 & 0 & 0 & -1\ 0 & -1 & -1 & 0 \end{bmatrix}$
Use Scipy sparse matrix instead and return smallest eigenvalue based on real part
-
Code explanation Factorial Docstring Binomial: The latex for this function is
-
Relative Imports
-
Debugging
-
Version Control
-
Pair Coding ctrl+shift+p -> Live Share: Start Collaboration Session
Prompts
The derivative of the function
% 3 by 3 Matrix with alphabetic entries
% Hamiltonian from cong et al:
The parameters for our model significantly influence the performance and jsutifies the usefulness of the framework
Scroll bar Git track changes
Extension:
- Latex Workshop
Markdown is powerful
Extensions:
- Code Spell Checker
- Markdown+Math
- markdownlint
Visualise vector addition:
Visualise projection: