- {
- “cells”: [
- {
“cell_type”: “markdown”, “id”: “tribal-recall”, “metadata”: {}, “source”: [
“# User Guiden”, “n”, “This package provides a common interface to work with reactions and decay treesn”, “for several kinds of elements (string-based, PDG, …). It is therefore goodn”, “separating the part corresponding to the treatment of the reactions and decays ton”, “that corresponding to the underlying elements.”
]
}, {
“cell_type”: “markdown”, “id”: “removable-surface”, “metadata”: {}, “source”: [
“## Reactions and decaysn”, “n”, “Reactions and decays can be acessed through the reactions.make_reactionn”, “and reactions.make_decay functions, respectively. The syntax for both is veryn”, “similar, and can be consulted in the [syntax section](../syntax.rst).”
]
}, {
“cell_type”: “code”, “execution_count”: 1, “id”: “tough-manitoba”, “metadata”: {
- “execution”: {
“iopub.execute_input”: “2021-04-27T12:44:51.238952Z”, “iopub.status.busy”: “2021-04-27T12:44:51.233996Z”, “iopub.status.idle”: “2021-04-27T12:44:51.252966Z”, “shell.execute_reply”: “2021-04-27T12:44:51.252241Z”
}
}, “outputs”: [], “source”: [
“import reactionsn”, “r = reactions.reaction(‘A B -> C D’)”
]
}, {
“cell_type”: “markdown”, “id”: “printable-answer”, “metadata”: {}, “source”: [
“This reaction corresponds to two reactants A and B that generate two products C and D. By default, the elements of this reaction contain simply a string. We can create more complex chains of reactions:”
]
}, {
“cell_type”: “code”, “execution_count”: 2, “id”: “aware-possibility”, “metadata”: {
- “execution”: {
“iopub.execute_input”: “2021-04-27T12:44:51.257675Z”, “iopub.status.busy”: “2021-04-27T12:44:51.256943Z”, “iopub.status.idle”: “2021-04-27T12:44:51.260759Z”, “shell.execute_reply”: “2021-04-27T12:44:51.259286Z”
}
}, “outputs”: [], “source”: [
“r = reactions.reaction(‘A B -> {C D -> {E {F -> G H} -> G H I J}}’)”
]
}, {
“cell_type”: “markdown”, “id”: “consecutive-distribution”, “metadata”: {}, “source”: [
“Note that we have used curly braces to define the nested reactions. We can now define a function to explore the reaction and print the corresponding tree. This package provides the function reactions.is_element to distinguish when the node corresponds to an element and when it corresponds to a reaction or a decay.”
]
}, {
“cell_type”: “code”, “execution_count”: 3, “id”: “victorian-practitioner”, “metadata”: {
- “execution”: {
“iopub.execute_input”: “2021-04-27T12:44:51.268391Z”, “iopub.status.busy”: “2021-04-27T12:44:51.267867Z”, “iopub.status.idle”: “2021-04-27T12:44:51.271859Z”, “shell.execute_reply”: “2021-04-27T12:44:51.271423Z”
}
}, “outputs”: [
- {
“name”: “stdout”, “output_type”: “stream”, “text”: [
“reactants:n”, ” - name=An”, ” - name=Bn”, “products:n”, ” reactants:n”, ” - name=Cn”, ” - name=Dn”, ” products:n”, ” reactants:n”, ” - name=En”, ” reactants:n”, ” - name=Fn”, ” products:n”, ” - name=Gn”, ” - name=Hn”, ” products:n”, ” - name=Gn”, ” - name=Hn”, ” - name=In”, ” - name=Jn”
]
}
], “source”: [
“def element_info(e, attributes):n”, ” """ Build a string with the information of an element """n”, ” attributes = attributes or (‘name’,)n”, ” return ‘, ‘.join(f’{a}={getattr(e, a)}’ for a in attributes)n”, “n”, “def print_reaction(reaction, indent=0, attributes=None):n”, ” """ Display a reaction on a simple way """n”, ” prefix = indent * ‘ ‘n”, ” print(f’{prefix}reactants:’)n”, ” for n in reaction.reactants:n”, ” if reactions.is_element(n):n”, ” print(f’{prefix} - {element_info(n, attributes)}’)n”, ” else:n”, ” print_reaction(n, indent=indent + 2)n”, ” print(f’{prefix}products:’)n”, ” for n in reaction.products:n”, ” if reactions.is_element(n):n”, ” print(f’{prefix} - {element_info(n, attributes)}’)n”, ” else:n”, ” print_reaction(n, indent=indent + 2)n”, “n”, “r = reactions.reaction(‘A B -> {C D -> {E {F -> G H} -> G H I J}}’)n”, “n”, “print_reaction(r)”
]
}, {
“cell_type”: “markdown”, “id”: “bronze-configuration”, “metadata”: {}, “source”: [
“A similar function can be defined for decays, that are composed by a head and a set of products:”
]
}, {
“cell_type”: “code”, “execution_count”: 4, “id”: “nuclear-access”, “metadata”: {
- “execution”: {
“iopub.execute_input”: “2021-04-27T12:44:51.276836Z”, “iopub.status.busy”: “2021-04-27T12:44:51.276330Z”, “iopub.status.idle”: “2021-04-27T12:44:51.278949Z”, “shell.execute_reply”: “2021-04-27T12:44:51.279364Z”
}
}, “outputs”: [
- {
“name”: “stdout”, “output_type”: “stream”, “text”: [
“- name=An”, ” products:n”, ” - name=Bn”, ” - name=Cn”, ” products:n”, ” - name=Dn”, ” - name=En”, ” - name=Fn”
]
}
], “source”: [
“def print_decay(decay, indent=0, attributes=None):n”, ” """ Display a reaction on a simple way """n”, ” prefix = indent * ‘ ‘n”, ” print(f’{prefix}- {element_info(decay.head, attributes)}’)n”, ” print(f’{prefix} products:’)n”, ” for n in decay.products:n”, ” if reactions.is_element(n):n”, ” print(f’{prefix} - {element_info(n, attributes)}’)n”, ” else:n”, ” print_decay(n, indent=indent + 2)n”, “n”, “d = reactions.decay(‘A -> B {C -> D E} F’)n”, “n”, “print_decay(d)”
]
}, {
“cell_type”: “markdown”, “id”: “fitting-expression”, “metadata”: {}, “source”: [
“The comparison between reactions and decays is not sensitive to the orther specified in the reactants or the products, thus these expressions are all true:”
]
}, {
“cell_type”: “code”, “execution_count”: 5, “id”: “offensive-cancellation”, “metadata”: {
- “execution”: {
“iopub.execute_input”: “2021-04-27T12:44:51.283456Z”, “iopub.status.busy”: “2021-04-27T12:44:51.282972Z”, “iopub.status.idle”: “2021-04-27T12:44:51.284779Z”, “shell.execute_reply”: “2021-04-27T12:44:51.285186Z”
}
}, “outputs”: [], “source”: [
“assert(reactions.reaction(‘A B -> C D’) == reactions.reaction(‘B A -> C D’))n”, “assert(reactions.reaction(‘A B -> C D’) == reactions.reaction(‘A B -> D C’))n”, “assert(reactions.reaction(‘A B -> C D’) == reactions.reaction(‘B A -> D C’))n”, “assert(reactions.decay(‘A -> B C’) == reactions.decay(‘A -> C B’))”
]
}, {
“cell_type”: “markdown”, “id”: “turned-blackjack”, “metadata”: {}, “source”: [
“However, note that we can not compare reactions with decays, and the comparison between objects must be done for the same underlying type. The kind of element can be specified on construction using the kind keyword argument, as can be seen in the following.”
]
}, {
“cell_type”: “markdown”, “id”: “impressive-airfare”, “metadata”: {}, “source”: [
“## String elementsn”, “This is the default kind of element used when constructing reactions and decays. It has just one property, a string.”
]
}, {
“cell_type”: “code”, “execution_count”: 6, “id”: “indian-count”, “metadata”: {
- “execution”: {
“iopub.execute_input”: “2021-04-27T12:44:51.289450Z”, “iopub.status.busy”: “2021-04-27T12:44:51.288855Z”, “iopub.status.idle”: “2021-04-27T12:44:51.291245Z”, “shell.execute_reply”: “2021-04-27T12:44:51.290778Z”
}
}, “outputs”: [], “source”: [
“B = reactions.string_element(‘B’)n”, “assert(B.name == ‘B’)n”, “r1 = reactions.reaction(‘A B -> C D’)n”, “assert(r.reactants[1] == B)n”, “r2 = reactions.reaction(‘A B -> C D’, kind=’string’)n”, “assert(r.reactants[1] == B)n”, “assert(r1 == r2)”
]
}, {
“cell_type”: “markdown”, “id”: “contrary-outreach”, “metadata”: {}, “source”: [
“This element can be used for simple operations, but is not useful for scientific applications.”
]
}, {
“cell_type”: “markdown”, “id”: “grave-kennedy”, “metadata”: {}, “source”: [
“## PDG elementsn”, “This kind of elements are based on the information from the [Particle Data Group](https://pdglive.lbl.gov) (PDG). Their construction is dones through the reactions.pdg_database class, that acts as a service. This class is provided as a singleton, in such a way that any instance depending storing information of the PDG will access it through this class.n”, “n”, “### Constructing PDG elementsn”, “There are two ways of building this kind of elements: through the database or through the reactions.pdg_element constructor.”
]
}, {
“cell_type”: “code”, “execution_count”: 7, “id”: “remarkable-huntington”, “metadata”: {
- “execution”: {
“iopub.execute_input”: “2021-04-27T12:44:51.294718Z”, “iopub.status.busy”: “2021-04-27T12:44:51.294258Z”, “iopub.status.idle”: “2021-04-27T12:44:51.296032Z”, “shell.execute_reply”: “2021-04-27T12:44:51.296425Z”
}
}, “outputs”: [], “source”: [
“z0_db = reactions.pdg_database(‘Z0’)n”, “z0_el = reactions.pdg_element(‘Z0’)n”, “assert(z0_db == z0_el)”
]
}, {
“cell_type”: “markdown”, “id”: “related-pressure”, “metadata”: {}, “source”: [
“We can also access the elements using the PDG identification number.”
]
}, {
“cell_type”: “code”, “execution_count”: 8, “id”: “swedish-pathology”, “metadata”: {
- “execution”: {
“iopub.execute_input”: “2021-04-27T12:44:51.299941Z”, “iopub.status.busy”: “2021-04-27T12:44:51.299435Z”, “iopub.status.idle”: “2021-04-27T12:44:51.301193Z”, “shell.execute_reply”: “2021-04-27T12:44:51.301584Z”
}
}, “outputs”: [], “source”: [
“z0_db = reactions.pdg_database(310)n”, “z0_el = reactions.pdg_element(310)n”, “assert(z0_db == z0_el)”
]
}, {
“cell_type”: “markdown”, “id”: “finished-headline”, “metadata”: {}, “source”: [
“The PDG elements contain information about the name and PDG ID (unique for each element), three times the charge, mass and width with their lower and upper errors, and whether the element is self charge-conjugate or not. Reactions and decays can be built with this particles providing the pdg value to the kind keyword argument.”
]
}, {
“cell_type”: “code”, “execution_count”: 9, “id”: “thirty-intake”, “metadata”: {
- “execution”: {
“iopub.execute_input”: “2021-04-27T12:44:51.305205Z”, “iopub.status.busy”: “2021-04-27T12:44:51.304744Z”, “iopub.status.idle”: “2021-04-27T12:44:51.306985Z”, “shell.execute_reply”: “2021-04-27T12:44:51.307378Z”
}
}, “outputs”: [
- {
“name”: “stdout”, “output_type”: “stream”, “text”: [
“- name=Z0, pdg_id=23, three_charge=0, mass=91.1876, width=2.4952, is_self_cc=Truen”, ” products:n”, ” - name=mu+, pdg_id=-13, three_charge=3, mass=0.1056583745, width=2.9959837e-19, is_self_cc=Falsen”, ” - name=mu-, pdg_id=13, three_charge=-3, mass=0.1056583745, width=2.9959837e-19, is_self_cc=Falsen”
]
}
], “source”: [
“decay = reactions.decay(‘Z0 -> mu+ mu-’, kind=’pdg’)n”, “print_decay(decay, attributes=[‘name’, ‘pdg_id’, ‘three_charge’, ‘mass’, ‘width’, ‘is_self_cc’])”
]
}, {
“cell_type”: “markdown”, “id”: “stone-mount”, “metadata”: {}, “source”: [
“The values of the mass and width depend on whether these have been measured by the experiments, so for certain particles this information is missing (also for their errors). To check if the information is available you can check whether the returned value is None.”
]
}, {
“cell_type”: “code”, “execution_count”: 10, “id”: “biblical-choir”, “metadata”: {
- “execution”: {
“iopub.execute_input”: “2021-04-27T12:44:51.310693Z”, “iopub.status.busy”: “2021-04-27T12:44:51.310217Z”, “iopub.status.idle”: “2021-04-27T12:44:51.312409Z”, “shell.execute_reply”: “2021-04-27T12:44:51.311992Z”
}
}, “outputs”: [], “source”: [
“assert(reactions.pdg_element(‘H0’).width is None)”
]
}, {
“cell_type”: “markdown”, “id”: “hourly-maintenance”, “metadata”: {}, “source”: [
“The full table used to construct this kind of elements can be consulted [here](../_static/pdg_table.pdf).”
]
}, {
“cell_type”: “markdown”, “id”: “basic-postage”, “metadata”: {}, “source”: [
“### Registering new PDG elementsn”, “It is possible to register custom elements in the database for later use.”
]
}, {
“cell_type”: “code”, “execution_count”: 11, “id”: “existing-masters”, “metadata”: {
- “execution”: {
“iopub.execute_input”: “2021-04-27T12:44:51.317021Z”, “iopub.status.busy”: “2021-04-27T12:44:51.316541Z”, “iopub.status.idle”: “2021-04-27T12:44:51.318712Z”, “shell.execute_reply”: “2021-04-27T12:44:51.319096Z”
}
}, “outputs”: [
- {
“name”: “stdout”, “output_type”: “stream”, “text”: [
“name=A, pdg_id=99999999, three_charge=0, is_self_cc=Truen”, “name=B, pdg_id=99999998, three_charge=0, is_self_cc=Truen”
]
}
], “source”: [
“# register the element from its initialization argumentsn”, “reactions.pdg_database.register_element(‘A’, 99999999, 0, None, None, True)n”, “A = reactions.pdg_database(‘A’)n”, “n”, “# directly register the elementn”, “B = reactions.pdg_element(‘B’, 99999998, 0, None, None, True)n”, “reactions.pdg_database.register_element(B)n”, “n”, “print(element_info(A, attributes=[‘name’, ‘pdg_id’, ‘three_charge’, ‘is_self_cc’]))n”, “print(element_info(B, attributes=[‘name’, ‘pdg_id’, ‘three_charge’, ‘is_self_cc’]))”
]
}, {
“cell_type”: “markdown”, “id”: “simple-while”, “metadata”: {}, “source”: [
“There is one single condition that need to be satisfied in order to register an element, and is that none of the elements registered in the PDG database must have the same name or PDG ID.”
]
}, {
“cell_type”: “markdown”, “id”: “southeast-politics”, “metadata”: {}, “source”: [
“### Changing the energy unitsn”, “It is possible to change the energy units used by the reactions.pdg_element classes with the use of the reactions.pdg_system_of_units object. This class is another singleton which determines the units to be used by all the PDG-related object. The PDG uses GeV units by default. If you want to change them, you simply need to provide the new units as a string.”
]
}, {
“cell_type”: “code”, “execution_count”: 12, “id”: “automotive-center”, “metadata”: {
- “execution”: {
“iopub.execute_input”: “2021-04-27T12:44:51.322928Z”, “iopub.status.busy”: “2021-04-27T12:44:51.322450Z”, “iopub.status.idle”: “2021-04-27T12:44:51.324172Z”, “shell.execute_reply”: “2021-04-27T12:44:51.324556Z”
}
}, “outputs”: [], “source”: [
“z0_mass_gev = reactions.pdg_database(‘Z0’).massn”, “reactions.pdg_system_of_units.set_energy_units(‘MeV’)n”, “z0_mass_mev = reactions.pdg_database(‘Z0’).massn”, “assert(abs(z0_mass_gev - z0_mass_mev * 1e-3) < 1e-12)”
]
}, {
“cell_type”: “markdown”, “id”: “mighty-heath”, “metadata”: {}, “source”: [
“## NuBase elementsn”, “This kind of elements are based on the information of the [NuBase](http://amdc.in2p3.fr/web/nubase_en.html) database. The construction of elements is handled through the reactions.nubase_database and reactions.nubase_element objects, with a similar implementation to PDG elements.n”, “n”, “### Constructing NuBase elementsn”, “Similarly to PDG elements, there are two ways of building NuBase elements: through the database or through the reactions.nubase_element constructor.”
]
}, {
“cell_type”: “code”, “execution_count”: 13, “id”: “intelligent-modern”, “metadata”: {
- “execution”: {
“iopub.execute_input”: “2021-04-27T12:44:51.328511Z”, “iopub.status.busy”: “2021-04-27T12:44:51.328033Z”, “iopub.status.idle”: “2021-04-27T12:44:51.330234Z”, “shell.execute_reply”: “2021-04-27T12:44:51.329828Z”
}
}, “outputs”: [], “source”: [
“proton_db_by_name = reactions.nubase_database(‘1H’)n”, “proton_el_by_name = reactions.nubase_element(‘1H’)n”, “assert(proton_db_by_name == proton_el_by_name)n”, “proton_db_by_id = reactions.nubase_database(1001000)n”, “proton_el_by_id = reactions.nubase_element(1001000)n”, “assert(proton_db_by_id == proton_el_by_id)n”, “n”, “assert(proton_db_by_id == proton_el_by_name)”
]
}, {
“cell_type”: “markdown”, “id”: “following-stranger”, “metadata”: {}, “source”: [
“A NuBase element contains information about its name, ID, whether the nucleus is stable or not, whether it is a ground state and the information about the mass excess and half-life with their corresponding errors, and whether these where obtained from systematics or not.”
]
}, {
“cell_type”: “code”, “execution_count”: 14, “id”: “boring-surveillance”, “metadata”: {
- “execution”: {
“iopub.execute_input”: “2021-04-27T12:44:51.333603Z”, “iopub.status.busy”: “2021-04-27T12:44:51.333117Z”, “iopub.status.idle”: “2021-04-27T12:44:51.335666Z”, “shell.execute_reply”: “2021-04-27T12:44:51.335237Z”
}
}, “outputs”: [
- {
“name”: “stdout”, “output_type”: “stream”, “text”: [
“reactions.nubase_element(name="1H", nubase_id=1001000, atomic_number=1, mass_number=1, mass_excess_and_error_with_tag=(value=7288.97, error=1.300000e-05, tag=False), is_stable=True, half_life_and_error_with_tag=None, is_ground_state=True)n”
]
}
], “source”: [
“print(reactions.nubase_database(‘1H’))”
]
}, {
“cell_type”: “markdown”, “id”: “ordered-baptist”, “metadata”: {}, “source”: [
“The mass excess and half-life information can be missing, in which case the returned value associated to that quantity is None:”
]
}, {
“cell_type”: “code”, “execution_count”: 15, “id”: “vertical-ukraine”, “metadata”: {
- “execution”: {
“iopub.execute_input”: “2021-04-27T12:44:51.339197Z”, “iopub.status.busy”: “2021-04-27T12:44:51.338735Z”, “iopub.status.idle”: “2021-04-27T12:44:51.340492Z”, “shell.execute_reply”: “2021-04-27T12:44:51.340873Z”
}
}, “outputs”: [], “source”: [
“assert(reactions.nubase_element(‘1H’).half_life is None)n”, “assert(reactions.nubase_element(‘76Cu(m)’).mass_excess is None)”
]
}, {
“cell_type”: “markdown”, “id”: “legal-incentive”, “metadata”: {}, “source”: [
“Reactions and decays can be created providing nubase as the kind to reactions.reaction and reactions.decay.”
]
}, {
“cell_type”: “code”, “execution_count”: 16, “id”: “romantic-housing”, “metadata”: {
- “execution”: {
“iopub.execute_input”: “2021-04-27T12:44:51.344365Z”, “iopub.status.busy”: “2021-04-27T12:44:51.343893Z”, “iopub.status.idle”: “2021-04-27T12:44:51.346579Z”, “shell.execute_reply”: “2021-04-27T12:44:51.346156Z”
}
}, “outputs”: [
- {
“name”: “stdout”, “output_type”: “stream”, “text”: [
“- name=1n, nubase_id=1000000, is_stable=Falsen”, ” products:n”, ” - name=1H, nubase_id=1001000, is_stable=Truen”, ” - name=e-, nubase_id=1, is_stable=Truen”
]
}
], “source”: [
“decay = reactions.decay(‘1n -> 1H e-’, kind=’nubase’)n”, “print_decay(decay, attributes=[‘name’, ‘nubase_id’, ‘is_stable’])”
]
}, {
“cell_type”: “markdown”, “id”: “endless-difference”, “metadata”: {}, “source”: [
“The full list of NuBase elements can be consulted [here](../_static/nubase_table.pdf).”
]
}, {
“cell_type”: “markdown”, “id”: “dried-separation”, “metadata”: {}, “source”: [
“### Registering new NuBase elementsn”
]
}, {
“cell_type”: “code”, “execution_count”: 17, “id”: “furnished-islam”, “metadata”: {
- “execution”: {
“iopub.execute_input”: “2021-04-27T12:44:51.353222Z”, “iopub.status.busy”: “2021-04-27T12:44:51.352728Z”, “iopub.status.idle”: “2021-04-27T12:44:51.355449Z”, “shell.execute_reply”: “2021-04-27T12:44:51.354975Z”
}
}, “outputs”: [
- {
“name”: “stdout”, “output_type”: “stream”, “text”: [
“name=999Un, nubase_id=999999000, is_ground_state=Truen”, “name=998Un, nubase_id=999998000, is_ground_state=Truen”
]
}
], “source”: [
“# register the element from its initialization argumentsn”, “reactions.nubase_database.register_element(‘999Un’, 999999000, 999, 999, None, True, None, True)n”, “un999 = reactions.nubase_database(‘999Un’)n”, “n”, “# directly register the elementn”, “un998 = reactions.nubase_element(‘998Un’, 999998000, 999, 998, None, False, None, True)n”, “reactions.nubase_database.register_element(un998)n”, “n”, “print(element_info(un999, attributes=[‘name’, ‘nubase_id’, ‘is_ground_state’]))n”, “print(element_info(un998, attributes=[‘name’, ‘nubase_id’, ‘is_ground_state’]))”
]
}, {
“cell_type”: “markdown”, “id”: “royal-press”, “metadata”: {}, “source”: [
“Newly registered elements must not have a similar name or ID to any existing element.”
]
}, {
“cell_type”: “markdown”, “id”: “stock-stretch”, “metadata”: {}, “source”: [
“### Changing the unitsn”, “NuBase elements contain information about the mass excess, expressed with energy units (keV by default) and the half-life, expressed with time unit (seconds by default). It is possible to change both through the reactions.nubase_system_of_units singleton.”
]
}, {
“cell_type”: “code”, “execution_count”: 18, “id”: “united-equipment”, “metadata”: {
- “execution”: {
“iopub.execute_input”: “2021-04-27T12:44:51.359968Z”, “iopub.status.busy”: “2021-04-27T12:44:51.359326Z”, “iopub.status.idle”: “2021-04-27T12:44:51.363130Z”, “shell.execute_reply”: “2021-04-27T12:44:51.362719Z”
}
}, “outputs”: [], “source”: [
“proton_mass_excess_kev = reactions.nubase_database(‘1H’).mass_excessn”, “reactions.nubase_system_of_units.set_energy_units(‘eV’)n”, “proton_mass_excess_ev = reactions.nubase_database(‘1H’).mass_excessn”, “assert(abs(proton_mass_excess_kev - proton_mass_excess_ev * 1e-3) < 1e-12)n”, “n”, “neutron_half_life_sec = reactions.nubase_database(‘1n’).half_lifen”, “reactions.nubase_system_of_units.set_time_units(‘ms’)n”, “neutron_half_life_ms = reactions.nubase_database(‘1n’).half_lifen”, “assert(abs(neutron_half_life_sec - neutron_half_life_ms * 1e-3) < 1e-12)”
]
}, {
“cell_type”: “markdown”, “id”: “constant-stroke”, “metadata”: {}, “source”: [
“## Using the database cachen”, “The PDG and NuBase databases allows to use a cache, loading all the elements in memory to boost the access to them. You can do this through the reactions.pdg_database.enable_cache and reactions.nubase_database.enable_cache functions. The cache can later be disabled using reactions.pdg_database.disable_cache and reactions.nubase_database.disable_cache. Note that this will not remove the elements registered by the user. If you wish to remove all elements you must call to reactions.pdg_database.clear_cache or reactions.nubase_database.clear_cache. The following example shows how to use it for PDG elements.”
]
}, {
“cell_type”: “code”, “execution_count”: 19, “id”: “alternative-animal”, “metadata”: {
- “execution”: {
“iopub.execute_input”: “2021-04-27T12:44:51.368641Z”, “iopub.status.busy”: “2021-04-27T12:44:51.368171Z”, “iopub.status.idle”: “2021-04-27T12:44:51.369981Z”, “shell.execute_reply”: “2021-04-27T12:44:51.370367Z”
}
}, “outputs”: [], “source”: [
“reactions.pdg_database(‘Z0’) # this is taken from the cachen”, “reactions.pdg_database.enable_cache() # load all particlesn”, “reactions.pdg_database(‘Z0’) # this is taken from the cachen”, “reactions.pdg_database.register_element("Z0’", 99999997, 0, None, None, True)n”, “reactions.pdg_database(‘Z0’) # this is taken from the cachen”, “n”, “reactions.pdg_database.disable_cache()n”, “n”, “reactions.pdg_database("Z0’") # our element is still theren”, “n”, “reactions.pdg_database.clear_cache() # remove all elements in the cachen”, “n”, “try:n”, ” reactions.pdg_database("Z0’") # this will failn”, ” raise RutimeError(‘Should have failed before’)n”, “except reactions.LookupError as e:n”, ” pass”
]
}
], “metadata”: {
- “kernelspec”: {
“display_name”: “Python 3”, “language”: “python”, “name”: “python3”
}, “language_info”: {
- “codemirror_mode”: {
“name”: “ipython”, “version”: 3
}, “file_extension”: “.py”, “mimetype”: “text/x-python”, “name”: “python”, “nbconvert_exporter”: “python”, “pygments_lexer”: “ipython3”, “version”: “3.8.5”
}
}, “nbformat”: 4, “nbformat_minor”: 5
}