This will be a guide for users of Windows (10 or above) who wish to tap into quantum research frameworks quickly and easily. These same tools can be easily used in Linux or on MacOS with only slight adaptations. I’ll start from the beginning with you and breakdown simple concepts behind Python and how virtual environments work, then I’ll delve into how you can install Qiskit and use Jupyter notebooks to keep your projects and experiments organized. I’ll also go into how you can use VS Code to include AI in your coding processes seamlessly.
My goal is to give you both the access and ability to innovate in an upcoming field, something that is often plagued with gatekeeping and barriers to entry. All information I share and discuss is publicly available online for those willing to research and find it. I’m just presenting it in a format to help you get to the experimentation more quickly and easily.
In this guide, we will be creating a virtual environment and using Qiskit to emulate a quantum computer in order to run code that creates a cipher and ciphertext in a superposition state.
Now, we have to go through steps to get to that goal. We will do it together. I will be covering a lot of topics that touch on quantum computing concepts and quantum cryptography before we can do the final experiment.
Step 1: Download the current stable release of Python
- Navigate to https://www.python.org/downloads/ and download the most recent installer for Windows
- Check the box to add Python 3.x TO PATH
- Check the box to install the py launcher for all users
What is Python in this context? Python is the programming language you’ll use to run Qiskit and other tools, and a virtual environment (venv) is an isolated workspace that keeps your project’s Python packages separate from the system Python, preventing conflicts and making experiments reproducible.
Step 2: Create your project folder
- Create a folder somewhere easy to remember, like:
C:\Users\<username>\OneDrive\Documents\Python Projects\Qiskit\
Step 3: Use Powershell to complete your Setup
- Run: Powershell.exe as your local user account
- Verify that your Python installation was successful
- Run Command:
python --version–
- This should simply return a version number, confirming successful installation
- Run Command:
- Create your virtual environment (venv)
- Run: python -m venv .venv_superposition_ciphertext
- Note: You can name the .venv whatever you want, but it’s best if you’re project specific and keep your projects separated by virtual environment
- Activate the virtual environment you just created
- Run Command:
Set-ExecutionPolicy -Scope Process -ExecutionPolicy Bypass
- Note: This step is important, it bypasses built in security that prevents scripts from running. This only works temporarily in session and for the virtual environment you just created. Never bypass this to run scripts that you are unfamiliar with.
- Run Command:
.venv_superposition_ciphertext\Scripts\Activate.ps1- You should see green text appear in front of your command line in powershell, showing that the virtual environment is now active:
- (.venv_superposition_ciphertext)
- Run Command:
- Create a text file for your project virtual environment dependencies
- Create requirements_qiskit.txt and include the following lines of text:
- qiskit
- qiskit-ibm-runtime
- qiskit[visualization]
- jupyter
- Run command:
pip install -r requirements_qiskit.txt
- All of the required dependencies should now install without error
- Create requirements_qiskit.txt and include the following lines of text:
Step 4: Jupyter Notebook
- Create your folders for Jupyter Notebooks:
- Create the folder in the venv parent directory, adjacent to where your Python virtual environment sits, for example:
- C:\Users\[Joe]\OneDrive\Documents\Python Projects\Qiskit\JupyterNotebooks
mkdir <your chosen project directory path>\JupyterNotebooks\- This folder will store all of your future project .ipynb files
- Create another folder to store data for each future project, this will keep things organized for later:
- C:\Users\[Joe]\OneDrive\Documents\Python Projects\Qiskit\JupyterNotebooks\data
mkdir <your chosen project directory path>\JupyterNotebooks\data- This folder will store any datasets or output files from your future projects
- From the \JupyterNotebooks\ folder you created, test to make sure the installation is working and that you can see the virtual environment you created.
- Run command:
jupyter notebook
- This should open a browser with a loopback address, pointing to the Jupyter web interface, displaying your project contents inside.
- Close the browser window after verifying it loads properly.
Step 5: Install VS Code
- Navigate to:
- https://code.visualstudio.com/docs/setup/windows
- Follow the instructions and download VS Code. Make sure you choose to install Git and other options if desired.
- Open VS Code and configure and link your Github account if desired.
VS Code can use AI to help you code directly in VS Code. It’s incredibly useful and time saving if you grasp the conceptual framework behind most programming languages. Memorizing syntax has never been my strength, personally, and thankfully quantum computing leans heavily into conceptual frameworks. So, for all of us physics and quantum mechanics nerds: It’s finally our time to shine!
With our setup ready and the conceptual groundwork in place, we’re ready to dive in. In Part 2, we’ll explore how to use the tools we’ve installed and introduce the foundational ideas behind quantum programming.
References
Download Python : https://www.python.org/downloads/
Qiskit SDK information : https://pypi.org/project/qiskit/
IBM Qiskit Installation guide and extended information : https://quantum.cloud.ibm.com/docs/en/guides/install-qiskit
VS Code Information : https://code.visualstudio.com/docs/setup/setup-overview
Leave a Reply