use num_complex::Complex;
use crate::clue_errors::CluEError;
pub const I: Complex<f64> = Complex::<f64>{re: 0.0, im: 1.0};
pub const ONE: Complex<f64> = Complex::<f64>{re: 1.0, im: 0.0};
pub const ZERO: Complex<f64> = Complex::<f64>{re: 0.0, im: 0.0};
pub const PI: f64 = std::f64::consts::PI;
pub const METER: f64 = 1.0;
pub const SECOND: f64 = 1.0;
pub const JOULE: f64 = 1.0;
pub const TESLA: f64 = 1.0;
pub const KELVIN: f64 = 1.0;
pub const KILOGRAM: f64 = JOULE/METER/METER*SECOND*SECOND;
pub const HERTZ: f64 = 1.0/SECOND;
pub const ANGSTROM: f64 = METER*1e-10;
pub const AMPERE: f64 = KILOGRAM/SECOND/SECOND/TESLA;
pub const NEWTON: f64 = KILOGRAM*METER/SECOND/SECOND;
pub const COULOMB: f64 = AMPERE*SECOND;
pub const VOLT: f64 = JOULE/COULOMB;
pub const PLANCK: f64 = 6.62607015e-34*JOULE/HERTZ;
pub const HBAR: f64 = (PLANCK/2.0/PI) * JOULE * SECOND;
pub const MUB:f64 = 9.2740100783e-24 * JOULE/TESLA;
pub const MUN: f64 = 5.0507837461e-27 * JOULE/TESLA;
pub const MU0: f64 = 1.25663706212e-6 * NEWTON/AMPERE/AMPERE;
pub const BOLTZMANN: f64 = 1.380649e-23 * JOULE/KELVIN;
pub const AVOGADRO: f64 = 6.02214076e23;
pub const ELECTRON_G: f64 = 2.00231930436256;
pub const ELEMENTARY_CHARGE: f64 = 1.602176634e-19 * COULOMB;
pub const ELECTRON_VOLT: f64 = ELEMENTARY_CHARGE * VOLT;
pub const JOULES_TO_HERTZ: f64 = 1.0/PLANCK * HERTZ/JOULE;
pub const RAD_PER_S_TO_HZ: f64 = 0.5/PI;
#[derive(PartialEq, Debug, Clone, Copy /*, EnumIter */)]
pub enum Element{
Electron,
Hydrogen,
Helium,
Lithium,
Beryllium,
Boron,
Carbon,
Nitrogen,
Oxygen,
Fluorine,
Neon,
Sodium,
Magnesium,
Aluminium,
Silicon,
Phosphorus,
Sulfur,
Chlorine,
Argon,
Potassium,
Calcium,
Scandium,
Titanium,
Vanadium,
Chromium,
Manganese,
Iron,
Cobalt,
Nickel,
Copper,
Zinc,
Gallium,
Germanium,
Arsenic,
Selenium,
Bromine,
Krypton,
Rubidium,
Strontium,
Yttrium,
Zirconium,
Niobium,
Molybdenum,
Technetium,
Ruthenium,
Rhodium,
Palladium,
Silver,
Cadmium,
Indium,
Tin,
Antimony,
Tellurium,
Iodine,
Xenon,
Caesium,
Barium,
Lanthanum,
Cerium,
Praseodymium,
Neodymium,
Promethium,
Samarium,
Europium,
Gadolinium,
Terbium,
Dysprosium,
Holmium,
Erbium,
Thulium,
Ytterbium,
Lutetium,
Hafnium,
Tantalum,
Tungsten,
Rhenium,
Osmium,
Iridium,
Platinum,
Gold,
Mercury,
Thallium,
Lead,
Bismuth,
Polonium,
Astatine,
Radon,
Francium,
Radium,
Actinium,
Thorium,
Protactinium,
Uranium,
Neptunium,
Plutonium,
Americium,
Curium,
Berkelium,
Californium,
Einsteinium,
Fermium,
Mendelevium,
Nobelium,
Lawrencium,
Rutherfordium,
Dubnium,
Seaborgium,
Bohrium,
Hassium,
Meitnerium,
Darmstadtium,
Roentgenium,
Copernicium,
Nihonium,
Flerovium,
Moscovium,
Livermorium,
Tennessine,
Oganesson,
}
impl Element{
pub fn from(element: &str) -> Result<Element,CluEError> {
match element {
"e" => Ok(Element::Electron),
"H" | "D" | "T" => Ok(Element::Hydrogen),
"He" => Ok(Element::Helium),
"Li" => Ok(Element::Lithium),
"Be" => Ok(Element::Beryllium),
"B" => Ok(Element::Boron),
"C" => Ok(Element::Carbon),
"N" => Ok(Element::Nitrogen),
"O" => Ok(Element::Oxygen),
"F" => Ok(Element::Fluorine),
"Ne" => Ok(Element::Neon),
"Na" => Ok(Element::Sodium),
"Al" => Ok(Element::Aluminium),
"Si" => Ok(Element::Silicon),
"P" => Ok(Element::Phosphorus),
"S" => Ok(Element::Sulfur),
"Cl" => Ok(Element::Chlorine),
"Ar" => Ok(Element::Argon),
"K" => Ok(Element::Potassium),
"Ca" => Ok(Element::Calcium),
"Sc" => Ok(Element::Scandium),
"Ti" => Ok(Element::Titanium),
"V" => Ok(Element::Vanadium),
"Cr" => Ok(Element::Chromium),
"Mn" => Ok(Element::Manganese),
"Fe" => Ok(Element::Iron),
"Co" => Ok(Element::Cobalt),
"Ni" => Ok(Element::Nickel),
"Cu" => Ok(Element::Copper),
"Zn" => Ok(Element::Zinc),
"Ga" => Ok(Element::Gallium),
"Ge" => Ok(Element::Germanium),
"As" => Ok(Element::Arsenic),
"Se" => Ok(Element::Selenium),
"Br" => Ok(Element::Bromine),
"Kr" => Ok(Element::Krypton),
"Rb" => Ok(Element::Rubidium),
"Sr" => Ok(Element::Strontium),
"Y" => Ok(Element::Yttrium),
"Zr" => Ok(Element::Zirconium),
"Nb" => Ok(Element::Niobium),
"Mo" => Ok(Element::Molybdenum),
"Tc" => Ok(Element::Technetium),
"Ru" => Ok(Element::Ruthenium),
"Rh" => Ok(Element::Rhodium),
"Pd" => Ok(Element::Palladium),
"Ag" => Ok(Element::Silver),
"Cd" => Ok(Element::Cadmium),
"In" => Ok(Element::Indium),
"Sn" => Ok(Element::Tin),
"Sb" => Ok(Element::Antimony),
"Te" => Ok(Element::Tellurium),
"I" => Ok(Element::Iodine),
"Xe" => Ok(Element::Xenon),
"Cs" => Ok(Element::Caesium),
"Ba" => Ok(Element::Barium),
"La" => Ok(Element::Lanthanum),
"Ce" => Ok(Element::Cerium),
"Pr" => Ok(Element::Praseodymium),
"Nd" => Ok(Element::Neodymium),
"Pm" => Ok(Element::Promethium),
"Sm" => Ok(Element::Samarium),
"Eu" => Ok(Element::Europium),
"Gd" => Ok(Element::Gadolinium),
"Tb" => Ok(Element::Terbium),
"Dy" => Ok(Element::Dysprosium),
"Ho" => Ok(Element::Holmium),
"Er" => Ok(Element::Erbium),
"Tm" => Ok(Element::Thulium),
"Yb" => Ok(Element::Ytterbium),
"Lu" => Ok(Element::Lutetium),
"Hf" => Ok(Element::Hafnium),
"Ta" => Ok(Element::Tantalum),
"W" => Ok(Element::Tungsten),
"Re" => Ok(Element::Rhenium),
"Os" => Ok(Element::Osmium),
"Ir" => Ok(Element::Iridium),
"Pt" => Ok(Element::Platinum),
"Au" => Ok(Element::Gold),
"Hg" => Ok(Element::Mercury),
"Tl" => Ok(Element::Thallium),
"Pb" => Ok(Element::Lead),
"Bi" => Ok(Element::Bismuth),
"Po" => Ok(Element::Polonium),
"At" => Ok(Element::Astatine),
"Rn" => Ok(Element::Radon),
"Fr" => Ok(Element::Francium),
"Ra" => Ok(Element::Radium),
"Ac" => Ok(Element::Actinium),
"Th" => Ok(Element::Thorium),
"Pa" => Ok(Element::Protactinium),
"U" => Ok(Element::Uranium),
"Np" => Ok(Element::Neptunium),
"Pu" => Ok(Element::Plutonium),
"Am" => Ok(Element::Americium),
"Cm" => Ok(Element::Curium),
"Bk" => Ok(Element::Berkelium),
"Cf" => Ok(Element::Californium),
"Es" => Ok(Element::Einsteinium),
"Fm" => Ok(Element::Fermium),
"Md" => Ok(Element::Mendelevium),
"No" => Ok(Element::Nobelium),
"Lr" => Ok(Element::Lawrencium),
"Rf" => Ok(Element::Rutherfordium),
"Db" => Ok(Element::Dubnium),
"Sg" => Ok(Element::Seaborgium),
"Bh" => Ok(Element::Bohrium),
"Hs" => Ok(Element::Hassium),
"Mt" => Ok(Element::Meitnerium),
"Ds" => Ok(Element::Darmstadtium),
"Rg" => Ok(Element::Roentgenium),
"Cn" => Ok(Element::Copernicium),
"Nh" => Ok(Element::Nihonium),
"Fl" => Ok(Element::Flerovium),
"Mc" => Ok(Element::Moscovium),
"Lv" => Ok(Element::Livermorium),
"Ts" => Ok(Element::Tennessine),
"Og" => Ok(Element::Oganesson),
_ => Err(CluEError::CannotParseElement(element.to_string())),
}
}
}
impl ToString for Element{
fn to_string(&self) -> String{
match self{
Element::Electron => "e".to_string(),
Element::Hydrogen => "H".to_string(),
Element::Helium => "He".to_string(),
Element::Lithium => "Li".to_string(),
Element::Beryllium => "Be".to_string(),
Element::Boron => "B".to_string(),
Element::Carbon => "C".to_string(),
Element::Nitrogen => "N".to_string(),
Element::Oxygen => "O".to_string(),
Element::Fluorine => "F".to_string(),
Element::Neon => "Ne".to_string(),
Element::Sodium => "Na".to_string(),
Element::Magnesium => "Mg".to_string(),
Element::Aluminium => "Al".to_string(),
Element::Silicon => "Si".to_string(),
Element::Phosphorus => "P".to_string(),
Element::Sulfur => "S".to_string(),
Element::Chlorine => "Cl".to_string(),
Element::Argon => "Ar".to_string(),
Element::Potassium => "K".to_string(),
Element::Calcium => "Ca".to_string(),
Element::Scandium => "Sc".to_string(),
Element::Titanium => "Ti".to_string(),
Element::Vanadium => "V".to_string(),
Element::Chromium => "Cr".to_string(),
Element::Manganese => "Mn".to_string(),
Element::Iron => "Fe".to_string(),
Element::Cobalt => "Co".to_string(),
Element::Nickel => "Ni".to_string(),
Element::Copper => "Cu".to_string(),
Element::Zinc => "Zn".to_string(),
Element::Gallium => "Ga".to_string(),
Element::Germanium => "Ge".to_string(),
Element::Arsenic => "As".to_string(),
Element::Selenium => "Se".to_string(),
Element::Bromine => "Br".to_string(),
Element::Krypton => "Kr".to_string(),
Element::Rubidium => "Rb".to_string(),
Element::Strontium => "Sr".to_string(),
Element::Yttrium => "Y".to_string(),
Element::Zirconium => "Zr".to_string(),
Element::Niobium => "Nb".to_string(),
Element::Molybdenum => "Mo".to_string(),
Element::Technetium => "Tc".to_string(),
Element::Ruthenium => "Ru".to_string(),
Element::Rhodium => "Rh".to_string(),
Element::Palladium => "Pd".to_string(),
Element::Silver => "Ag".to_string(),
Element::Cadmium => "Cd".to_string(),
Element::Indium => "In".to_string(),
Element::Tin => "Sn".to_string(),
Element::Antimony => "Sb".to_string(),
Element::Tellurium => "Te".to_string(),
Element::Iodine => "I".to_string(),
Element::Xenon => "Xe".to_string(),
Element::Caesium => "Cs".to_string(),
Element::Barium => "Ba".to_string(),
Element::Lanthanum => "La".to_string(),
Element::Cerium => "Ce".to_string(),
Element::Praseodymium => "Pr".to_string(),
Element::Neodymium => "Nd".to_string(),
Element::Promethium => "Pm".to_string(),
Element::Samarium => "Sm".to_string(),
Element::Europium => "Eu".to_string(),
Element::Gadolinium => "Gd".to_string(),
Element::Terbium => "Tb".to_string(),
Element::Dysprosium => "Dy".to_string(),
Element::Holmium => "Ho".to_string(),
Element::Erbium => "Er".to_string(),
Element::Thulium => "Tm".to_string(),
Element::Ytterbium => "Yb".to_string(),
Element::Lutetium => "Lu".to_string(),
Element::Hafnium => "Hf".to_string(),
Element::Tantalum => "Ta".to_string(),
Element::Tungsten => "W".to_string(),
Element::Rhenium => "Re".to_string(),
Element::Osmium => "Os".to_string(),
Element::Iridium => "Ir".to_string(),
Element::Platinum => "Pt".to_string(),
Element::Gold => "Au".to_string(),
Element::Mercury => "Hg".to_string(),
Element::Thallium => "Tl".to_string(),
Element::Lead => "Pb".to_string(),
Element::Bismuth => "Bi".to_string(),
Element::Polonium => "Po".to_string(),
Element::Astatine => "At".to_string(),
Element::Radon => "Rn".to_string(),
Element::Francium => "Fr".to_string(),
Element::Radium => "Ra".to_string(),
Element::Actinium => "Ac".to_string(),
Element::Thorium => "Th".to_string(),
Element::Protactinium => "Pa".to_string(),
Element::Uranium => "U".to_string(),
Element::Neptunium => "Np".to_string(),
Element::Plutonium => "Pu".to_string(),
Element::Americium => "Am".to_string(),
Element::Curium => "Cm".to_string(),
Element::Berkelium => "Bk".to_string(),
Element::Californium => "Cf".to_string(),
Element::Einsteinium => "Es".to_string(),
Element::Fermium => "Fm".to_string(),
Element::Mendelevium => "Md".to_string(),
Element::Nobelium => "No".to_string(),
Element::Lawrencium => "Lr".to_string(),
Element::Rutherfordium => "Rf".to_string(),
Element::Dubnium => "Db".to_string(),
Element::Seaborgium => "Sg".to_string(),
Element::Bohrium => "Bh".to_string(),
Element::Hassium => "Ha".to_string(),
Element::Meitnerium => "Mt".to_string(),
Element::Darmstadtium => "Ds".to_string(),
Element::Roentgenium => "Rg".to_string(),
Element::Copernicium => "Cn".to_string(),
Element::Nihonium => "Nh".to_string(),
Element::Flerovium => "Fl".to_string(),
Element::Moscovium => "Mc".to_string(),
Element::Livermorium => "Lv".to_string(),
Element::Tennessine => "Ts".to_string(),
Element::Oganesson => "Og".to_string(),
}
}
}
#[derive(PartialEq, Debug, Clone, Copy)]
pub enum Isotope{
Electron,
Hydrogen1,
Hydrogen2,
Hydrogen3,
Helium3,
Helium4,
Lithium6,
Lithium7,
Beryllium9,
Boron10,
Boron11,
Carbon12,
Carbon13,
Nitrogen14,
Nitrogen15,
Oxygen16,
Oxygen17,
Fluorine19,
Neon20,
Neon21,
Sodium22,
Sodium23,
Magnesium24,
Magnesium25,
Aluminium27,
Silicon28,
Silicon29,
Phosphorus31,
Sulfur32,
Sulfur33,
Chlorine35,
Chlorine36,
Chlorine37,
Argon39,
Argon40,
Potassium39, Potassium40,
Potassium41,
Calcium40, Calcium41,
Calcium43,
Scandium45,
Titanium47,
Titanium48, Titanium49,
Vanadium50,
Vanadium51, Chromium52, Chromium53,
Manganese53,
Manganese55, Iron56, Iron57,
Cobalt59, Cobalt60,
Nickel58, Nickel61,
Copper63, Copper65,
Zinc64, Zinc67,
Gallium69, Gallium71,
Germanium73,
Germanium74, Arsenic75, Selenium77,
Selenium78, Selenium79,
Bromine79, Bromine81,
Krypton83,
Krypton84, Krypton85,
Rubidium85, Rubidium87,
Strontium87,
Strontium88, Yttrium89, Zirconium90, Zirconium91,
Niobium93, Molybdenum95,
Molybdenum97,
Molybdenum98, Technetium99, Ruthenium99,
Ruthenium101,
Ruthenium102, Rhodium103,
Palladium105,
Palladium106, Silver107, Silver109,
Cadmium111,
Cadmium113,
Cadmium114, Indium113,
Indium115,
Tin115,
Tin117,
Tin119,
Tin120, Antimony121, Antimony123,
Antimony125,
Tellurium123,
Tellurium125,
Tellurium130, Iodine127, Iodine129,
Xenon129,
Xenon131,
Xenon132, Caesium133, Caesium134,
Caesium135,
Caesium137,
Barium133,
Barium135,
Barium137,
Barium138, Lanthanum137,
Lanthanum138,
Lanthanum139, Cerium140, Praseodymium141, Neodymium143,
Neodymium144, Neodymium145,
Promethium141,
Samarium147,
Samarium149,
Samarium151,
Samarium152, Europium151,
Europium152,
Europium153, Europium154,
Europium155,
Gadolinium155,
Gadolinium156, Gadolinium157,
Terbium157,
Terbium159, Terbium160,
Dysprosium161,
Dysprosium163,
Dysprosium165, Holmium165,
Erbium166, Erbium167,
Thulium169, Thulium171,
Ytterbium171,
Ytterbium173,
Ytterbium174, Lutetium173,
Lutetium174,
Lutetium175, Lutetium176,
Hafnium177,
Hafnium179,
Hafnium180, Tantalum180,
Tantalum181, Tungsten183,
Tungsten184, Rhenium185,
Rhenium187, Osmium187,
Osmium189,
Osmium192, Iridium191,
Iridium193, Platinum194, Platinum195, Gold197,
Mercury199,
Mercury201,
Mercury202, Thallium203,
Thallium204,
Thallium205, Lead207,
Lead208, Bismuth207,
Bismuth209, Polonium209,
Polonium210, Astatine210,
Radon222,
Francium223,
Radium226,
Actinium227,
Thorium229,
Thorium232, Protactinium231,
Uranium235,
Uranium238, Neptunium237,
Plutonium239,
Americium243,
Curium247,
Berkelium247,
Californium251,
Einsteinium252,
Fermium257,
Mendelevium258,
Nobelium259,
Lawrencium266,
Rutherfordium267,
Dubnium268,
Seaborgium269,
Bohrium278,
Hassium270,
Meitnerium278,
Darmstadtium281,
Roentgenium282,
Copernicium285,
Nihonium286,
Flerovium289,
Moscovium289,
Livermorium293,
Tennessine294,
Oganesson294,
}
impl Isotope{
pub fn g_value(&self) -> f64{
match self{
Isotope::Electron => ELECTRON_G,
Isotope::Hydrogen1 => 5.5856946893,
Isotope::Hydrogen2 => 0.857438,
Isotope::Hydrogen3 => 5.95799,
Isotope::Helium3 => -4.255,
Isotope::Helium4 => 0.0,
Isotope::Lithium6 => 0.822047,
Isotope::Lithium7 => 2.17095,
Isotope::Beryllium9 => -0.78495,
Isotope::Boron10 => 0.600215,
Isotope::Boron11 => 1.79243,
Isotope::Carbon12 => 0.0,
Isotope::Carbon13 => 1.40482,
Isotope::Nitrogen14 => 0.403761,
Isotope::Nitrogen15 => -0.566378,
Isotope::Oxygen16 => 0.0,
Isotope::Oxygen17 => -0.757516,
Isotope::Fluorine19 => 5.25774,
Isotope::Neon20 => 0.0,
Isotope::Neon21 => -0.441198,
Isotope::Sodium22 => 0.582,
Isotope::Sodium23 => 1.47835,
Isotope::Magnesium24 => 0.0,
Isotope::Magnesium25 => -0.34218,
Isotope::Aluminium27 => 1.4566,
Isotope::Silicon28 => 0.0,
Isotope::Silicon29 => -1.11058,
Isotope::Phosphorus31 => 2.2632,
Isotope::Sulfur32 => 0.0,
Isotope::Sulfur33 => 0.429214,
Isotope::Chlorine35 => 0.547916,
Isotope::Chlorine36 => 0.642735,
Isotope::Chlorine37 => 0.456082,
Isotope::Argon39 => -0.4537,
Isotope::Argon40 => 0.0,
Isotope::Potassium39 => 0.26098,
Isotope::Potassium40 => -0.324525,
Isotope::Potassium41 => 0.143247,
Isotope::Calcium41 => -0.455652,
Isotope::Calcium43 => -0.37637,
Isotope::Scandium45 => 1.35899,
Isotope::Titanium47 => -0.31539,
Isotope::Titanium49 => -0.315477,
Isotope::Vanadium50 => 0.557615,
Isotope::Vanadium51 => 1.47106,
Isotope::Chromium53 => -0.31636,
Isotope::Manganese53 => 1.439,
Isotope::Manganese55 => 1.3813,
Isotope::Iron57 => 0.1809,
Isotope::Cobalt59 => 1.322,
Isotope::Cobalt60 => 0.7598,
Isotope::Nickel61 => -0.50001,
Isotope::Copper63 => 1.4824,
Isotope::Copper65 => 1.5878,
Isotope::Zinc67 => 0.350192,
Isotope::Gallium69 => 1.34439,
Isotope::Gallium71 => 1.70818,
Isotope::Germanium73 => -0.195437,
Isotope::Arsenic75 => 0.95965,
Isotope::Selenium77 => 1.07008,
Isotope::Selenium79 => -0.29,
Isotope::Bromine79 => 1.40427,
Isotope::Bromine81 => 1.51371,
Isotope::Krypton83 => -0.215704,
Isotope::Krypton85 => -0.2233,
Isotope::Rubidium85 => 0.541192,
Isotope::Rubidium87 => 1.83421,
Isotope::Strontium87 => -0.24284,
Isotope::Yttrium89 => -0.274831,
Isotope::Zirconium91 => -0.521448,
Isotope::Niobium93 => 1.3712,
Isotope::Molybdenum95 => -0.3657,
Isotope::Molybdenum97 => -0.3734,
Isotope::Technetium99 => 1.2632,
Isotope::Ruthenium99 => -0.256,
Isotope::Ruthenium101 => -0.288,
Isotope::Rhodium103 => -0.1768,
Isotope::Palladium105 => -0.257,
Isotope::Silver107 => -0.22714,
Isotope::Silver109 => -0.26112,
Isotope::Cadmium111 => -1.18977,
Isotope::Cadmium113 => -1.2446,
Isotope::Indium113 => 1.2286,
Isotope::Indium115 => 1.2313,
Isotope::Tin115 => -1.8377,
Isotope::Tin117 => -2.00208,
Isotope::Tin119 => -2.09456,
Isotope::Antimony121 => 1.3454,
Isotope::Antimony123 => 0.72851,
Isotope::Antimony125 => 0.751,
Isotope::Tellurium123 => -1.4739,
Isotope::Tellurium125 => -1.77701,
Isotope::Iodine127 => 1.12531,
Isotope::Iodine129 => 0.7486,
Isotope::Xenon129 => -1.55595,
Isotope::Xenon131 => 0.461,
Isotope::Caesium133 => 0.737721,
Isotope::Caesium134 => 0.74843,
Isotope::Caesium135 => 0.78069,
Isotope::Caesium137 => 0.81466,
Isotope::Barium133 => -1.5433,
Isotope::Barium135 => 0.55863,
Isotope::Barium137 => 0.62491,
Isotope::Lanthanum137 => 0.7714,
Isotope::Lanthanum138 => 0.742729,
Isotope::Lanthanum139 => 0.795153,
Isotope::Praseodymium141 => 1.7102,
Isotope::Samarium147 => -0.232,
Isotope::Samarium149 => -0.1908,
Isotope::Samarium151 => 0.1444,
Isotope::Europium151 => 1.3887,
Isotope::Europium152 => -0.6467,
Isotope::Europium153 => 0.6134,
Isotope::Europium154 => -0.6683,
Isotope::Europium155 => 0.608,
Isotope::Gadolinium155 => -0.1715,
Isotope::Gadolinium157 => -0.2265,
Isotope::Terbium157 => 1.34,
Isotope::Terbium159 => 1.343,
Isotope::Terbium160 => 0.5967,
Isotope::Dysprosium161 => -0.192,
Isotope::Dysprosium163 => 0.269,
Isotope::Holmium165 => 1.688,
Isotope::Erbium167 => -0.1611,
Isotope::Thulium169 => -0.432,
Isotope::Thulium171 => -0.456,
Isotope::Ytterbium171 => 0.98734,
Isotope::Ytterbium173 => -0.2592,
Isotope::Lutetium173 => 0.6517,
Isotope::Lutetium174 => 1.998,
Isotope::Lutetium175 => 0.6378,
Isotope::Lutetium176 => 0.4517,
Isotope::Hafnium177 => 0.2267,
Isotope::Hafnium179 => -0.1424,
Isotope::Tantalum180 => 0.5361,
Isotope::Tantalum181 => 0.67729,
Isotope::Tungsten183 => 0.235569,
Isotope::Rhenium185 => 1.2748,
Isotope::Rhenium187 => 1.2879,
Isotope::Osmium187 => 0.129304,
Isotope::Osmium189 => 0.439956,
Isotope::Iridium191 => 0.1005,
Isotope::Iridium193 => 0.1091,
Isotope::Platinum195 => 1.219,
Isotope::Gold197 => 0.097164,
Isotope::Mercury199 => 1.01177,
Isotope::Mercury201 => -0.373484,
Isotope::Thallium203 => 3.24452,
Isotope::Thallium204 => 0.045,
Isotope::Thallium205 => 3.27643,
Isotope::Lead207 => 1.18512,
Isotope::Bismuth207 => 0.9092,
Isotope::Bismuth209 => 0.9134,
Isotope::Polonium209 => 1.5,
Isotope::Actinium227 => 0.73,
Isotope::Thorium229 => 0.18,
Isotope::Uranium235 => -0.109,
Isotope::Neptunium237 => 1.256,
Isotope::Plutonium239 => 0.406,
Isotope::Americium243 => 0.6,
_ => 0.0,
}
}
pub fn gyromagnetic_ratio(&self) -> f64{
let mu: f64 = if *self == Isotope::Electron{
-MUB
}else{
MUN
};
mu*self.g_value()/HBAR
}
pub fn spin_multiplicity(&self) -> usize {
match self {
Isotope::Electron => 2,
Isotope::Hydrogen1 => 2,
Isotope::Hydrogen2 => 3,
Isotope::Hydrogen3 => 2,
Isotope::Helium3 => 2,
Isotope::Helium4 => 1,
Isotope::Lithium6 => 3,
Isotope::Lithium7 => 4,
Isotope::Beryllium9 => 4,
Isotope::Boron10 => 7,
Isotope::Boron11 => 4,
Isotope::Carbon12 => 1,
Isotope::Carbon13 => 2,
Isotope::Nitrogen14 => 3,
Isotope::Nitrogen15 => 2,
Isotope::Oxygen16 => 1,
Isotope::Oxygen17 => 6,
Isotope::Fluorine19 => 2,
Isotope::Neon20 => 1,
Isotope::Neon21 => 4,
Isotope::Sodium22 => 7,
Isotope::Sodium23 => 4,
Isotope::Magnesium24 => 1,
Isotope::Magnesium25 => 6,
Isotope::Aluminium27 => 6,
Isotope::Silicon28 => 1,
Isotope::Silicon29 => 2,
Isotope::Phosphorus31 => 2,
Isotope::Sulfur32 => 1,
Isotope::Sulfur33 => 4,
Isotope::Chlorine35 => 5,
Isotope::Chlorine36 => 5,
Isotope::Chlorine37 => 4,
Isotope::Argon39 => 8,
Isotope::Argon40 => 1,
Isotope::Potassium39 => 4,
Isotope::Potassium40 => 9,
Isotope::Potassium41 => 4,
Isotope::Calcium41 => 8,
Isotope::Calcium43 => 8,
Isotope::Scandium45 => 8,
Isotope::Titanium47 => 6,
Isotope::Titanium49 => 8,
Isotope::Vanadium50 => 13,
Isotope::Vanadium51 => 8,
Isotope::Chromium53 => 4,
Isotope::Manganese53 => 8,
Isotope::Manganese55 => 6,
Isotope::Iron57 => 2,
Isotope::Cobalt59 => 8,
Isotope::Cobalt60 => 11,
Isotope::Nickel61 => 4,
Isotope::Copper63 => 7,
Isotope::Copper65 => 7,
Isotope::Zinc67 => 6,
Isotope::Gallium69 => 4,
Isotope::Gallium71 => 4,
Isotope::Germanium73 => 10,
Isotope::Arsenic75 => 4,
Isotope::Selenium77 => 2,
Isotope::Selenium79 => 8,
Isotope::Bromine79 => 4,
Isotope::Bromine81 => 4,
Isotope::Krypton83 => 10,
Isotope::Krypton85 => 10,
Isotope::Rubidium85 => 6,
Isotope::Rubidium87 => 4,
Isotope::Strontium87 => 10,
Isotope::Yttrium89 => 2,
Isotope::Zirconium91 => 6,
Isotope::Niobium93 => 10,
Isotope::Molybdenum95 => 6,
Isotope::Molybdenum97 => 6,
Isotope::Technetium99 => 10,
Isotope::Ruthenium99 => 6,
Isotope::Ruthenium101 => 6,
Isotope::Rhodium103 => 2,
Isotope::Palladium105 => 6,
Isotope::Silver107 => 2,
Isotope::Silver109 => 2,
Isotope::Cadmium111 => 2,
Isotope::Cadmium113 => 2,
Isotope::Indium113 => 10,
Isotope::Indium115 => 10,
Isotope::Tin115 => 2,
Isotope::Tin117 => 2,
Isotope::Tin119 => 2,
Isotope::Antimony121 => 6,
Isotope::Antimony123 => 8,
Isotope::Antimony125 => 8,
Isotope::Tellurium123 => 2,
Isotope::Tellurium125 => 2,
Isotope::Iodine127 => 6,
Isotope::Iodine129 => 8,
Isotope::Xenon129 => 2,
Isotope::Xenon131 => 4,
Isotope::Caesium133 => 8,
Isotope::Caesium134 => 9,
Isotope::Caesium135 => 8,
Isotope::Caesium137 => 8,
Isotope::Barium133 => 2,
Isotope::Barium135 => 4,
Isotope::Barium137 => 4,
Isotope::Lanthanum137 => 8,
Isotope::Lanthanum138 => 11,
Isotope::Lanthanum139 => 8,
Isotope::Cerium140 => 1,
Isotope::Praseodymium141 => 8,
Isotope::Samarium147 => 8,
Isotope::Samarium149 => 8,
Isotope::Samarium151 => 6,
Isotope::Europium151 => 6,
Isotope::Europium152 => 7,
Isotope::Europium153 => 6,
Isotope::Europium154 => 7,
Isotope::Europium155 => 6,
Isotope::Gadolinium155 => 4,
Isotope::Gadolinium157 => 4,
Isotope::Terbium157 => 4,
Isotope::Terbium159 => 4,
Isotope::Terbium160 => 7,
Isotope::Dysprosium161 => 6,
Isotope::Dysprosium163 => 6,
Isotope::Holmium165 => 8,
Isotope::Erbium167 => 8,
Isotope::Thulium169 => 2,
Isotope::Thulium171 => 2,
Isotope::Ytterbium171 => 2,
Isotope::Ytterbium173 => 6,
Isotope::Lutetium173 => 8,
Isotope::Lutetium174 => 3,
Isotope::Lutetium175 => 8,
Isotope::Lutetium176 => 15,
Isotope::Hafnium177 => 8,
Isotope::Hafnium179 => 10,
Isotope::Tantalum180 => 19,
Isotope::Tantalum181 => 8,
Isotope::Tungsten183 => 2,
Isotope::Rhenium185 => 6,
Isotope::Rhenium187 => 6,
Isotope::Osmium187 => 2,
Isotope::Osmium189 => 4,
Isotope::Iridium191 => 4,
Isotope::Iridium193 => 4,
Isotope::Platinum195 => 2,
Isotope::Gold197 => 4,
Isotope::Mercury199 => 2,
Isotope::Mercury201 => 4,
Isotope::Thallium203 => 2,
Isotope::Thallium204 => 5,
Isotope::Thallium205 => 2,
Isotope::Lead207 => 2,
Isotope::Bismuth207 => 10,
Isotope::Bismuth209 => 10,
Isotope::Polonium209 => 2,
Isotope::Actinium227 => 4,
Isotope::Thorium229 => 6,
Isotope::Uranium235 => 8,
Isotope::Neptunium237 => 6,
Isotope::Plutonium239 => 2,
Isotope::Americium243 => 6,
_ => 1,
}
}
pub fn most_common_for(element: &Element) -> Isotope{
match element{
Element::Electron => Isotope::Electron,
Element::Hydrogen => Isotope::Hydrogen1,
Element::Helium => Isotope::Helium4,
Element::Lithium => Isotope::Lithium7,
Element::Beryllium => Isotope::Beryllium9,
Element::Boron => Isotope::Boron11,
Element::Carbon => Isotope::Carbon12,
Element::Nitrogen => Isotope::Nitrogen14,
Element::Oxygen => Isotope::Oxygen16,
Element::Fluorine => Isotope::Fluorine19,
Element::Neon => Isotope::Neon20,
Element::Sodium => Isotope::Sodium23,
Element::Magnesium => Isotope::Magnesium24,
Element::Aluminium => Isotope::Aluminium27,
Element::Silicon => Isotope::Silicon28,
Element::Phosphorus => Isotope::Phosphorus31,
Element::Sulfur => Isotope::Sulfur32,
Element::Chlorine => Isotope::Chlorine35,
Element::Argon => Isotope::Argon40,
Element::Potassium => Isotope::Potassium39,
Element::Calcium => Isotope::Calcium40,
Element::Scandium => Isotope::Scandium45,
Element::Titanium => Isotope::Titanium48,
Element::Vanadium => Isotope::Vanadium51,
Element::Chromium => Isotope::Chromium52,
Element::Manganese => Isotope::Manganese55,
Element::Iron => Isotope::Iron56,
Element::Cobalt => Isotope::Cobalt59,
Element::Nickel => Isotope::Nickel58,
Element::Copper => Isotope::Copper63,
Element::Zinc => Isotope::Zinc64,
Element::Gallium => Isotope::Gallium69,
Element::Germanium => Isotope::Germanium73,
Element::Arsenic => Isotope::Arsenic75,
Element::Selenium => Isotope::Selenium78,
Element::Bromine => Isotope::Bromine79,
Element::Krypton => Isotope::Krypton84,
Element::Rubidium => Isotope::Rubidium85,
Element::Strontium => Isotope::Strontium88,
Element::Yttrium => Isotope::Yttrium89,
Element::Zirconium => Isotope::Zirconium90,
Element::Niobium => Isotope::Niobium93,
Element::Molybdenum => Isotope::Molybdenum98,
Element::Technetium => Isotope::Technetium99,
Element::Ruthenium => Isotope::Ruthenium102,
Element::Rhodium => Isotope::Rhodium103,
Element::Palladium => Isotope::Palladium106,
Element::Silver => Isotope::Silver107,
Element::Cadmium => Isotope::Cadmium114,
Element::Indium => Isotope::Indium115,
Element::Tin => Isotope::Tin120,
Element::Antimony => Isotope::Antimony121,
Element::Tellurium => Isotope::Tellurium130,
Element::Iodine => Isotope::Iodine127,
Element::Xenon => Isotope::Xenon132,
Element::Caesium => Isotope::Caesium133,
Element::Barium => Isotope::Barium138,
Element::Lanthanum => Isotope::Lanthanum139,
Element::Cerium => Isotope::Cerium140,
Element::Praseodymium => Isotope::Praseodymium141,
Element::Neodymium => Isotope::Neodymium144,
Element::Promethium => Isotope::Promethium141,
Element::Samarium => Isotope::Samarium152,
Element::Europium => Isotope::Europium153,
Element::Gadolinium => Isotope::Gadolinium156,
Element::Terbium => Isotope::Terbium159,
Element::Dysprosium => Isotope::Dysprosium165,
Element::Holmium => Isotope::Holmium165,
Element::Erbium => Isotope::Erbium166,
Element::Thulium => Isotope::Thulium169,
Element::Ytterbium => Isotope::Ytterbium174,
Element::Lutetium => Isotope::Lutetium175,
Element::Hafnium => Isotope::Hafnium180,
Element::Tantalum => Isotope::Tantalum181,
Element::Tungsten => Isotope::Tungsten184,
Element::Rhenium => Isotope::Rhenium187,
Element::Osmium => Isotope::Osmium192,
Element::Iridium => Isotope::Iridium193,
Element::Platinum => Isotope::Platinum195,
Element::Gold => Isotope::Gold197,
Element::Mercury => Isotope::Mercury202,
Element::Thallium => Isotope::Thallium205,
Element::Lead => Isotope::Lead208,
Element::Bismuth => Isotope::Bismuth209,
Element::Polonium => Isotope::Polonium210,
Element::Astatine => Isotope::Astatine210,
Element::Radon => Isotope::Radon222,
Element::Francium => Isotope::Francium223,
Element::Radium => Isotope::Radium226,
Element::Actinium => Isotope::Actinium227,
Element::Thorium => Isotope::Thorium232,
Element::Protactinium => Isotope::Protactinium231,
Element::Uranium => Isotope::Uranium238,
Element::Neptunium => Isotope::Neptunium237,
Element::Plutonium => Isotope::Plutonium239,
Element::Americium => Isotope::Americium243,
Element::Curium => Isotope::Curium247,
Element::Berkelium => Isotope::Berkelium247,
Element::Californium => Isotope::Californium251,
Element::Einsteinium => Isotope::Einsteinium252,
Element::Fermium => Isotope::Fermium257,
Element::Mendelevium => Isotope::Mendelevium258,
Element::Nobelium => Isotope::Nobelium259,
Element::Lawrencium => Isotope::Lawrencium266,
Element::Rutherfordium => Isotope::Rutherfordium267,
Element::Dubnium => Isotope::Dubnium268,
Element::Seaborgium => Isotope::Seaborgium269,
Element::Bohrium => Isotope::Bohrium278,
Element::Hassium => Isotope::Hassium270,
Element::Meitnerium => Isotope::Meitnerium278,
Element::Darmstadtium => Isotope::Darmstadtium281,
Element::Roentgenium => Isotope::Roentgenium282,
Element::Copernicium => Isotope::Copernicium285,
Element::Nihonium => Isotope::Nihonium286,
Element::Flerovium => Isotope::Flerovium289,
Element::Moscovium => Isotope::Moscovium289,
Element::Livermorium => Isotope::Livermorium293,
Element::Tennessine => Isotope::Tennessine294,
Element::Oganesson => Isotope::Oganesson294,
}
}
pub fn from(isotope_string: &str) -> Result<Isotope,CluEError>{
match isotope_string{
"e" => Ok(Isotope::Electron ),
"1H" => Ok(Isotope::Hydrogen1 ),
"2H" => Ok(Isotope::Hydrogen2 ),
"3H" => Ok(Isotope::Hydrogen3 ),
"3He" => Ok(Isotope::Helium3 ),
"4He" => Ok(Isotope::Helium4 ),
"6Li" => Ok(Isotope::Lithium6 ),
"7Li" => Ok(Isotope::Lithium7 ),
"9Be" => Ok(Isotope::Beryllium9 ),
"10B" => Ok(Isotope::Boron10 ),
"11B" => Ok(Isotope::Boron11 ),
"12C" => Ok(Isotope::Carbon12 ),
"13C" => Ok(Isotope::Carbon13 ),
"14N" => Ok(Isotope::Nitrogen14 ),
"15N" => Ok(Isotope::Nitrogen15 ),
"16O" => Ok(Isotope::Oxygen16 ),
"17O" => Ok(Isotope::Oxygen17 ),
"19F" => Ok(Isotope::Fluorine19 ),
"20Ne" => Ok(Isotope::Neon20 ),
"21Ne" => Ok(Isotope::Neon21 ),
"22NA" => Ok(Isotope::Sodium22 ),
"23Na" => Ok(Isotope::Sodium23 ),
"24Mg" => Ok(Isotope::Magnesium24),
"25Mg" => Ok(Isotope::Magnesium25),
"27Al" => Ok(Isotope::Aluminium27),
"28Si" => Ok(Isotope::Silicon28 ),
"29Si" => Ok(Isotope::Silicon29 ),
"31P" => Ok(Isotope::Phosphorus31),
"32S" => Ok(Isotope::Sulfur32 ),
"33S" => Ok(Isotope::Sulfur33 ),
"35Cl" => Ok(Isotope::Chlorine35 ),
"36Cl" => Ok(Isotope::Chlorine36 ),
"37Cl" => Ok(Isotope::Chlorine37 ),
"39Ar" => Ok(Isotope::Argon39 ),
"40Ar" => Ok(Isotope::Argon40 ),
"39K" => Ok(Isotope::Potassium39),
"40K" => Ok(Isotope::Potassium40),
"41K" => Ok(Isotope::Potassium41),
"40Ca" => Ok(Isotope::Calcium40 ),
"41Ca" => Ok(Isotope::Calcium41 ),
"43Ca" => Ok(Isotope::Calcium43 ),
"45Sc" => Ok(Isotope::Scandium45),
"47Ti" => Ok(Isotope::Titanium47),
"48Ti" => Ok(Isotope::Titanium48),
"49Ti" => Ok(Isotope::Titanium49),
"50V" => Ok(Isotope::Vanadium50 ),
"51V" => Ok(Isotope::Vanadium51),
"52Cr" => Ok(Isotope::Chromium52),
"53Cr" => Ok(Isotope::Chromium53),
"53Mn" => Ok(Isotope::Manganese53),
"55Mn" => Ok(Isotope::Manganese55),
"56Fe" => Ok(Isotope::Iron56),
"57Fe" => Ok(Isotope::Iron57),
"59Co" => Ok(Isotope::Cobalt59),
"60Co" => Ok(Isotope::Cobalt60),
"58Ni" => Ok(Isotope::Nickel58),
"61Ni" => Ok(Isotope::Nickel61),
"63Cu" => Ok(Isotope::Copper63),
"65Cu" => Ok(Isotope::Copper65),
"64Zn" => Ok(Isotope::Zinc64),
"67Zn" => Ok(Isotope::Zinc67),
"69Ga" => Ok(Isotope::Gallium69),
"71Ga" => Ok(Isotope::Gallium71),
"73Ge" => Ok(Isotope::Germanium73),
"74Ge" => Ok(Isotope::Germanium74),
"75As" => Ok(Isotope::Arsenic75),
"77Se" => Ok(Isotope::Selenium77),
"78Se" => Ok(Isotope::Selenium78),
"79Se" => Ok(Isotope::Selenium79),
"79Br" => Ok(Isotope::Bromine79),
"81Br" => Ok(Isotope::Bromine81),
"83Kr" => Ok(Isotope::Krypton83),
"84Kr" => Ok(Isotope::Krypton84),
"85Kr" => Ok(Isotope::Krypton85),
"85Rb" => Ok(Isotope::Rubidium85),
"87Rb" => Ok(Isotope::Rubidium87),
"87Sr" => Ok(Isotope::Strontium87),
"88Sr" => Ok(Isotope::Strontium88),
"89Y" => Ok(Isotope::Yttrium89),
"90Zr" => Ok(Isotope::Zirconium90),
"91Zr" => Ok(Isotope::Zirconium91),
"93Nb" => Ok(Isotope::Niobium93),
"95Mo" => Ok(Isotope::Molybdenum95),
"97Mo" => Ok(Isotope::Molybdenum97),
"98Mo" => Ok(Isotope::Molybdenum98),
"99Tc" => Ok(Isotope::Technetium99),
"99Ru" => Ok(Isotope::Ruthenium99),
"101Ru" => Ok(Isotope::Ruthenium101),
"102Ru" => Ok(Isotope::Ruthenium102),
"103Rh" => Ok(Isotope::Rhodium103),
"105Pd" => Ok(Isotope::Palladium105),
"106Pd" => Ok(Isotope::Palladium106),
"107Ag" => Ok(Isotope::Silver107 ),
"109Ag" => Ok(Isotope::Silver109),
"111Cd" => Ok(Isotope::Cadmium111),
"113Cd" => Ok(Isotope::Cadmium113),
"114Cd" => Ok(Isotope::Cadmium114),
"113In" => Ok(Isotope::Indium113),
"115In" => Ok(Isotope::Indium115),
"115Sn" => Ok(Isotope::Tin115),
"117Sn" => Ok(Isotope::Tin117),
"119Sn" => Ok(Isotope::Tin119),
"120Sn" => Ok(Isotope::Tin120),
"121Sb" => Ok(Isotope::Antimony121),
"123Sb" => Ok(Isotope::Antimony123),
"125Sb" => Ok(Isotope::Antimony125),
"123Te" => Ok(Isotope::Tellurium123),
"125Te" => Ok(Isotope::Tellurium125),
"130Te" => Ok(Isotope::Tellurium130),
"127I" => Ok(Isotope::Iodine127),
"129I" => Ok(Isotope::Iodine129),
"129Xe" => Ok(Isotope::Xenon129),
"131Xe" => Ok(Isotope::Xenon131),
"132Xe" => Ok(Isotope::Xenon132),
"133Cs" => Ok(Isotope::Caesium133),
"134Cs" => Ok(Isotope::Caesium134),
"135Cs" => Ok(Isotope::Caesium135),
"137Cs" => Ok(Isotope::Caesium137),
"133Ba" => Ok(Isotope::Barium133),
"134Ba" => Ok(Isotope::Barium135),
"137Ba" => Ok(Isotope::Barium137),
"138Ba" => Ok(Isotope::Barium138),
"137La" => Ok(Isotope::Lanthanum137),
"138La" => Ok(Isotope::Lanthanum138),
"139La" => Ok(Isotope::Lanthanum139),
"140Ce" => Ok(Isotope::Cerium140),
"141Pr" => Ok(Isotope::Praseodymium141),
"143Nd" => Ok(Isotope::Neodymium143),
"144Nd" => Ok(Isotope::Neodymium144),
"145Nd" => Ok(Isotope::Neodymium145),
"141Pm" => Ok(Isotope::Promethium141),
"147Sm" => Ok(Isotope::Samarium147),
"149Sm" => Ok(Isotope::Samarium149),
"151Sm" => Ok(Isotope::Samarium151),
"152Sm" => Ok(Isotope::Samarium152),
"151Eu" => Ok(Isotope::Europium151),
"152Eu" => Ok(Isotope::Europium152),
"153Eu" => Ok(Isotope::Europium153),
"154Eu" => Ok(Isotope::Europium154),
"155Eu" => Ok(Isotope::Europium155),
"155Gd" => Ok(Isotope::Gadolinium155),
"1566Gd" => Ok(Isotope::Gadolinium156),
"157Gd" => Ok(Isotope::Gadolinium157),
"157Tb" => Ok(Isotope::Terbium157),
"159Tb" => Ok(Isotope::Terbium159),
"160Tb" => Ok(Isotope::Terbium160),
"161Dy" => Ok(Isotope::Dysprosium161),
"163Dy" => Ok(Isotope::Dysprosium163),
"165Dy" => Ok(Isotope::Dysprosium165),
"165Ho" => Ok(Isotope::Holmium165),
"166Er" => Ok(Isotope::Erbium166),
"167Er" => Ok(Isotope::Erbium167),
"169Tm" => Ok(Isotope::Thulium169),
"171Tm" => Ok(Isotope::Thulium171),
"171Yb" => Ok(Isotope::Ytterbium171),
"173Yb" => Ok(Isotope::Ytterbium173),
"174Yb" => Ok(Isotope::Ytterbium174),
"173Lu" => Ok(Isotope::Lutetium173),
"174Lu" => Ok(Isotope::Lutetium174),
"175Lu" => Ok(Isotope::Lutetium175),
"176Lu" => Ok(Isotope::Lutetium176),
"177Hf" => Ok(Isotope::Hafnium177),
"179Hf" => Ok(Isotope::Hafnium179),
"180Hf" => Ok(Isotope::Hafnium180),
"180Ta" => Ok(Isotope::Tantalum180),
"181Ta" => Ok(Isotope::Tantalum181),
"183W" => Ok(Isotope::Tungsten183),
"184W" => Ok(Isotope::Tungsten184),
"185Rh" => Ok(Isotope::Rhenium185),
"187Rh" => Ok(Isotope::Rhenium187),
"187Os" => Ok(Isotope::Osmium187),
"189Os" => Ok(Isotope::Osmium189),
"192Os" => Ok(Isotope::Osmium192),
"191Ir" => Ok(Isotope::Iridium191),
"193Ir" => Ok(Isotope::Iridium193),
"194Pt" => Ok(Isotope::Platinum194),
"195Pt" => Ok(Isotope::Platinum195),
"197Au" => Ok(Isotope::Gold197),
"199Hg" => Ok(Isotope::Mercury199),
"201Hg" => Ok(Isotope::Mercury201),
"202Hg" => Ok(Isotope::Mercury202),
"203Tl" => Ok(Isotope::Thallium203),
"204Tl" => Ok(Isotope::Thallium204),
"205Tl" => Ok(Isotope::Thallium205),
"207Pb" => Ok(Isotope::Lead207),
"208Pb" => Ok(Isotope::Lead208),
"207Bi" => Ok(Isotope::Bismuth207),
"209Bi" => Ok(Isotope::Bismuth209),
"209Po" => Ok(Isotope::Polonium209),
"210Po" => Ok(Isotope::Polonium210),
"210AT" => Ok(Isotope::Astatine210),
"222Rn" => Ok(Isotope::Radon222),
"223Fr" => Ok(Isotope::Francium223),
"226Ra" => Ok(Isotope::Radium226),
"227Ac" => Ok(Isotope::Actinium227),
"229Th" => Ok(Isotope::Thorium229),
"232Th" => Ok(Isotope::Thorium232),
"231Pa" => Ok(Isotope::Protactinium231),
"235U" => Ok(Isotope::Uranium235),
"238U" => Ok(Isotope::Uranium238),
"237Np" => Ok(Isotope::Neptunium237),
"239Pu" => Ok(Isotope::Plutonium239),
"243Am" => Ok(Isotope::Americium243),
"247Cm" => Ok(Isotope::Curium247),
"247Bk" => Ok(Isotope::Berkelium247),
"251Cf" => Ok(Isotope::Californium251),
"252Es" => Ok(Isotope::Einsteinium252),
"257Fm" => Ok(Isotope::Fermium257),
"258Md" => Ok(Isotope::Mendelevium258),
"259No" => Ok(Isotope::Nobelium259),
"266Lr" => Ok(Isotope::Lawrencium266),
"267Rf" => Ok(Isotope::Rutherfordium267),
"268Db" => Ok(Isotope::Dubnium268),
"269Sg" => Ok(Isotope::Seaborgium269),
"278Bh" => Ok(Isotope::Bohrium278),
"270Hs" => Ok(Isotope::Hassium270),
"278Mt" => Ok(Isotope::Meitnerium278),
"281Ds" => Ok(Isotope::Darmstadtium281 ),
"282Rg" => Ok(Isotope::Roentgenium282),
"285Cn" => Ok(Isotope::Copernicium285),
"286Nh" => Ok(Isotope::Nihonium286),
"289Fl" => Ok(Isotope::Flerovium289),
"289Mc" => Ok(Isotope::Moscovium289),
"293Lv" => Ok(Isotope::Livermorium293),
"294Ts" => Ok(Isotope::Tennessine294),
"294Og" => Ok(Isotope::Oganesson294),
_ => Err(CluEError::CannotParseIsotope(isotope_string.to_string())),
}
}
}
impl ToString for Isotope{
fn to_string(&self) -> String{
match self{
Isotope::Electron => "e".to_string(),
Isotope::Hydrogen1 => "1H".to_string(),
Isotope::Hydrogen2 => "2H".to_string(),
Isotope::Hydrogen3 => "3H".to_string(),
Isotope::Helium3 => "3He".to_string(),
Isotope::Helium4 => "4He".to_string(),
Isotope::Lithium6 => "6Li".to_string(),
Isotope::Lithium7 => "7Li".to_string(),
Isotope::Beryllium9 => "9Be".to_string(),
Isotope::Boron10 => "10B".to_string(),
Isotope::Boron11 => "11B".to_string(),
Isotope::Carbon12 => "12C".to_string(),
Isotope::Carbon13 => "13C".to_string(),
Isotope::Nitrogen14 => "14N".to_string(),
Isotope::Nitrogen15 => "15N".to_string(),
Isotope::Oxygen16 => "16O".to_string(),
Isotope::Oxygen17 => "17O".to_string(),
Isotope::Fluorine19 => "19F".to_string(),
Isotope::Neon20 => "20Ne".to_string(),
Isotope::Neon21 => "21Ne".to_string(),
Isotope::Sodium22 => "22NA".to_string(),
Isotope::Sodium23 => "23Na".to_string(),
Isotope::Magnesium24=> "24Mg".to_string(),
Isotope::Magnesium25=> "25Mg".to_string(),
Isotope::Aluminium27=> "27Al".to_string(),
Isotope::Silicon28 => "28Si".to_string(),
Isotope::Silicon29 => "29Si".to_string(),
Isotope::Phosphorus31=> "31P".to_string(),
Isotope::Sulfur32 => "32S".to_string(),
Isotope::Sulfur33 => "33S".to_string(),
Isotope::Chlorine35 => "35Cl".to_string(),
Isotope::Chlorine36 => "36Cl".to_string(),
Isotope::Chlorine37 => "37Cl".to_string(),
Isotope::Argon39 => "39Ar".to_string(),
Isotope::Argon40 => "40Ar".to_string(),
Isotope::Potassium39=> "39K".to_string(),
Isotope::Potassium40=> "40K".to_string(),
Isotope::Potassium41=> "41K".to_string(),
Isotope::Calcium40=> "40Ca".to_string(),
Isotope::Calcium41 => "41Ca".to_string(),
Isotope::Calcium43 => "43Ca".to_string(),
Isotope::Scandium45=> "45Sc".to_string(),
Isotope::Titanium47=> "47Ti".to_string(),
Isotope::Titanium48=> "48Ti".to_string(),
Isotope::Titanium49=> "49Ti".to_string(),
Isotope::Vanadium50 => "50V".to_string(),
Isotope::Vanadium51=> "51V".to_string(),
Isotope::Chromium52=> "52Cr".to_string(),
Isotope::Chromium53=> "53Cr".to_string(),
Isotope::Manganese53=> "53Mn".to_string(),
Isotope::Manganese55=> "55Mn".to_string(),
Isotope::Iron56=> "56Fe".to_string(),
Isotope::Iron57=> "57Fe".to_string(),
Isotope::Cobalt59=> "59Co".to_string(),
Isotope::Cobalt60=> "60Co".to_string(),
Isotope::Nickel58=> "58Ni".to_string(),
Isotope::Nickel61=> "61Ni".to_string(),
Isotope::Copper63=> "63Cu".to_string(),
Isotope::Copper65=> "65Cu".to_string(),
Isotope::Zinc64=> "64Zn".to_string(),
Isotope::Zinc67=> "67Zn".to_string(),
Isotope::Gallium69=> "69Ga".to_string(),
Isotope::Gallium71=> "71Ga".to_string(),
Isotope::Germanium73=> "73Ge".to_string(),
Isotope::Germanium74=> "74Ge".to_string(),
Isotope::Arsenic75=> "75As".to_string(),
Isotope::Selenium77=> "77Se".to_string(),
Isotope::Selenium78=> "78Se".to_string(),
Isotope::Selenium79=> "79Se".to_string(),
Isotope::Bromine79=> "79Br".to_string(),
Isotope::Bromine81=> "81Br".to_string(),
Isotope::Krypton83=> "83Kr".to_string(),
Isotope::Krypton84=> "84Kr".to_string(),
Isotope::Krypton85=> "85Kr".to_string(),
Isotope::Rubidium85=> "85Rb".to_string(),
Isotope::Rubidium87=> "87Rb".to_string(),
Isotope::Strontium87=> "87Sr".to_string(),
Isotope::Strontium88=> "88Sr".to_string(),
Isotope::Yttrium89=> "89Y".to_string(),
Isotope::Zirconium90=> "90Zr".to_string(),
Isotope::Zirconium91=> "91Zr".to_string(),
Isotope::Niobium93=> "93Nb".to_string(),
Isotope::Molybdenum95=> "95Mo".to_string(),
Isotope::Molybdenum97=> "97Mo".to_string(),
Isotope::Molybdenum98=> "98Mo".to_string(),
Isotope::Technetium99=> "99Tc".to_string(),
Isotope::Ruthenium99=> "99Ru".to_string(),
Isotope::Ruthenium101=> "101Ru".to_string(),
Isotope::Ruthenium102=> "102Ru".to_string(),
Isotope::Rhodium103=> "103Rh".to_string(),
Isotope::Palladium105=> "105Pd".to_string(),
Isotope::Palladium106=> "106Pd".to_string(),
Isotope::Silver107 => "107Ag".to_string(),
Isotope::Silver109=> "109Ag".to_string(),
Isotope::Cadmium111=> "111Cd".to_string(),
Isotope::Cadmium113=> "113Cd".to_string(),
Isotope::Cadmium114=> "114Cd".to_string(),
Isotope::Indium113=> "113In".to_string(),
Isotope::Indium115=> "115In".to_string(),
Isotope::Tin115=> "115Sn".to_string(),
Isotope::Tin117=> "117Sn".to_string(),
Isotope::Tin119=> "119Sn".to_string(),
Isotope::Tin120=> "120Sn".to_string(),
Isotope::Antimony121=> "121Sb".to_string(),
Isotope::Antimony123=> "123Sb".to_string(),
Isotope::Antimony125=> "125Sb".to_string(),
Isotope::Tellurium123=> "123Te".to_string(),
Isotope::Tellurium125=> "125Te".to_string(),
Isotope::Tellurium130=> "130Te".to_string(),
Isotope::Iodine127=> "127I".to_string(),
Isotope::Iodine129=> "129I".to_string(),
Isotope::Xenon129=> "129Xe".to_string(),
Isotope::Xenon131=> "131Xe".to_string(),
Isotope::Xenon132=> "132Xe".to_string(),
Isotope::Caesium133=> "133Cs".to_string(),
Isotope::Caesium134=> "134Cs".to_string(),
Isotope::Caesium135=> "135Cs".to_string(),
Isotope::Caesium137=> "137Cs".to_string(),
Isotope::Barium133=> "133Ba".to_string(),
Isotope::Barium135=> "134Ba".to_string(),
Isotope::Barium137=> "137Ba".to_string(),
Isotope::Barium138=> "138Ba".to_string(),
Isotope::Lanthanum137=> "137La".to_string(),
Isotope::Lanthanum138=> "138La".to_string(),
Isotope::Lanthanum139=> "139La".to_string(),
Isotope::Cerium140=> "140Ce".to_string(),
Isotope::Praseodymium141=> "141Pr".to_string(),
Isotope::Neodymium143=> "143Nd".to_string(),
Isotope::Neodymium144=> "144Nd".to_string(),
Isotope::Neodymium145=> "145Nd".to_string(),
Isotope::Promethium141=> "141Pr".to_string(),
Isotope::Samarium147=> "147Sm".to_string(),
Isotope::Samarium149=> "149Sm".to_string(),
Isotope::Samarium151=> "151Sm".to_string(),
Isotope::Samarium152=> "152Sm".to_string(),
Isotope::Europium151=> "151Eu".to_string(),
Isotope::Europium152=> "152Eu".to_string(),
Isotope::Europium153=> "153Eu".to_string(),
Isotope::Europium154=> "154Eu".to_string(),
Isotope::Europium155=> "155Eu".to_string(),
Isotope::Gadolinium155=> "155Gd".to_string(),
Isotope::Gadolinium156=> "1566Gd".to_string(),
Isotope::Gadolinium157=> "157Gd".to_string(),
Isotope::Terbium157=> "157Tb".to_string(),
Isotope::Terbium159=> "159Tb".to_string(),
Isotope::Terbium160=> "160Tb".to_string(),
Isotope::Dysprosium161=> "161Dy".to_string(),
Isotope::Dysprosium163=> "163Dy".to_string(),
Isotope::Dysprosium165=> "165Dy".to_string(),
Isotope::Holmium165=> "165Ho".to_string(),
Isotope::Erbium166=> "166Er".to_string(),
Isotope::Erbium167=> "167Er".to_string(),
Isotope::Thulium169=> "169Tm".to_string(),
Isotope::Thulium171=> "171Tm".to_string(),
Isotope::Ytterbium171=> "171Yb".to_string(),
Isotope::Ytterbium173=> "173Yb".to_string(),
Isotope::Ytterbium174=> "174Yb".to_string(),
Isotope::Lutetium173=> "173Lu".to_string(),
Isotope::Lutetium174=> "174Lu".to_string(),
Isotope::Lutetium175=> "175Lu".to_string(),
Isotope::Lutetium176=> "176Lu".to_string(),
Isotope::Hafnium177=> "177Hf".to_string(),
Isotope::Hafnium179=> "179Hf".to_string(),
Isotope::Hafnium180=> "180Hf".to_string(),
Isotope::Tantalum180=> "180Ta".to_string(),
Isotope::Tantalum181=> "181Ta".to_string(),
Isotope::Tungsten183=> "183W".to_string(),
Isotope::Tungsten184=> "184W".to_string(),
Isotope::Rhenium185=> "185Rh".to_string(),
Isotope::Rhenium187=> "187Rh".to_string(),
Isotope::Osmium187=> "187Os".to_string(),
Isotope::Osmium189=> "189Os".to_string(),
Isotope::Osmium192=> "192Os".to_string(),
Isotope::Iridium191=> "191Ir".to_string(),
Isotope::Iridium193=> "193Ir".to_string(),
Isotope::Platinum194=> "194Pt".to_string(),
Isotope::Platinum195=> "195Pt".to_string(),
Isotope::Gold197=> "197Au".to_string(),
Isotope::Mercury199=> "199Hg".to_string(),
Isotope::Mercury201=> "201Hg".to_string(),
Isotope::Mercury202=> "202Hg".to_string(),
Isotope::Thallium203=> "203Tl".to_string(),
Isotope::Thallium204=> "204Tl".to_string(),
Isotope::Thallium205=> "205Tl".to_string(),
Isotope::Lead207=> "207Pb".to_string(),
Isotope::Lead208=> "208Pb".to_string(),
Isotope::Bismuth207=> "207Bi".to_string(),
Isotope::Bismuth209=> "209Bi".to_string(),
Isotope::Polonium209=> "209Po".to_string(),
Isotope::Polonium210=> "210Po".to_string(),
Isotope::Astatine210=> "210AT".to_string(),
Isotope::Radon222=> "222Rn".to_string(),
Isotope::Francium223=> "223Fr".to_string(),
Isotope::Radium226=> "226Ra".to_string(),
Isotope::Actinium227=> "227Ac".to_string(),
Isotope::Thorium229=> "229Th".to_string(),
Isotope::Thorium232=> "232Th".to_string(),
Isotope::Protactinium231=> "231Pa".to_string(),
Isotope::Uranium235=> "235U".to_string(),
Isotope::Uranium238=> "238U".to_string(),
Isotope::Neptunium237=> "237Np".to_string(),
Isotope::Plutonium239=> "239Pu".to_string(),
Isotope::Americium243=> "243Am".to_string(),
Isotope::Curium247=> "247Cm".to_string(),
Isotope::Berkelium247=> "247Bk".to_string(),
Isotope::Californium251=> "251Cf".to_string(),
Isotope::Einsteinium252=> "252Es".to_string(),
Isotope::Fermium257=> "257Fm".to_string(),
Isotope::Mendelevium258=> "258Md".to_string(),
Isotope::Nobelium259=> "259No".to_string(),
Isotope::Lawrencium266=> "266Lr".to_string(),
Isotope::Rutherfordium267=> "267Rf".to_string(),
Isotope::Dubnium268=> "268Db".to_string(),
Isotope::Seaborgium269=> "269Sg".to_string(),
Isotope::Bohrium278=> "278Bh".to_string(),
Isotope::Hassium270=> "270Hs".to_string(),
Isotope::Meitnerium278=> "278Mt".to_string(),
Isotope::Darmstadtium281 => "281Ds".to_string(),
Isotope::Roentgenium282=> "282Rg".to_string(),
Isotope::Copernicium285=> "285Cn".to_string(),
Isotope::Nihonium286=> "286Nh".to_string(),
Isotope::Flerovium289=> "289Fl".to_string(),
Isotope::Moscovium289=> "289Mc".to_string(),
Isotope::Livermorium293=> "293Lv".to_string(),
Isotope::Tennessine294=> "294Ts".to_string(),
Isotope::Oganesson294=> "294Og".to_string(),
}
}
}