AI4Plasma 0.1.0__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- ai4plasma-0.1.0/AI4Plasma.egg-info/PKG-INFO +422 -0
- ai4plasma-0.1.0/AI4Plasma.egg-info/SOURCES.txt +31 -0
- ai4plasma-0.1.0/AI4Plasma.egg-info/dependency_links.txt +1 -0
- ai4plasma-0.1.0/AI4Plasma.egg-info/requires.txt +10 -0
- ai4plasma-0.1.0/AI4Plasma.egg-info/top_level.txt +2 -0
- ai4plasma-0.1.0/LICENSE +504 -0
- ai4plasma-0.1.0/PKG-INFO +422 -0
- ai4plasma-0.1.0/README.md +393 -0
- ai4plasma-0.1.0/ai4plasma/__init__.py +13 -0
- ai4plasma-0.1.0/ai4plasma/config.py +41 -0
- ai4plasma-0.1.0/ai4plasma/core/__init__.py +7 -0
- ai4plasma-0.1.0/ai4plasma/core/model.py +465 -0
- ai4plasma-0.1.0/ai4plasma/core/network.py +872 -0
- ai4plasma-0.1.0/ai4plasma/operator/__init__.py +7 -0
- ai4plasma-0.1.0/ai4plasma/operator/deepcsnet.py +706 -0
- ai4plasma-0.1.0/ai4plasma/operator/deeponet.py +556 -0
- ai4plasma-0.1.0/ai4plasma/piml/__init__.py +15 -0
- ai4plasma-0.1.0/ai4plasma/piml/cs_pinn.py +2240 -0
- ai4plasma-0.1.0/ai4plasma/piml/geo.py +1248 -0
- ai4plasma-0.1.0/ai4plasma/piml/meta_pinn.py +1090 -0
- ai4plasma-0.1.0/ai4plasma/piml/nas_pinn.py +302 -0
- ai4plasma-0.1.0/ai4plasma/piml/pinn.py +1680 -0
- ai4plasma-0.1.0/ai4plasma/piml/rk_pinn.py +1090 -0
- ai4plasma-0.1.0/ai4plasma/plasma/__init__.py +7 -0
- ai4plasma-0.1.0/ai4plasma/plasma/arc.py +1296 -0
- ai4plasma-0.1.0/ai4plasma/plasma/prop.py +866 -0
- ai4plasma-0.1.0/ai4plasma/utils/__init__.py +11 -0
- ai4plasma-0.1.0/ai4plasma/utils/common.py +119 -0
- ai4plasma-0.1.0/ai4plasma/utils/device.py +215 -0
- ai4plasma-0.1.0/ai4plasma/utils/io.py +97 -0
- ai4plasma-0.1.0/ai4plasma/utils/math.py +233 -0
- ai4plasma-0.1.0/pyproject.toml +51 -0
- ai4plasma-0.1.0/setup.cfg +4 -0
|
@@ -0,0 +1,422 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: AI4Plasma
|
|
3
|
+
Version: 0.1.0
|
|
4
|
+
Summary: An AI Library for Plasma Physics Simulation
|
|
5
|
+
Author-email: Linlin Zhong <linlin@seu.edu.cn>
|
|
6
|
+
Project-URL: Homepage, https://github.com/mathboylinlin/ai4plasma
|
|
7
|
+
Project-URL: Documentation, https://ai4plasma.readthedocs.io
|
|
8
|
+
Keywords: Deep learning,Operator learning,Physics-informed machine learning,AI for Plasma Science,AI for Science,Plasma simulation,Multiphysics simulation
|
|
9
|
+
Classifier: Development Status :: 4 - Beta
|
|
10
|
+
Classifier: Intended Audience :: Science/Research
|
|
11
|
+
Classifier: Programming Language :: Python :: 3 :: Only
|
|
12
|
+
Classifier: Topic :: Scientific/Engineering
|
|
13
|
+
Classifier: Topic :: Scientific/Engineering :: Physics
|
|
14
|
+
Classifier: Topic :: Scientific/Engineering :: Artificial Intelligence
|
|
15
|
+
Requires-Python: >=3.10
|
|
16
|
+
Description-Content-Type: text/markdown
|
|
17
|
+
License-File: LICENSE
|
|
18
|
+
Requires-Dist: matplotlib
|
|
19
|
+
Requires-Dist: numpy
|
|
20
|
+
Requires-Dist: scipy
|
|
21
|
+
Requires-Dist: pandas
|
|
22
|
+
Requires-Dist: torch
|
|
23
|
+
Requires-Dist: tensorboard
|
|
24
|
+
Requires-Dist: imageio
|
|
25
|
+
Requires-Dist: fipy
|
|
26
|
+
Requires-Dist: shapely
|
|
27
|
+
Requires-Dist: huggingface-hub
|
|
28
|
+
Dynamic: license-file
|
|
29
|
+
|
|
30
|
+
# AI4Plasma
|
|
31
|
+
|
|
32
|
+
<p align="center">
|
|
33
|
+
<picture>
|
|
34
|
+
<img src="./docs/images/AI4Plasma_Logo.svg">
|
|
35
|
+
</picture>
|
|
36
|
+
</p>
|
|
37
|
+
|
|
38
|
+
[](https://github.com/mathboylinlin/ai4plasma/blob/main/LICENSE)
|
|
39
|
+
[](https://www.python.org/)
|
|
40
|
+
[](https://pytorch.org/)
|
|
41
|
+
[](https://ai4plasma.readthedocs.io)
|
|
42
|
+
|
|
43
|
+
**AI4Plasma** is a Python- and PyTorch-based library for physics-informed machine learning and operator learning, specifically designed for plasma physics simulation. As the world's first AI package dedicated to plasma simulation, AI4Plasma bridges the gap between cutting-edge AI techniques and plasma physics research, making it easier for plasma researchers to leverage AI tools to enhance both the efficiency and accuracy of their simulations.
|
|
44
|
+
|
|
45
|
+
Although there are several excellent predecessors such as DeepXDE, AI4Plasma is (and will always be) the AI algorithm package that understands plasma the most and the plasma algorithm package that understands AI the most. We welcome your testing and use, and also invite you to join the AI4Plasma development team.
|
|
46
|
+
|
|
47
|
+
<p align="center">
|
|
48
|
+
<picture>
|
|
49
|
+
<img src="./docs/images/AI4Plasma_Code.svg" width="800">
|
|
50
|
+
</picture>
|
|
51
|
+
</p>
|
|
52
|
+
|
|
53
|
+
## ✨ Key Features
|
|
54
|
+
|
|
55
|
+
- **Physics-Informed Machine Learning (PIML)**
|
|
56
|
+
- 🧠 **PINNs**: Classic Physics-Informed Neural Networks for solving PDEs
|
|
57
|
+
- 🎯 **CS-PINNs**: Coefficient-Subnet PINNs optimized for solving plasma equations with variable coefficients
|
|
58
|
+
- ⏰ **RK-PINNs**: Runge-Kutta PINNs for time-dependent problems
|
|
59
|
+
- 🔄 **Meta-PINNs**: Meta-learning approach for rapid adaptation across different physics scenarios
|
|
60
|
+
- 🔍 **NAS-PINNs**: Neural Architecture Search for automatic PINN architecture optimization
|
|
61
|
+
|
|
62
|
+
- **Operator Learning**
|
|
63
|
+
- 🌐 **DeepONet**: Deep Operator Networks for learning solution operators
|
|
64
|
+
- 🔬 **DeepCSNet**: Deep Operator Networks for predicting cross sections
|
|
65
|
+
|
|
66
|
+
- **Plasma Physics Models**
|
|
67
|
+
- ⚡ **Arc Plasma Simulation**: Steady and transient arc plasma simulations (1-D in current version)
|
|
68
|
+
- 📊 **Plasma Properties**: Built-in plasma property calculations and estimations
|
|
69
|
+
|
|
70
|
+
- **Comprehensive Utilities**
|
|
71
|
+
- 📐 **Geometry Tools**: 1D, 2D, and 3D domain definitions with flexible boundary conditions
|
|
72
|
+
- 🎨 **Visualization**: TensorBoard integration and custom plotting callbacks
|
|
73
|
+
- 🚀 **Auto-differentiation**: Efficient gradient computation for complex PDEs
|
|
74
|
+
- 💾 **I/O Management**: Easy model saving/loading and checkpoint management
|
|
75
|
+
- 🖥️ **GPU Support**: Automatic device detection and optimization
|
|
76
|
+
|
|
77
|
+
<p align="center">
|
|
78
|
+
<picture>
|
|
79
|
+
<img src="./docs/images/CS-PINN-Sta-Arc.gif" width="800">
|
|
80
|
+
</picture>
|
|
81
|
+
</p>
|
|
82
|
+
<p align="center">
|
|
83
|
+
<picture>
|
|
84
|
+
<img src="./docs/images/RK-PINN.gif" width="800">
|
|
85
|
+
</picture>
|
|
86
|
+
</p>
|
|
87
|
+
|
|
88
|
+
## 📦 Installation
|
|
89
|
+
|
|
90
|
+
### Install from PyPI
|
|
91
|
+
|
|
92
|
+
The easiest way to install AI4Plasma is via pip:
|
|
93
|
+
|
|
94
|
+
```bash
|
|
95
|
+
pip install ai4plasma
|
|
96
|
+
```
|
|
97
|
+
|
|
98
|
+
Or upgrade to the latest version:
|
|
99
|
+
|
|
100
|
+
```bash
|
|
101
|
+
pip install --upgrade ai4plasma
|
|
102
|
+
```
|
|
103
|
+
|
|
104
|
+
### Install from Source
|
|
105
|
+
|
|
106
|
+
For the latest development version:
|
|
107
|
+
|
|
108
|
+
```bash
|
|
109
|
+
git clone https://github.com/ai4plasma/ai4plasma.git
|
|
110
|
+
cd ai4plasma
|
|
111
|
+
pip install -e .
|
|
112
|
+
```
|
|
113
|
+
|
|
114
|
+
### Install with Conda
|
|
115
|
+
|
|
116
|
+
If you prefer using Conda/Mamba:
|
|
117
|
+
|
|
118
|
+
```bash
|
|
119
|
+
conda create -n ai4plasma python=3.12
|
|
120
|
+
conda activate ai4plasma
|
|
121
|
+
pip install -e .
|
|
122
|
+
```
|
|
123
|
+
|
|
124
|
+
### Prerequisites
|
|
125
|
+
|
|
126
|
+
- Python >= 3.10
|
|
127
|
+
- PyTorch >= 2.0
|
|
128
|
+
- NumPy, SciPy, Pandas, Matplotlib
|
|
129
|
+
- TensorBoard, Imageio (for visualization)
|
|
130
|
+
- FiPy (for traditional numerical methods comparison)
|
|
131
|
+
- Shapely (for geometry processing)
|
|
132
|
+
- Huggingface-hub (for downloading dataset from Hugging Face)
|
|
133
|
+
|
|
134
|
+
## 🚀 Quick Start
|
|
135
|
+
|
|
136
|
+
### Example 1: Solving a Simple PDE with PINN
|
|
137
|
+
|
|
138
|
+
Solve the 1D ODE: **d²u/dx² = -sin(x)** with boundary conditions **u(0) = u(1) = 0**
|
|
139
|
+
|
|
140
|
+
```python
|
|
141
|
+
import torch
|
|
142
|
+
import torch.nn as nn
|
|
143
|
+
from ai4plasma.config import REAL
|
|
144
|
+
from ai4plasma.piml.pinn import PINN
|
|
145
|
+
from ai4plasma.piml.geo import Geo1D
|
|
146
|
+
from ai4plasma.core.network import FNN
|
|
147
|
+
from ai4plasma.utils.math import df_dX, calc_relative_l2_err
|
|
148
|
+
from ai4plasma.utils.common import set_seed, numpy2torch
|
|
149
|
+
|
|
150
|
+
# Set seed for reproducibility
|
|
151
|
+
set_seed(2026)
|
|
152
|
+
|
|
153
|
+
# Define custom PINN class
|
|
154
|
+
class SimplePINN(PINN):
|
|
155
|
+
def __init__(self, network):
|
|
156
|
+
self.geo = Geo1D([0.0, 1.0])
|
|
157
|
+
super().__init__(network)
|
|
158
|
+
|
|
159
|
+
@staticmethod
|
|
160
|
+
def _pde_residual(network, x):
|
|
161
|
+
"""Compute residual: d²u/dx² + sin(x)"""
|
|
162
|
+
u = network(x)
|
|
163
|
+
u_x = df_dX(u, x)
|
|
164
|
+
u_xx = df_dX(u_x, x)
|
|
165
|
+
return u_xx + torch.sin(x)
|
|
166
|
+
|
|
167
|
+
@staticmethod
|
|
168
|
+
def _bc_residual(network, x):
|
|
169
|
+
"""Dirichlet BC: u(x) = 0"""
|
|
170
|
+
return network(x)
|
|
171
|
+
|
|
172
|
+
def _define_loss_terms(self):
|
|
173
|
+
"""Set up domain and boundary loss terms"""
|
|
174
|
+
x_domain = self.geo.sample_domain(100, mode='uniform')
|
|
175
|
+
x_bc = self.geo.sample_boundary()
|
|
176
|
+
|
|
177
|
+
self.add_equation('Domain', self._pde_residual, weight=1.0, data=x_domain)
|
|
178
|
+
self.add_equation('Left BC', self._bc_residual, weight=10.0, data=x_bc[0])
|
|
179
|
+
self.add_equation('Right BC', self._bc_residual, weight=10.0, data=x_bc[1])
|
|
180
|
+
|
|
181
|
+
# Create and train PINN
|
|
182
|
+
network = FNN([1, 64, 64, 64, 1])
|
|
183
|
+
pinn = SimplePINN(network)
|
|
184
|
+
pinn.set_loss_func(nn.MSELoss())
|
|
185
|
+
|
|
186
|
+
pinn.train(num_epochs=5000, lr=1e-3, print_loss=True, print_loss_freq=500)
|
|
187
|
+
|
|
188
|
+
# Predict on evaluation points
|
|
189
|
+
import numpy as np
|
|
190
|
+
x_eval = np.linspace(0, 1, 200, dtype=REAL()).reshape(-1, 1)
|
|
191
|
+
u_true = np.sin(x_eval) - x_eval * np.sin(1) # Analytical solution for comparison
|
|
192
|
+
x_eval_tensor = numpy2torch(x_eval)
|
|
193
|
+
u_pred = pinn.predict(x_eval_tensor).detach().numpy()
|
|
194
|
+
|
|
195
|
+
print(f"Relative L2 error: {calc_relative_l2_err(u_true, u_pred):.4e}")
|
|
196
|
+
```
|
|
197
|
+
|
|
198
|
+
### Example 2: Learning Operators with DeepONet
|
|
199
|
+
|
|
200
|
+
Learn the solution operator for **-Δu(x) = f(x)** where **f(x) = v·π²·sin(πx)** and **u(x) = v·sin(πx)**
|
|
201
|
+
|
|
202
|
+
```python
|
|
203
|
+
import numpy as np
|
|
204
|
+
from ai4plasma.core.network import FNN
|
|
205
|
+
from ai4plasma.operator.deeponet import DeepONet, DeepONetModel
|
|
206
|
+
from ai4plasma.utils.common import set_seed, numpy2torch
|
|
207
|
+
from ai4plasma.utils.device import check_gpu
|
|
208
|
+
from ai4plasma.utils.math import calc_relative_l2_err
|
|
209
|
+
from ai4plasma.config import DEVICE, REAL
|
|
210
|
+
|
|
211
|
+
# Set seed for reproducibility
|
|
212
|
+
set_seed(2026)
|
|
213
|
+
|
|
214
|
+
## Set device ##
|
|
215
|
+
if check_gpu(print_required=True):
|
|
216
|
+
DEVICE.set_device(0) # Using cuda:0
|
|
217
|
+
else:
|
|
218
|
+
DEVICE.set_device(-1) # Using cpu
|
|
219
|
+
print(DEVICE)
|
|
220
|
+
|
|
221
|
+
# Define branch and trunk networks
|
|
222
|
+
branch_net = FNN([1, 10, 10, 10, 10])
|
|
223
|
+
trunk_net = FNN([1, 10, 10, 10, 10])
|
|
224
|
+
|
|
225
|
+
# Create DeepONet model
|
|
226
|
+
network = DeepONet(branch_net, trunk_net)
|
|
227
|
+
model = DeepONetModel(network=network)
|
|
228
|
+
|
|
229
|
+
# Prepare training data
|
|
230
|
+
# Branch input: parameter v (A samples)
|
|
231
|
+
v = np.array([[2, 4, 6, 8, 10]], dtype=REAL()).reshape((-1, 1))
|
|
232
|
+
# Trunk input: spatial coordinate x (B points)
|
|
233
|
+
x = np.linspace(-1, 1, 40, endpoint=True, dtype=REAL()).reshape((-1, 1))
|
|
234
|
+
# Target output: solution u (A × B)
|
|
235
|
+
u = v * np.sin(np.pi * x.T)
|
|
236
|
+
|
|
237
|
+
# Convert to tensors and prepare data
|
|
238
|
+
v, x, u = numpy2torch(v), numpy2torch(x), numpy2torch(u)
|
|
239
|
+
model.prepare_train_data(v, x, u)
|
|
240
|
+
|
|
241
|
+
# Train the model
|
|
242
|
+
model.train(num_epochs=10000, lr=1e-4, print_loss_freq=100)
|
|
243
|
+
|
|
244
|
+
# Test on unseen parameter
|
|
245
|
+
vv = np.array([[5.5]], dtype=REAL())
|
|
246
|
+
xx = np.linspace(-1, 1, 30, endpoint=True, dtype=REAL()).reshape((-1, 1))
|
|
247
|
+
uu = vv * np.sin(np.pi * xx.T) # True solution
|
|
248
|
+
|
|
249
|
+
# Predict
|
|
250
|
+
vv, xx = numpy2torch(vv), numpy2torch(xx)
|
|
251
|
+
u_pred = model.predict(vv, xx).cpu().detach().numpy()
|
|
252
|
+
|
|
253
|
+
# Evaluate
|
|
254
|
+
l2_err = calc_relative_l2_err(uu, u_pred)
|
|
255
|
+
print(f"Relative L2 error: {l2_err:.4e}")
|
|
256
|
+
```
|
|
257
|
+
|
|
258
|
+
## 📚 Module Overview
|
|
259
|
+
|
|
260
|
+
### Core Modules (`ai4plasma.core`)
|
|
261
|
+
|
|
262
|
+
- **`model.py`**: Base model class with training utilities and checkpoint management
|
|
263
|
+
- **`network.py`**: Neural network architectures (FNN, CNN, ResNet, etc.)
|
|
264
|
+
|
|
265
|
+
### Physics-Informed ML (`ai4plasma.piml`)
|
|
266
|
+
|
|
267
|
+
- **`geo.py`**: Geometry definitions and domain sampling
|
|
268
|
+
- **`pinn.py`**: Standard Physics-Informed Neural Networks
|
|
269
|
+
- **`cs_pinn.py`**: Coefficient-Subnet PINNs (CS-PINN) for plasma applications
|
|
270
|
+
- **`meta_pinn.py`**: Meta-learning PINNs (Meta-PINN) for multi-task scenarios
|
|
271
|
+
- **`rk_pinn.py`**: Runge-Kutta PINNs (RK-PINN) for temporal problems
|
|
272
|
+
- **`nas_pinn.py`**: Neural Architecture Search for PINNs (NAS-PINN)
|
|
273
|
+
|
|
274
|
+
### Operator Learning (`ai4plasma.operator`)
|
|
275
|
+
|
|
276
|
+
- **`deeponet.py`**: Deep Operator Networks implementation
|
|
277
|
+
- **`deepcsnet.py`**: Deep Operator Networks for cross section prediction
|
|
278
|
+
|
|
279
|
+
### Plasma Physics (`ai4plasma.plasma`)
|
|
280
|
+
|
|
281
|
+
- **`arc.py`**: Arc plasma models and solvers
|
|
282
|
+
- **`prop.py`**: Plasma property calculations
|
|
283
|
+
|
|
284
|
+
### Utilities (`ai4plasma.utils`)
|
|
285
|
+
|
|
286
|
+
- **`common.py`**: Common utilities (seed setting, timers, etc.)
|
|
287
|
+
- **`device.py`**: GPU/CPU device management
|
|
288
|
+
- **`io.py`**: File I/O and checkpoint utilities
|
|
289
|
+
- **`math.py`**: Mathematical utilities (automatic differentiation, operators)
|
|
290
|
+
|
|
291
|
+
## 📖 Documentation
|
|
292
|
+
|
|
293
|
+
Full documentation is available at [https://ai4plasma.readthedocs.io](https://ai4plasma.readthedocs.io)
|
|
294
|
+
|
|
295
|
+
- **API Reference**: Detailed documentation of all modules and classes
|
|
296
|
+
- **User Guide**: Step-by-step tutorials for getting started
|
|
297
|
+
- **Examples**: Comprehensive examples covering various use cases
|
|
298
|
+
|
|
299
|
+
## 🎯 Example Applications
|
|
300
|
+
|
|
301
|
+
The `app/` directory contains numerous ready-to-run examples:
|
|
302
|
+
|
|
303
|
+
### Physics-Informed Neural Networks
|
|
304
|
+
|
|
305
|
+
- **1D/2D Poisson Equation**: [`app/piml/pinn/solve_1d_pinn.py`](app/piml/pinn/solve_1d_pinn.py)
|
|
306
|
+
- **2D Rectangular Domain**: [`app/piml/pinn/solve_2d_rect_pinn.py`](app/piml/pinn/solve_2d_rect_pinn.py)
|
|
307
|
+
- **Polynomial Domain**: [`app/piml/pinn/solve_2d_poly_pinn.py`](app/piml/pinn/solve_2d_poly_pinn.py)
|
|
308
|
+
|
|
309
|
+
### Plasma Simulations
|
|
310
|
+
|
|
311
|
+
- **Steady Arc by FVM**: [`app/plasma/arc/solve_1d_arc_steady.py`](app/plasma/arc/solve_1d_arc_steady.py)
|
|
312
|
+
- **Transient Arc by FVM**: [`app/plasma/arc/solve_1d_arc_transient_explicit.py`](app/plasma/arc/solve_1d_arc_transient_explicit.py)
|
|
313
|
+
- **Steady Arc by CS-PINN**: [`app/piml/cs_pinn/solve_1d_arc_steady_cs_pinn.py`](app/piml/cs_pinn/solve_1d_arc_steady_cs_pinn.py)
|
|
314
|
+
- **Transient Arc (with radial velocity) by CS-PINN**: [`app/piml/cs_pinn/solve_1d_arc_transient_cs_pinn.py`](app/piml/cs_pinn/solve_1d_arc_transient_cs_pinn.py)
|
|
315
|
+
- **Transient Arc (without radial velocity) by CS-PINN**: [`app/piml/cs_pinn/solve_1d_arc_transient_noV_cs_pinn.py`](app/piml/cs_pinn/solve_1d_arc_transient_noV_cs_pinn.py)
|
|
316
|
+
- **Corona Discharge by RK-PINN**: [`app/piml/rk_pinn/solve_1d_corona_rk_pinn.py`](app/piml/rk_pinn/solve_1d_corona_rk_pinn.py)
|
|
317
|
+
- **Resume Training**: [`app/piml/cs_pinn/resume_1d_arc_transient_cs_pinn.py`](app/piml/cs_pinn/resume_1d_arc_transient_cs_pinn.py)
|
|
318
|
+
|
|
319
|
+
### Operator Learning
|
|
320
|
+
|
|
321
|
+
- **DeepONet for Poisson**: [`app/operator/deeponet/solve_1d_poisson.py`](app/operator/deeponet/solve_1d_poisson.py)
|
|
322
|
+
- **2D CNN-based DeepONet**: [`app/operator/deeponet/solve_2d_poisson_cnn.py`](app/operator/deeponet/solve_2d_poisson_cnn.py)
|
|
323
|
+
- **DeepCSNet for Cross-Sections**: [`app/operator/deepcsnet/predict_total_ionxsec.py`](app/operator/deepcsnet/predict_total_ionxsec.py)
|
|
324
|
+
|
|
325
|
+
### Meta-Learning & NAS
|
|
326
|
+
|
|
327
|
+
- **Meta-PINN**: [`app/piml/meta_pinn/solve_1d_arc_steady_meta_pinn.py`](app/piml/meta_pinn/solve_1d_arc_steady_meta_pinn.py)
|
|
328
|
+
- **NAS-PINN**: [`app/piml/nas_pinn/search_pinn_2d_poisson.py`](app/piml/nas_pinn/search_pinn_2d_poisson.py)
|
|
329
|
+
|
|
330
|
+
## 📊 Project Structure
|
|
331
|
+
|
|
332
|
+
```
|
|
333
|
+
ai4plasma/
|
|
334
|
+
├── ai4plasma/ # Main package
|
|
335
|
+
│ ├── core/ # Core model and network architectures
|
|
336
|
+
│ ├── piml/ # Physics-informed machine learning
|
|
337
|
+
│ ├── operator/ # Operator learning methods
|
|
338
|
+
│ ├── plasma/ # Plasma physics models
|
|
339
|
+
│ └── utils/ # Utility functions
|
|
340
|
+
├── app/ # Example applications
|
|
341
|
+
│ ├── piml/ # PIML examples
|
|
342
|
+
│ ├── operator/ # Operator learning examples
|
|
343
|
+
│ └── plasma/ # Plasma simulation examples
|
|
344
|
+
├── docs/ # Documentation source files
|
|
345
|
+
```
|
|
346
|
+
|
|
347
|
+
## 🤝 Contributing
|
|
348
|
+
|
|
349
|
+
We welcome contributions from the community! Whether you're fixing bugs, adding new features, improving documentation, or sharing examples, your help is appreciated.
|
|
350
|
+
|
|
351
|
+
### How to Contribute
|
|
352
|
+
|
|
353
|
+
1. **Fork the repository** on GitHub
|
|
354
|
+
2. **Create a new branch** for your feature or bugfix
|
|
355
|
+
```bash
|
|
356
|
+
git checkout -b feature/your-feature-name
|
|
357
|
+
```
|
|
358
|
+
3. **Make your changes** and commit with clear messages
|
|
359
|
+
4. **Submit a pull request** with a detailed description
|
|
360
|
+
|
|
361
|
+
### Code Style
|
|
362
|
+
|
|
363
|
+
- Follow PEP 8 guidelines & "Numpy" style comment
|
|
364
|
+
- Use type hints where applicable
|
|
365
|
+
- Write docstrings for all public functions and classes
|
|
366
|
+
- Keep functions focused and modular
|
|
367
|
+
|
|
368
|
+
## 📝 Citation
|
|
369
|
+
|
|
370
|
+
If you use AI4Plasma in your research, please cite:
|
|
371
|
+
|
|
372
|
+
```bibtex
|
|
373
|
+
@software{ai4plasma2026,
|
|
374
|
+
title={AI4Plasma: An AI Library for Plasma Physics Simulation},
|
|
375
|
+
author={Zhong, Linlin and contributors},
|
|
376
|
+
year={2026},
|
|
377
|
+
url={https://github.com/mathboylinlin/ai4plasma},
|
|
378
|
+
version={0.1.0}
|
|
379
|
+
}
|
|
380
|
+
```
|
|
381
|
+
|
|
382
|
+
For specific methods, please also cite the relevant papers:
|
|
383
|
+
|
|
384
|
+
- **PINNs**: M. Raissi, P. Perdikaris, and G. E. Karniadakis, "Physics-informed neural networks: A deep learning framework for solving forward and inverse problems involving nonlinear partial differential equations," *Journal of Computational Physics* 378, 686 (2019).
|
|
385
|
+
|
|
386
|
+
- **CS-PINN**: L. Zhong, B. Wu, and Y. Wang, "Low-temperature plasma simulation based on physics-informed neural networks: Frameworks and preliminary applications," *Physics of Fluids* 34, 087116 (2022)
|
|
387
|
+
|
|
388
|
+
- **RK-PINN**: L. Zhong, B. Wu, and Y. Wang, "Low-temperature plasma simulation based on physics-informed neural networks: Frameworks and preliminary applications," *Physics of Fluids* 34, 087116 (2022)
|
|
389
|
+
|
|
390
|
+
- **Meta-PINN**: L. Zhong, B. Wu, and Y. Wang, "Accelerating physics-informed neural network based 1D arc simulation by meta learning," *Journal of Physics D: Applied Physics* 56, 074006 (2023).
|
|
391
|
+
|
|
392
|
+
- **NAS-PINN**: Y. Wang, and L. Zhong, "NAS-PINN: Neural architecture search-guided physics-informed neural network for solving PDEs," *Journal of Computational Physics* 496, 112603 (2024).
|
|
393
|
+
|
|
394
|
+
- **DeepONet**: L. Lu, P. Jin, G. Pang, Z. Zhang, and G. E. Karniadakis, "Learning nonlinear operators via DeepONet based on the universal approximation theorem of operators," *Nature Machine Intelligence* 3, 218 (2021).
|
|
395
|
+
|
|
396
|
+
- **DeepCSNet**: Y. Wang, and L. Zhong, "DeepCSNet: a deep learning method for predicting electron-impact doubly differential ionization cross sections," *Plasma Sources Science and Technology* 33, 105012 (2024).
|
|
397
|
+
|
|
398
|
+
## 📄 License
|
|
399
|
+
|
|
400
|
+
This project is licensed under the MIT License - see the [LICENSE](LICENSE) file for details.
|
|
401
|
+
|
|
402
|
+
## 🙏 Acknowledgments
|
|
403
|
+
|
|
404
|
+
- Thanks to all contributors who have helped shape AI4Plasma
|
|
405
|
+
- Inspired by DeepXDE and other physics-informed ML and operator learning frameworks
|
|
406
|
+
- Built on top of PyTorch and the broader Python scientific computing ecosystem
|
|
407
|
+
- Special thanks to the plasma physics and machine learning communities
|
|
408
|
+
|
|
409
|
+
## 📬 Contact
|
|
410
|
+
|
|
411
|
+
- **Author**: [Linlin Zhong](http://mathboylinlin.com)
|
|
412
|
+
- **Email**: linlin@seu.edu.cn
|
|
413
|
+
- **Homepage**: [https://github.com/mathboylinlin/ai4plasma](https://github.com/mathboylinlin/ai4plasma)
|
|
414
|
+
- **Documentation**: [https://ai4plasma.readthedocs.io](https://ai4plasma.readthedocs.io)
|
|
415
|
+
|
|
416
|
+
## 🌟 Star History
|
|
417
|
+
|
|
418
|
+
If you find AI4Plasma useful, please consider giving it a star ⭐ on GitHub!
|
|
419
|
+
|
|
420
|
+
---
|
|
421
|
+
|
|
422
|
+
**Made with ❤️ by the AI4Plasma Team**
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
LICENSE
|
|
2
|
+
README.md
|
|
3
|
+
pyproject.toml
|
|
4
|
+
AI4Plasma.egg-info/PKG-INFO
|
|
5
|
+
AI4Plasma.egg-info/SOURCES.txt
|
|
6
|
+
AI4Plasma.egg-info/dependency_links.txt
|
|
7
|
+
AI4Plasma.egg-info/requires.txt
|
|
8
|
+
AI4Plasma.egg-info/top_level.txt
|
|
9
|
+
ai4plasma/__init__.py
|
|
10
|
+
ai4plasma/config.py
|
|
11
|
+
ai4plasma/core/__init__.py
|
|
12
|
+
ai4plasma/core/model.py
|
|
13
|
+
ai4plasma/core/network.py
|
|
14
|
+
ai4plasma/operator/__init__.py
|
|
15
|
+
ai4plasma/operator/deepcsnet.py
|
|
16
|
+
ai4plasma/operator/deeponet.py
|
|
17
|
+
ai4plasma/piml/__init__.py
|
|
18
|
+
ai4plasma/piml/cs_pinn.py
|
|
19
|
+
ai4plasma/piml/geo.py
|
|
20
|
+
ai4plasma/piml/meta_pinn.py
|
|
21
|
+
ai4plasma/piml/nas_pinn.py
|
|
22
|
+
ai4plasma/piml/pinn.py
|
|
23
|
+
ai4plasma/piml/rk_pinn.py
|
|
24
|
+
ai4plasma/plasma/__init__.py
|
|
25
|
+
ai4plasma/plasma/arc.py
|
|
26
|
+
ai4plasma/plasma/prop.py
|
|
27
|
+
ai4plasma/utils/__init__.py
|
|
28
|
+
ai4plasma/utils/common.py
|
|
29
|
+
ai4plasma/utils/device.py
|
|
30
|
+
ai4plasma/utils/io.py
|
|
31
|
+
ai4plasma/utils/math.py
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
|