This workshop is given as part of the graduate-level Thin Film Coatings (given by Prof. Dr. Esra Zayim) course at Istanbul Technical University by Bahrem Serhat Danis. It is designed to introduce students to the tmmax
Python library, which facilitates fast and efficient simulations of thin film materials.
In this workshop, you will how to simulate thin film materials and their properties using tmmax. We will guide you step-by-step through setting up your environment, installing the necessary tools, and running your first simulations.
Before starting the workshop, ensure you have Python installed on your system. If you don’t have Python, please follow the steps below to install it.
To install Python, we recommend using Anaconda as it simplifies the process of managing Python environments and dependencies.
For Windows, Mac, and Linux:
-
Download Anaconda:
- Go to the Anaconda Downloads page (https://www.anaconda.com/products/individual) and select the appropriate version of Anaconda for your operating system (Windows, Mac, or Linux).
- Follow the installation instructions for your OS.
-
Install Anaconda:
- On Windows, run the downloaded .exe file.
- On Mac and Linux, follow the terminal instructions after downloading the appropriate .pkg or .sh file.
After installing Anaconda, you can create a virtual environment to isolate your Python packages for this workshop.
-
Open the Anaconda Prompt or Terminal:
- Windows: Open the Anaconda Prompt.
- Mac/Linux: Open the Terminal.
-
Create a Virtual Environment: Run the following command to create a virtual environment for the tmmax library:
conda create --name tmmax_env python=3.9
- Activate the Virtual Environment:
After creating the virtual environment, activate it with the following command:
conda activate tmmax_env
With the virtual environment activated, you can now install tmmax using pip.
- Install tmmax:
pip install tmmax
In this step, we’ll set up Jupyter Notebook to use the virtual environment (tmmax_env) as a kernel. Jupyter Notebooks allow you to run and interact with Python code directly from your browser.
- Install Jupyter Notebook (if not already installed):
conda install jupyter
- Install IPython Kernel:
This will allow the Jupyter Notebook to recognize your virtual environment.
pip install ipykernel
- Create a Jupyter Kernel for the Virtual Environment:
Now, register the virtual environment as a Jupyter kernel:
python -m ipykernel install --user --name=tmmax_env --display-name "Python (tmmax_env)"
Now that your environment is set up, you can launch Jupyter Notebook and start working with tmmax in the notebook interface.
- Start Jupyter Notebook:
Run the following command to start Jupyter Notebook:
jupyter notebook
This will open Jupyter Notebook in your web browser.
- Select the Kernel:
Once the Jupyter Notebook interface is open, create a new notebook:
-
Click on New in the top right corner.
-
Select Python (tmmax_env) from the dropdown menu to use the virtual environment kernel.