Learning Quantum Computing with Python
August 25, 2025
My Journey Into Quantum Computing
Recently, as part of my ACM membership, I attended a web seminar led by Constantin Gonciulea and Charlee Stefanski on how to start writing applications for quantum computers.
Their main argument was simple:
The technology has advanced to the point where you no longer need a PhD in physics or mathematics to begin developing quantum applications.
During the seminar, they also promoted their book Building Quantum Software with Python: A Developer's Guide, which I decided to follow as the foundation of my learning journey.
This blog series will chronicle my foray into the realm of quantum computing as I work through the material. Because the topic is so broad, i'm sure this will be the first of many posts.
Getting Started: First Impressions
The first three chapters of the book provide an excellent introduction to:
- Quantum states and systems
- How to calculate outcome probabilities
- Writing Python code to visualize concepts
Working through these chapters has been incredibly rewarding, even if challenging. My biggest hurdle so far has been understanding the underlying mathematics, including:
- Wave functions
- Probability calculations based on phase, amplitude, and direction
- Trigonometric concepts like sine, cosine, and tangent and how they relate to the unit circle
To deepen my understanding, I spent hours conversing with ChatGPT. This helped me write Python scripts to visualize mathematical concepts and explore how complex number wave functions map to quantum state probabilities and probability density.
If you're curious, you can read my full ChatGPT transcript here.
Understanding Superposition
One of the first core concepts to grasp is superposition.
In classical computing, a bit is always either 0 or 1.
In quantum computing, a qubit can exist in all possible states simultaneously until measured.
Once a measurement is made, the wave function collapses, and the qubit's state resolves to a definite 0 or 1. This idea—that a particle exists in multiple states until observed—forms the foundation of quantum mechanics.
My First Quantum Scripts
To really internalize the concepts, I started writing my own Python scripts:
-
ComplexNumbers.py
My first custom class to calculate quantum states and probabilities manually. -
QuantumStates.py
The book’s working example, which I later compared against my implementation to validate my results.
I was thrilled to discover that my calculations matched the book's examples exactly.
Example: Magnitude of a Complex Number
Here’s an example from my early tests:
import math
# Given amplitude values
x = -0.3415
y = 0.4282j
z = x + y
# Method 1: Using math.sqrt
magnitude = math.sqrt(x**2 + y.real**2)
print(f"Magnitude: {magnitude}")
# Method 2: Using Python's built-in abs() for complex numbers
z_abs = abs(z)
print(f"Magnitude (abs): {z_abs}")The book uses the same approach:
# Get the magnitude using abs()
print(f"abs(state[0]): {abs(state[0])}")This alignment gave me a lot of confidence as I continued coding.
Visualizing Math with Python
To help me visualize some of the abstract math, I created several Python scripts with ChatGPT’s assistance:
- Trig.py – Sine, cosine, and tangent plots
- WaveInterference.py – Exploring constructive and destructive interference
- UnitCircle.py – Unit circle visualizations tied to trigonometric wave functions
What's Next
In my next post, I’ll begin exploring:
- Single-qubit quantum computing simulators
- Modifying outcome probabilities using quantum gates
Stay tuned as the journey continues!
Key Takeaways So Far
- You don’t need to be a physicist to start exploring quantum computing.
- Writing your own scripts—no matter how simple—helps you internalize the math and concepts.
- Visualization is a powerful tool for understanding abstract topics.