Skip to content

Latest commit

 

History

History
92 lines (69 loc) · 2.11 KB

File metadata and controls

92 lines (69 loc) · 2.11 KB

Environment Setup Guide

Python Environment

1. Create and activate a virtual environment

# Create
python -m venv .venv

# Activate
# Linux / macOS:
source .venv/bin/activate
# Windows PowerShell:
.venv\Scripts\Activate.ps1
# Windows CMD:
.venv\Scripts\activate.bat

2. Install Python dependencies

pip install -r requirements.txt

3. Verify installation

import numpy as np
import scipy
import qiskit
print(f"NumPy:  {np.__version__}")
print(f"SciPy:  {scipy.__version__}")
print(f"Qiskit: {qiskit.__version__}")

Q# Environment (for Notebook 09)

Option A: Azure Quantum Development Kit (recommended)

  1. Install the QDK for VS Code:

    • Open VS Code → Extensions → search for "Azure Quantum Development Kit" → Install.
    • This provides Q# language support, syntax highlighting, and the Q# kernel for Jupyter.
  2. Install the qsharp Python package:

    pip install qsharp
  3. Verify:

    import qsharp
    print(qsharp.__version__)

Option B: Standalone Q# compiler

  1. Install the .NET 8 SDK.
  2. Install the QDK project templates:
    dotnet new install Microsoft.Quantum.ProjectTemplates
  3. Navigate to the qsharp/ folder and build:
    cd qsharp
    dotnet build

Launching Notebooks

# From the repository root
jupyter lab notebooks/

Open notebooks in numerical order (01 → 10) for the intended learning progression.


Troubleshooting

Issue Solution
ModuleNotFoundError: No module named 'qiskit' Run pip install -r requirements.txt inside your virtual environment
Qiskit version conflicts Use pip install --upgrade qiskit qiskit-aer qiskit-algorithms
Q# kernel not showing in Jupyter Install qsharp package: pip install qsharp and restart Jupyter
Matplotlib plots not rendering Ensure %matplotlib inline is at the top of each notebook
Large matrix computations are slow Notebooks with n > 12 qubits require significant RAM; reduce n if needed