Launch the interactive walkthrough to discover each component, including the 3D Q-Sphere Lab & Python in Colab.
Explore industry transformations driven by quantum-enhanced AI in drug discovery, finance, climate modeling, and cybersecurity.
Interactive 3D state vector exploration, unitary transformation gates, and Born rule collapse for Topic 9.6
| Symbol / Term | Meaning | Beginner Interpretation |
|---|---|---|
| Molecular electronic Hamiltonian | Quantum operator describing electronic kinetic energy and Coulomb interactions | |
| Hamiltonian expansion coefficients | Pre-computed classical one- and two-electron molecular integrals | |
| Pauli tensor product strings | Multi-qubit observables (e.g. ) measured on quantum hardware | |
| Ground state electronic energy | Lowest possible energy level corresponding to stable chemical bonding | |
| Binding free energy difference | Negative value indicates spontaneous, thermodynamically favorable drug binding |
Calculating the ground state bonding energy of a Hydrogen molecule (H2 at bond distance R = 0.7414 A) using a 2-qubit Jordan-Wigner Hamiltonian:
Result: VQE successfully calculates the ground state energy of H2 within chemical accuracy (0.6 mHartree), identifying the stable molecular bond.
Map business challenges (e.g. battery cathode degradation) into electronic Hamiltonians or graph optimization matrices.
Pair classical domain software (e.g. PySCF for molecular orbitals) with quantum variational circuits.
Run targeted computational routines on cloud QPUs with continuous calibration and error mitigation.
Feed quantum outputs into classical enterprise software for automated chemistry synthesis or trading execution.
Problem: Simulating lithium dendrite formation in solid electrolytes requires modeling quantum electron transfer across interfacial boundaries.
Solution: Quantum-enhanced AI predicts solid-electrolyte interface stability, cutting material discovery time from 10 years to 18 months.
Problem: Criminal money laundering networks intentionally route through millions of small, cyclic, multi-jurisdiction accounts.
Solution: Quantum Graph Neural Networks (QGNN) detect non-local cyclic transaction topologies missed by classical anomaly detectors.
Interactive activity component
Model a portfolio asset selection problem with risk-return trade-offs formulated as a QUBO matrix.
For Google Colab or Jupyter notebooks, run this shell command to install the required dependencies:
!pip install numpy1 import numpy as np
import numpy as np → Import NumPy for numerical array and matrix math
1 # Expected returns for 3 assets (A, B, C) 2 mu = np.array([0.12, 0.18, 0.15]) 3 # Covariance matrix representing risk correlations 4 sigma = np.array([[0.04, 0.01, 0.02], [0.01, 0.09, 0.03], [0.02, 0.03, 0.06]]) 5 risk_aversion = 0.5 6 # QUBO formulation: minimize x^T * (risk_aversion * sigma) * x - mu^T * x 7 Q = risk_aversion * sigma - np.diag(mu) 8 print("QUBO Matrix for Portfolio Selection:") 9 print(np.round(Q, 4)) 10 # Test all 2^3 = 8 binary portfolio combinations 11 best_energy = float("inf"); best_combo = None 12 for i in range(8): 13 x = np.array([int(b) for b in f"{i:03b}"]) 14 energy = x.T @ Q @ x 15 if energy < best_energy: 16 best_energy = energy; best_combo = x 17 print(f"Optimal Portfolio Selection Bitstring: {best_combo} with Energy: {best_energy:.4f}")
# Expected returns for 3 assets (A, B, C)
Define returns
mu = np.array([0.12, 0.18, 0.15])
Expected returns vector
# Covariance matrix representing risk correlations
Define covariance
sigma = np.array([[0.04, 0.01, 0.02], [0.01, 0.09, 0.03], [0.02, 0.03, 0.06]])
Covariance matrix
risk_aversion = 0.5
Trade-off parameter between return and risk
# QUBO formulation: minimize x^T * (risk_aversion * sigma) * x - mu^T * x
Construct QUBO
Q = risk_aversion * sigma - np.diag(mu)
QUBO matrix for binary selections
print("QUBO Matrix for Portfolio Selection:")
Label
print(np.round(Q, 4))
Display QUBO matrix
# Test all 2^3 = 8 binary portfolio combinations
Exhaustive check for verification
best_energy = float("inf"); best_combo = None
Initialize tracking
for i in range(8):
Iterate all binary bitstrings
x = np.array([int(b) for b in f"{i:03b}"])
Binary bit vector
energy = x.T @ Q @ x
Evaluate cost
if energy < best_energy:
Check minimum
best_energy = energy; best_combo = x
Update best
print(f"Optimal Portfolio Selection Bitstring: {best_combo} with Energy: {best_energy:.4f}")
Print result
Click "Copy for Colab", open Google Colab, paste into a single cell, and run.
1 # ========================================================= 2 # Simulating Portfolio Risk Optimization with Quantum Annealing / QUBO 3 # Prepared for Google Colab (Run with Shift + Enter) 4 # ========================================================= 5 6 # Step 1: Install required packages 7 !pip install numpy 8 9 # Step 2: Import libraries 10 import numpy as np 11 12 # Step 3: Run Demonstration 13 # Expected returns for 3 assets (A, B, C) 14 mu = np.array([0.12, 0.18, 0.15]) 15 # Covariance matrix representing risk correlations 16 sigma = np.array([[0.04, 0.01, 0.02], [0.01, 0.09, 0.03], [0.02, 0.03, 0.06]]) 17 risk_aversion = 0.5 18 # QUBO formulation: minimize x^T * (risk_aversion * sigma) * x - mu^T * x 19 Q = risk_aversion * sigma - np.diag(mu) 20 print("QUBO Matrix for Portfolio Selection:") 21 print(np.round(Q, 4)) 22 # Test all 2^3 = 8 binary portfolio combinations 23 best_energy = float("inf"); best_combo = None 24 for i in range(8): 25 x = np.array([int(b) for b in f"{i:03b}"]) 26 energy = x.T @ Q @ x 27 if energy < best_energy: 28 best_energy = energy; best_combo = x 29 print(f"Optimal Portfolio Selection Bitstring: {best_combo} with Energy: {best_energy:.4f}")
Specify asset returns and covariance matrix.
Combine risk terms on off-diagonals and return incentives on the diagonal.
Demonstrate how the ground state corresponds to the best risk-adjusted asset basket.
Returns: [12%, 18%, 15%], Risk Aversion: 0.5
Optimal Portfolio Selection Bitstring: [1 1 1] (or risk-balanced combination) with minimal negative energy
The QUBO matrix encodes the entire Markowitz portfolio optimization problem, ready to be dispatched to a quantum annealer or QAOA circuit.
H2 molecular electronic structure and variational optimization.
Test your understanding with these questions. Remember, this is for learning, not examination!