File size: 4,472 Bytes
e83ab3c
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
---

title: Hand-wave Quantum Solver
emoji: 🌊
colorFrom: blue
colorTo: purple
sdk: streamlit
sdk_version: "1.28.0"
app_file: app.py
pinned: false
---


# βš›οΈ Quantum Potential Solver

**Author:** Ahilan Kumaresan  
**Institution:** Simon Fraser University  
**Field:** Mathematical & Computational Physics

---

## 🎯 Overview

An advanced numerical solver for the **Time-Independent SchrΓΆdinger Equation** (TISE) using the Finite Difference Method. This project demonstrates rigorous computational physics methodology with comprehensive verification against analytical solutions and external libraries.

## πŸ”¬ Key Features

### 1. **Accurate Numerical Solver**
- **Method:** 3-point Central Difference stencil for the Laplacian operator
- **Grid:** Adaptive resolution (1000-2000 points)
- **Units:** Hartree Atomic Units (ℏ=1, m=1)
- **Boundary Conditions:** Dirichlet (infinite walls)

### 2. **Multiple Potential Types**
- Infinite Square Well
- Harmonic Oscillator
- Double Well Potential
- Custom potentials via hand gestures (camera input)

### 3. **Interactive Visualizations**
- Plotly-based interactive charts
- Wavefunction probability densities
- Energy level diagrams
- Real-time solver performance metrics

### 4. **Rigorous Verification**

#### Analytical Benchmarks
| System | Max Error |
|--------|-----------|
| Infinite Square Well | < 0.003% |
| Harmonic Oscillator | < 0.02% |
| Half-Harmonic Oscillator | < 0.8% |
| Triangular Potential | < 0.003% |

#### External Library Comparison
- **Cross-verified with QMSolve** (Python quantum mechanics package)
- **Double Well Potential:** Agreement within 0.25%
- Demonstrates accuracy for systems without analytical solutions

## πŸ“ Mathematical Foundation

The solver discretizes the TISE:

$$\hat{H}\psi(x) = E\psi(x)$$

$$\left[ -\frac{\hbar^2}{2m}\frac{d^2}{dx^2} + V(x) \right]\psi(x) = E\psi(x)$$

Using finite differences:

$$\frac{d^2\psi}{dx^2} \approx \frac{\psi_{i+1} - 2\psi_i + \psi_{i-1}}{\Delta x^2}$$



This transforms the problem into a matrix eigenvalue equation solved via `numpy.linalg.eigh`.



## πŸ› οΈ Technical Implementation



- **Language:** Python 3.12

- **Core Libraries:** NumPy, SciPy

- **Visualization:** Plotly, Matplotlib

- **UI Framework:** Streamlit

- **Computer Vision:** MediaPipe (for hand gesture input)



## πŸ“Š Verification Scripts



The project includes comprehensive verification:

- `verify_physics.py`: Analytical benchmarks
- `verify_comparison.py`: QMSolve cross-verification
- `Comparison_Notebook.ipynb`: Jupyter notebook with detailed analysis

## πŸŽ“ Academic Applications

This project demonstrates:
1. **Numerical Methods:** Finite difference discretization of differential operators
2. **Linear Algebra:** Eigenvalue problems for Hermitian matrices
3. **Quantum Mechanics:** Stationary states and energy quantization
4. **Software Engineering:** Modular design, comprehensive testing, professional documentation

## πŸ“– Usage

### Interactive Simulator
1. Select a potential type from the sidebar
2. Adjust parameters using sliders
3. View real-time solutions with interactive plots

### Verification Dashboard
- Navigate to "Benchmarks & Verification" to see accuracy metrics
- Compare against analytical solutions and QMSolve

### Theory Section
- Detailed mathematical background
- Implementation methodology
- Code verification

## πŸ”— Repository Structure

```

psi_solve2/

β”œβ”€β”€ app.py                      # Main Streamlit application

β”œβ”€β”€ functions.py                # Physics engine (solver + potentials)

β”œβ”€β”€ verify_physics.py           # Analytical verification script

β”œβ”€β”€ verify_comparison.py        # QMSolve comparison script

β”œβ”€β”€ Comparison_Notebook.ipynb   # Jupyter analysis notebook

└── requirements.txt            # Python dependencies

```

## πŸ“ Citation

If you use this solver in your research, please cite:

```

Kumaresan, A. (2024). Quantum Potential Solver: A Verified Finite Difference 

Implementation for the Time-Independent SchrΓΆdinger Equation. 

Simon Fraser University.

```

## πŸ“§ Contact

**Ahilan Kumaresan**  
Mathematical & Computational Physics  
Simon Fraser University

---

*This project showcases advanced computational physics methodology suitable for graduate-level research in quantum mechanics and numerical analysis.*