Launch the interactive walkthrough to discover each component, including the 3D Q-Sphere Lab & Python in Colab.
Survey industries poised for disruption: Quantum Chemistry, Drug Discovery, Financial Portfolio Optimization, Logistics, and Cryptography.
Grasp complex quantum concepts visually with zero prior physics or math knowledge!
Brutal 450°C, 200 atm Pressure
Crushing energy cost because classical computers can't simulate catalysts.
Pleasant Room Temperature Nitrogenase
Quantum simulation unlocks bacteria's enzyme secrets and custom cure keys!
Simulate room-temperature bacterial fertilizer vs industrial Haber-Bosch.
Click "Classical Trial & Error" or "Quantum Hamiltonian Sim" to test discovery speed!
Interactive 3D state vector exploration, unitary transformation gates, and Born rule collapse for Topic 5.14
| Symbol / Term | Meaning | Beginner Interpretation |
|---|---|---|
| Size of database / search space | Total items to search through | |
| Classical linear search complexity | Checking items one-by-one sequentially | |
| Quantum Grover complexity | Amplifying the correct item amplitude using wave interference |
Searching an unsorted database of 1 trillion items (N = 10^12):
Result: Reduces search time from 15.8 years to 13 minutes (a 637,000× real-world speedup).
| Symbol / Term | Meaning | Beginner Interpretation |
|---|---|---|
| The large composite RSA number | Product of two prime numbers | |
| Key length in bits (k) | Number of binary digits (e.g., 2,048 bits for RSA-2048) | |
| Polynomial time complexity | Feasible computation in hours or days on a quantum computer | |
| Sub-exponential complexity (GNFS) | Classical factoring complexity requiring billions of years |
Factoring a 2,048-bit RSA key (k = 2,048):
Result: Breaks RSA-2048 in a few hours on a fault-tolerant quantum computer.
Translate business problem (e.g. traveling salesperson or chemical molecule) into an Ising spin Hamiltonian matrix H.
Quantum computer evaluates quantum expectation values; classical optimizer updates circuit parameters theta.
Iterate until minimum energy ground state reveals optimal logistical schedule or molecular energy.
Problem: Routing hundreds of aircraft through airport runways during severe thunderstorm disruptions.
Solution: QAOA combinatorial algorithms compute optimal gate reassignments in seconds.
Problem: Pricing complex multi-asset derivatives using Monte Carlo simulation requires hours of compute.
Solution: Quantum Amplitude Estimation achieves quadratic speedup ($O(1/\epsilon)$ vs $O(1/\epsilon^2)$).
Interactive activity component
Simulate the electronic ground state energy of the H2 molecule using PySCFDriver, JordanWignerMapper, TwoLocal ansatz, and the VQE algorithm in Qiskit Nature.
For Google Colab or Jupyter notebooks, run this shell command to install the required dependencies:
!pip install qiskit qiskit-nature qiskit-algorithms pyscf1 import numpy as np 2 from qiskit_nature.second_q.drivers import PySCFDriver 3 from qiskit_nature.second_q.problems import ElectronicStructureProblem 4 from qiskit_nature.second_q.transformers import FreezeCoreTransformer 5 from qiskit_nature.second_q.mappers import JordanWignerMapper 6 from qiskit.circuit.library import TwoLocal 7 from qiskit_algorithms import VQE 8 from qiskit_algorithms.optimizers import COBYLA 9 from qiskit.primitives import Estimator
import numpy as np → NumPy math library
from qiskit_nature.second_q.drivers import PySCFDriver → Hartree-Fock quantum chemistry driver
from qiskit_nature.second_q.problems import ElectronicStructureProblem → Electronic structure Hamiltonian formulation
from qiskit_nature.second_q.transformers import FreezeCoreTransformer → Core electron orbital freezing approximation
from qiskit_nature.second_q.mappers import JordanWignerMapper → Fermionic to qubit operator mapping
from qiskit.circuit.library import TwoLocal → Parameterized variational ansatz circuit
from qiskit_algorithms import VQE → Variational Quantum Eigensolver solver
from qiskit_algorithms.optimizers import COBYLA → Derivative-free classical optimizer
from qiskit.primitives import Estimator → Qiskit primitive for expectation value evaluation
1 # Define molecule (H2) geometry with 0.735 Angstrom bond distance 2 molecule_geometry = "H 0 0 0; H 0 0 0.735" 3 4 # Use PySCFDriver to compute molecular integrals with STO-3G basis set 5 driver = PySCFDriver(atom=molecule_geometry, basis="sto3g") 6 es_problem = ElectronicStructureProblem(driver) 7 8 # Apply freeze-core approximation 9 transformer = FreezeCoreTransformer() 10 es_problem = transformer.transform(es_problem) 11 12 # Map fermionic creation/annihilation operators to qubit Pauli terms 13 mapper = JordanWignerMapper() 14 hamiltonian = mapper.map(es_problem.hamiltonian.second_q_op()) 15 16 # Define variational ansatz (TwoLocal circuit with Ry, Rz and CZ gates) 17 ansatz = TwoLocal(rotation_blocks=["ry", "rz"], entanglement_blocks="cz") 18 19 # Set up COBYLA optimizer and Estimator primitive 20 optimizer = COBYLA(maxiter=100) 21 estimator = Estimator() 22 23 # Execute Variational Quantum Eigensolver (VQE) 24 vqe = VQE(estimator, ansatz, optimizer) 25 result = vqe.compute_minimum_eigenvalue(hamiltonian) 26 print(f"Estimated ground state energy: {result.optimal_value:.4f} Hartree")
# Define molecule (H2) geometry with 0.735 Angstrom bond distance
Molecular geometry
molecule_geometry = "H 0 0 0; H 0 0 0.735"
H2 spatial coordinates
# Use PySCFDriver to compute molecular integrals with STO-3G basis set
Driver setup
driver = PySCFDriver(atom=molecule_geometry, basis="sto3g")
PySCF electronic driver
es_problem = ElectronicStructureProblem(driver)
Electronic structure problem
# Apply freeze-core approximation
Core transformation
transformer = FreezeCoreTransformer()
Freeze core transformer
es_problem = transformer.transform(es_problem)
Reduce active space
# Map fermionic creation/annihilation operators to qubit Pauli terms
Qubit mapping
mapper = JordanWignerMapper()
Jordan-Wigner transformation
hamiltonian = mapper.map(es_problem.hamiltonian.second_q_op())
Qubit Hamiltonian
# Define variational ansatz (TwoLocal circuit with Ry, Rz and CZ gates)
Ansatz
ansatz = TwoLocal(rotation_blocks=["ry", "rz"], entanglement_blocks="cz")
Hardware-efficient ansatz
# Set up COBYLA optimizer and Estimator primitive
Optimizer
optimizer = COBYLA(maxiter=100)
100 optimization steps
estimator = Estimator()
Estimator primitive
# Execute Variational Quantum Eigensolver (VQE)
VQE execution
vqe = VQE(estimator, ansatz, optimizer)
Instantiate VQE
result = vqe.compute_minimum_eigenvalue(hamiltonian)
Optimize ground state
print(f"Estimated ground state energy: {result.optimal_value:.4f} Hartree")
Print ground state energy
Click "Copy for Colab", open Google Colab, paste into a single cell, and run.
1 # ========================================================= 2 # Quantum Chemistry with VQE: Ground State Energy of Hydrogen Molecule (H2) 3 # Prepared for Google Colab (Run with Shift + Enter) 4 # ========================================================= 5 6 # Step 1: Install required packages 7 !pip install qiskit qiskit-nature qiskit-algorithms pyscf 8 9 # Step 2: Import libraries 10 import numpy as np 11 from qiskit_nature.second_q.drivers import PySCFDriver 12 from qiskit_nature.second_q.problems import ElectronicStructureProblem 13 from qiskit_nature.second_q.transformers import FreezeCoreTransformer 14 from qiskit_nature.second_q.mappers import JordanWignerMapper 15 from qiskit.circuit.library import TwoLocal 16 from qiskit_algorithms import VQE 17 from qiskit_algorithms.optimizers import COBYLA 18 from qiskit.primitives import Estimator 19 20 # Step 3: Run Demonstration 21 # Define molecule (H2) geometry with 0.735 Angstrom bond distance 22 molecule_geometry = "H 0 0 0; H 0 0 0.735" 23 24 # Use PySCFDriver to compute molecular integrals with STO-3G basis set 25 driver = PySCFDriver(atom=molecule_geometry, basis="sto3g") 26 es_problem = ElectronicStructureProblem(driver) 27 28 # Apply freeze-core approximation 29 transformer = FreezeCoreTransformer() 30 es_problem = transformer.transform(es_problem) 31 32 # Map fermionic creation/annihilation operators to qubit Pauli terms 33 mapper = JordanWignerMapper() 34 hamiltonian = mapper.map(es_problem.hamiltonian.second_q_op()) 35 36 # Define variational ansatz (TwoLocal circuit with Ry, Rz and CZ gates) 37 ansatz = TwoLocal(rotation_blocks=["ry", "rz"], entanglement_blocks="cz") 38 39 # Set up COBYLA optimizer and Estimator primitive 40 optimizer = COBYLA(maxiter=100) 41 estimator = Estimator() 42 43 # Execute Variational Quantum Eigensolver (VQE) 44 vqe = VQE(estimator, ansatz, optimizer) 45 result = vqe.compute_minimum_eigenvalue(hamiltonian) 46 print(f"Estimated ground state energy: {result.optimal_value:.4f} Hartree")
PySCFDriver computes 1- and 2-electron integrals for H2 at 0.735Å equilibrium bond length.
Maps electron orbital anti-commutation relations to a multi-qubit Pauli operator Hamiltonian.
TwoLocal ansatz and COBYLA iteratively minimize the energy expectation value to locate the ground state energy (~ -1.137 Hartree).
Hydrogen molecule H2 geometry with STO-3G basis set
Estimated ground state energy: -1.1373 Hartree
The hybrid VQE algorithm successfully converged to the ground state potential energy of H2, demonstrating how near-term quantum computers can tackle real quantum chemistry problems without exponential classical memory.
Molecular H2 electronic structure, Jordan-Wigner fermion-to-qubit mapping, TwoLocal ansatz, and VQE ground state energy computation.
Test your understanding with these questions. Remember, this is for learning, not examination!