Qiskit Textbook is a community project offering learning resources that will be useful to us.
Test Qiskit in a Python shell:
Fig: 1: Testing Qiskit in a Python shell. Note the Python version in the screenshot is not up to date.
The two commands in the screenshot above ☝ should not trigger any error.
Next, test Qiskit in JupyterLab or Visual Studio Code (preferred as of 2025 but discussed later). To launch JupyterLab, as per official documentation, open a Conda prompt (not Python shell) and type:
jupyter lab
Expect a web browser window to be launched, where you can create a new “Python 3 (ipykernel)” notebook:
Fig: 2: JupyterLab landing page.
Note ipykernel is an interactive Python kernel for Jupyter.
Copying the first
piece of code from the “Introduction to Qiskit” tutorial and pasting it into the newly created “Python 3 (ipykernel)” notebook should produce the circuit diagram
at the bottom of this screenshot:
Fig: 3: Sample Qiskit code running in Jupyter notebook.
Visual Studio Code is a popular and free alternative to a web browser for hosting Jupyter notebooks, and as of 2025, I recommend it over JupyterLab, because of the former’s superior support for internal links and LaTeX for typesetting equations.
To open a Jupyter notebook in Visual Studio Code, 1️⃣ open the folder the Jupyter notebook resides in, and 2️⃣ select the correct Conda virtual environmment as per Fig. 4.
Fig: 4: Opening a Jupyter notebook in Visual Studio Code: 1️⃣ open the folder the Jupyter notebook resides in, and 2️⃣ select the correct Conda virtual environmment.