Skip to content

approx-infinity/Slayer

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

18 Commits
 
 
 
 
 
 
 
 

Repository files navigation

Slayer

Slayer is a GPU-accelerated radioactive decay solver built with PyTorch. It solves Bateman equations for complex decay chains using ENDF nuclear data and supports large-scale inventory calculations on both CPU and CUDA devices.

Usage

Single Nuclide (Default Settings)

Simulate a single nuclide with the default inventory of 1e20 atoms and a simulation time equal to one half-life.

python slayer.py H-3
python slayer.py Tritium        # Common names are supported
python slayer.py Co-60
python slayer.py Am-241m        # Metastable suffix is automatically handled

Custom Atom Count and Simulation Time

Specify the initial inventory and simulation time explicitly.

python slayer.py U-233 --atoms 1e24 --time 3.15e9

Multiple Nuclides

Simulate multiple nuclides simultaneously.

python slayer.py H-3 Co-60 --atoms 1e20 1e18

Use the same atom count for all nuclides:

python slayer.py H-3 Co-60 --atoms 1e20

Custom Decay Library

Use a custom ENDF decay data library.

python slayer.py H-3 --file data/fendld_2_full.endf

Example Output1

$ python slayer.py Am-241m

Parsing ENDF-6 file: data/fendld_2_full.endf
Loaded 1465 nuclides.

     Am-241m  →  ZA 95241  (Am-241)  |  1.000e+20 atoms

Simulation time : 1.3655e+10 s
Solver device   : CUDA

--- Final Inventory ---
Nuclide         ZA            Atoms
------------------------------------
Tl-209       81209      3.32292e+01
Pb-209       82209      1.36499e+05
Bi-209       83209      2.82276e+10
Bi-213       83213      3.18796e+04
Fr-221       87221      3.42683e+03
Ra-225       88225      1.49082e+07
Ac-225       89225      1.00707e+07
Th-229       90229      2.70163e+12
Pa-233       91233      1.88399e+12
U-233        92233      4.13805e+15
Np-237       93237      5.45464e+19
Am-241       95241      6.06531e+19

Example Output2

$ python slayer.py H-3 He-3 C-14 C-12 O-16 N-15 Na-23 Mg-24 Al-27 Si-28 P-31 S-32 Cl-35 Ar-40 K-39 Ca-40 Fe-56 Co-60 Ni-58 Cu-63 Zn-64 Kr-85 Sr-90 I-131 Xe-135 Cs-137 Ba-140 U-233 Pu-239 Am-241m
Parsing ENDF-6 file: data/fendld_2_full.endf
Loaded 1465 nuclides.

         H-3  →  ZA 1003  (H-3)  |  1.000e+20 atoms
        He-3  →  ZA 2003  (He-3)  |  1.000e+20 atoms
        C-14  →  ZA 6014  (C-14)  |  1.000e+20 atoms
        C-12  →  ZA 6012  (C-12)  |  1.000e+20 atoms
        O-16  →  ZA 8016  (O-16)  |  1.000e+20 atoms
        N-15  →  ZA 7015  (N-15)  |  1.000e+20 atoms
       Na-23  →  ZA 11023  (Na-23)  |  1.000e+20 atoms
       Mg-24  →  ZA 12024  (Mg-24)  |  1.000e+20 atoms
       Al-27  →  ZA 13027  (Al-27)  |  1.000e+20 atoms
       Si-28  →  ZA 14028  (Si-28)  |  1.000e+20 atoms
        P-31  →  ZA 15031  (P-31)  |  1.000e+20 atoms
        S-32  →  ZA 16032  (S-32)  |  1.000e+20 atoms
       Cl-35  →  ZA 17035  (Cl-35)  |  1.000e+20 atoms
       Ar-40  →  ZA 18040  (Ar-40)  |  1.000e+20 atoms
        K-39  →  ZA 19039  (K-39)  |  1.000e+20 atoms
       Ca-40  →  ZA 20040  (Ca-40)  |  1.000e+20 atoms
       Fe-56  →  ZA 26056  (Fe-56)  |  1.000e+20 atoms
       Co-60  →  ZA 27060  (Co-60)  |  1.000e+20 atoms
       Ni-58  →  ZA 28058  (Ni-58)  |  1.000e+20 atoms
       Cu-63  →  ZA 29063  (Cu-63)  |  1.000e+20 atoms
       Zn-64  →  ZA 30064  (Zn-64)  |  1.000e+20 atoms
       Kr-85  →  ZA 36085  (Kr-85)  |  1.000e+20 atoms
       Sr-90  →  ZA 38090  (Sr-90)  |  1.000e+20 atoms
       I-131  →  ZA 53131  (I-131)  |  1.000e+20 atoms
      Xe-135  →  ZA 54135  (Xe-135)  |  1.000e+20 atoms
      Cs-137  →  ZA 55137  (Cs-137)  |  1.000e+20 atoms
      Ba-140  →  ZA 56140  (Ba-140)  |  1.000e+20 atoms
       U-233  →  ZA 92233  (U-233)  |  1.000e+20 atoms
      Pu-239  →  ZA 94239  (Pu-239)  |  1.000e+20 atoms
     Am-241m  →  ZA 95241  (Am-241)  |  1.000e+20 atoms

Simulation time : 3.8910e+08 s
Solver device   : CUDA

Computing matrix exponential for a 53x53 sub-matrix...
--- Final Inventory ---
Nuclide         ZA            Atoms
------------------------------------
H-3           1003      5.00000e+19
He-3          2003      1.50000e+20
C-12          6012      1.00000e+20
C-14          6014      9.98510e+19
N-14          7014      1.49042e+17
N-15          7015      1.00000e+20
O-16          8016      1.00000e+20
Na-23        11023      1.00000e+20
Mg-24        12024      1.00000e+20
Al-27        13027      1.00000e+20
Si-28        14028      1.00000e+20
P-31         15031      1.00000e+20
S-32         16032      1.00000e+20
Cl-35        17035      1.00000e+20
Ar-40        18040      1.00000e+20
K-39         19039      1.00000e+20
Ca-40        20040      1.00000e+20
Fe-56        26056      1.00000e+20
Ni-58        28058      1.00000e+20
Ni-60        28060      2.60000e+17
Cu-63        29063      1.00000e+20
Zn-64        30064      1.00000e+20
Rb-85        37085      7.89000e+19
Sr-90        38090      7.41980e+19
Y-90         39090      2.77826e+17
Cs-137       55137      7.53318e+19
Ba-137       56137      2.53231e+17
Ce-140       58140      1.00000e+20
Tl-209       81209      1.55958e+09
Pb-209       82209      7.12364e+10
Bi-209       83209      2.60402e+12
Bi-213       83213      7.31782e+10
Po-213       84213      7.06521e+10
At-217       85217      7.41622e+10
Rn-217       86217      8.78243e+06
Fr-221       87221      7.51375e+10
Ra-225       88225      7.70879e+10
Ac-225       89225      7.61127e+10
Th-229       90229      5.36345e+15
Pa-233       91233      9.64255e+10
U-233        92233      9.99946e+19
U-235        92235      4.42838e+14
Np-237       93237      1.95577e+18
Pu-239       94239      9.99646e+19
Am-241       95241      9.80442e+19

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages