AME2020の mass modelを使って計算する方法。IAEAのウェブサイトからダウンロードした mass_1.mas20.txt を以下のpythonファイルと同じディレクトリに置いてください。load_ame20 関数は何度も実行しなくてもいいようにキャッシュを有効にしています。
mnucleon = 931.49410242 # // 統一原子質量単位 MeV/c^2 emass = 0.51099895000 # // 電子質量 MeV/c^2 from functools import lru_cache import os @lru_cache(maxsize=1) def load_ame20(): ame20_data = {} import os # Download from https://www-nds.iaea.org/amdc/ame2020/mass_1.mas20.txt file_path = os.path.join(os.path.dirname(__file__), "mass_1.mas20.txt") with open(file_path, "r") as f: print(file_path, "is loading...") lines = f.readlines()[36:] for line in lines: if not line.strip() or line.startswith("#"): continue try: assert line[4] == " " assert line[9] == " " assert line[14] == " " assert line[27] == " " assert line[42] == " " Z = int(line[10:14]) N = int(line[5:9]) A = Z + N mass_excess_keV = float(line[28:42].strip()) ame20_data[(Z, A)] = mass_excess_keV / 1000.0 # MeVに変換 except ValueError: continue return ame20_data def get_ion_mass_ame20(A, Z, Q): ame20_data = load_ame20() key = (Z, A) if key not in ame20_data: raise ValueError(f"Data for A={A}, Z={Z} not found in AME2020.") mass_excess = ame20_data[key] mass_amu = A + (mass_excess / mnucleon) return mass_amu - Q * emass / mnucleon
実行例
print(get_ion_mass_ame20(12, 6, 0)) print(get_ion_mass_ame20(238, 92, 86))
出力結果
mass_1.mas20.txt is loading... 12.0 238.0036090645032