Repository 'muspinsim_config'
hg clone https://toolshed.g2.bx.psu.edu/repos/muon-spectroscopy-computational-project/muspinsim_config

Changeset 4:e1e338f56656 (2023-07-18)
Previous changeset 3:331d0776abb4 (2023-02-03)
Commit message:
planemo upload for repository https://github.com/muon-spectroscopy-computational-project/muon-galaxy-tools/main/muspinsim_config commit 70a4d37ecdf5d586703cfc509922311e95d3205c
modified:
build_file.py
config_macros.xml
muspinsim_config.xml
added:
muon_macros.xml
test-data/Basic.cell
test-data/Basic.magres
test-data/muspinsim_gen_template.in
test-data/test_10.in
test-data/test_11.in
test-data/test_12.in
test-data/test_8.in
test-data/test_9.in
b
diff -r 331d0776abb4 -r e1e338f56656 build_file.py
--- a/build_file.py Fri Feb 03 15:39:07 2023 +0000
+++ b/build_file.py Tue Jul 18 13:26:20 2023 +0000
[
@@ -1,6 +1,7 @@
 import json
 import re
 import sys
+from typing import List
 
 from muspinsim import MuSpinInput
 
@@ -395,21 +396,63 @@
     return err_found
 
 
+def append_template_file(
+    template_path: str,
+    mu_params: dict,
+    file_contents: List[str]
+):
+    """
+    Loads an input file generated using muspinsim-gen and appends its contents
+    to what has already been created from config. Also ensures that the spins
+    are appended correctly.
+    """
+    # Check if we have already defined spins in the file
+    spins_line = None
+    spins_line_index = None
+    if ("spins" in mu_params):
+        # Find the current line definition in the file
+        # In the format 'spins\n e\n'
+        for i, line in enumerate(file_contents):
+            if line.startswith("spins"):
+                spins_line = line.split("\n")[1].strip()
+                spins_line_index = i
+        if spins_line_index is not None:
+            del file_contents[spins_line_index]
+
+    # Append the template file's contents
+    with open(template_path, encoding="utf-8") as template_file:
+        for line in template_file:
+            # Append the spins if needed
+            if line.startswith("spins") and spins_line is not None:
+                next_line = template_file.readline().strip()
+                file_contents += f"spins\n    {next_line} {spins_line}\n"
+            else:
+                file_contents += line
+
+
 def main():
     """
     Entry point
     """
     input_json_path = sys.argv[1]
-    mu_params = json.load(open(input_json_path, "r", encoding="utf-8"))
+    mu_input_params = json.load(open(input_json_path, "r", encoding="utf-8"))
+
+    out_file_name = mu_input_params["out_file_prefix"].strip().replace(
+        " ", "_")
 
-    out_file_name = mu_params["out_file_prefix"].strip().replace(" ", "_")
+    # Check if using a template
+    template_path = None
+    if (mu_input_params["use_structure_file_conditional"]
+            ["use_structure_file"]) == "true":
+        template_path = "muspinsim_gen_out.in"
 
     # combine all sections
     mu_params = {
-        **mu_params["spins"],
-        **mu_params["interaction_params"],
-        **mu_params["experiment_params"],
-        **mu_params["fitting_params"]["fitting_options"],
+        **mu_input_params["use_structure_file_conditional"]["spins"],
+        ** (mu_input_params["use_structure_file_conditional"]
+            ["interaction_params"]),
+        **mu_input_params["experiment_params"],
+        **mu_input_params["fitting_params"]["fitting_options"],
     }
 
     # get experiment parameters
@@ -430,6 +473,10 @@
     if parse_dict(parse_func_dict, mu_params, file_contents):
         sys.exit(1)
 
+    # Load and append the template if specified
+    if template_path is not None:
+        append_template_file(template_path, mu_params, file_contents)
+
     write_file("outfile.in", file_contents)
 
     try:
b
diff -r 331d0776abb4 -r e1e338f56656 config_macros.xml
--- a/config_macros.xml Fri Feb 03 15:39:07 2023 +0000
+++ b/config_macros.xml Tue Jul 18 13:26:20 2023 +0000
[
b'@@ -142,4 +142,94 @@\n             </when>\n         </conditional>\n     </xml>\n+    <xml name="spin_options">\n+        <repeat name="spins" title="Spins to simulate" min="1" help="Specify the spins to be used in the system. This should include a muon (mu) and one or more electrons (e)">\n+            <conditional name="spin_options">\n+                <param name="spin_preset" type="select" value="mu" label="Species" help="Select \'custom\' to define own">\n+                    <option selected="true" value="mu">mu</option>\n+                    <option value="e">e</option>\n+                    <option value="custom">custom</option>\n+                </param>\n+                <when value="custom">\n+                    <param name="spin" optional="false" type="text" label="Species name"/>\n+                    <param name="atomic_mass" optional="true" type="integer" min="0" value="" label="Atomic mass" help="Leave blank to use default mass - whole numbers only"/>\n+                </when>\n+                <when value="mu"/>\n+                <when value="e"/>\n+            </conditional>\n+        </repeat>\n+    </xml>\n+    <xml name="additional_spin_options">\n+        <repeat name="spins" title="Additional spins to simulate" min="0" help="Specify any additional spins to be used in the system other than those generated from the structure file.">\n+            <conditional name="spin_options">\n+                <param name="spin_preset" type="select" value="e" label="Species" help="Select \'custom\' to define own">\n+                    <option value="e">e</option>\n+                    <option value="custom">custom</option>\n+                </param>\n+                <when value="custom">\n+                    <param name="spin" optional="false" type="text" label="Species name"/>\n+                    <param name="atomic_mass" optional="true" type="integer" min="0" value="" label="Atomic mass" help="Leave blank to use default mass - whole numbers only"/>\n+                </when>\n+                <when value="e"/>\n+            </conditional>\n+        </repeat>\n+    </xml>\n+    <xml name="interaction_options">\n+        <repeat name="interactions" title="Interactions to simulate" help="Add couplings between spins, and/or dissipation terms. Interaction terms available: Zeeman, hyperfine, dipolar, quadrupolar or dissipation. See MuSpinSim docs for more info">\n+            <conditional name="interaction_options">\n+                <param name="interaction" type="select" label="Choose interaction type">\n+                    <option value="zeeman">Zeeman</option>\n+                    <option value="hyperfine">hyperfine</option>\n+                    <option value="dipolar">dipolar</option>\n+                    <option value="quadrupolar">quadrupolar</option>\n+                    <option value="dissipation">dissipation</option>\n+                </param>\n+                <when value="zeeman">\n+                    <param name="zeeman_index" type="integer" value="" label="Index of coupled spin" min="1" help="Index refers to the order of the spins listed in \'spins\' section.  The first spin in the list has index 1, the second has index 2, and so on."/>\n+                    <param name="zeeman_vector" type="text" value="" label="Zeeman coupling vector" help="Define 1X3 vector for local magnetic field coupling (T). Allows default expressions, constants and functions (see help)"/>\n+                </when>\n+                <when value="hyperfine">\n+                    <param name="hfine_index" type="integer" value="" label="Index of nuclear coupled spin" min="1" help="Non-electronic spin - muon or otherwise. Index refers to the order of the spins listed in \'spins\' section.  The first spin in the list has index 1, the second has index 2, and so on."/>\n+                    <param name="hfine_e_index" type="integer" value="" optional="true" min="1" label="Index of electronic coupled spin" help="Optional, will use first defined electronic spin if unspecified"/>\n+         '..b'itizer>\n+                            <valid initial="string.printable">\n+                            </valid>\n+                        </sanitizer>\n+                    </param>\n+                </when>\n+                <when value="dipolar">\n+                    <param name="di_index" type="integer" value="" min="1" label="Index of 1st coupled spin" help="Index refers to the order of the spins listed in \'spins\' section.  The first spin in the list has index 1, the second has index 2, and so on."/>\n+                    <param name="di_index_2" type="integer" value="" label="Index of 2nd coupled spin" help="Index refers to the order of the spins listed in \'spins\' section.  The first spin in the list has index 1, the second has index 2, and so on."/>\n+                    <param name="di_vector" type="text" value="" label="Dipole coupling vector" help="Define 1X3 vector for coupling between two spins (Angstrom). Allows default expressions, constants and functions (see help)"/>\n+                </when>\n+                <when value="quadrupolar">\n+                    <param name="quad_index" type="integer" value="" label="Index of coupled spin" help="Index refers to the order of the spins listed in \'spins\' section.  The first spin in the list has index 1, the second has index 2, and so on."/>\n+                    <param name="quad_matrix" area="true" type="text" value="" label="Electric Field Gradient tensor" help="Define 3X3 tensor (in atomic units) for quadrupolar coupling. Allows default expressions, constants and functions (see help). Warning: spins with zero quadrupole moment will have zero coupling regardless of the input">\n+                        <sanitizer>\n+                            <valid initial="string.printable">\n+                            </valid>\n+                        </sanitizer>\n+                    </param>\n+                </when>\n+                <when value="dissipation">\n+                    <param name="dis_index" type="integer" value="" label="Index of spin with dissipation" help="Index refers to the order of the spins listed in \'spins\' section.  The first spin in the list has index 1, the second has index 2, and so on."/>\n+                    <param name="dis_val" type="text" value="" label="Dissipation" help="Define dissipation term (MHz). Allows default expressions, constants and functions (see help)"/>\n+                </when>\n+            </conditional>\n+        </repeat>\n+    </xml>\n+    <xml name="generator_options">\n+        <param name="structure_file" type="data" format="cif,cell,magres,extxyz" label="File containing the structure (.cif, .cell, .magres or .extxyz)"/>\n+        <param name="number_closest" type="integer" value="4" label="Number of closest nuclei" help="Number of closest nuclei to the muon which should included in the generated file"/>\n+        <param name="dipolar" type="boolean" checked="true" truevalue="--dipolar" falsevalue="" label="Include dipole interactions?"/>\n+        <param name="quadrupolar" type="boolean" checked="false" truevalue="--quadrupolar" falsevalue="" label="Include quadrupole interactions?" help="Requires a Magres input file with EFG tensors calculated via CASTEP."/>\n+        <param name="include_interatomic" type="boolean" checked="false" truevalue="--include_interatomic" falsevalue="" label="Include interatomic interactions?" help="Whether to include interactions between selected nuclei which don\'t involve the muon."/>\n+        <repeat name="ignored_symbols" title="Ignored symbols" min="0" help="Specify symbols that should be ignored e.g. if they have zero spin">\n+            <param type="text" name="ignored_symbol" label="Ignored symbol">\n+                <validator type="regex" message="Input should only contain letters">^[a-zA-Z]+$</validator>\n+            </param>\n+        </repeat>\n+        <param name="muon_symbol" type="text" value="H" label="Muon Symbol" help="Symbol representing the muon in the given structure file."/>\n+    </xml>\n </macros>\n'
b
diff -r 331d0776abb4 -r e1e338f56656 muon_macros.xml
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/muon_macros.xml Tue Jul 18 13:26:20 2023 +0000
[
@@ -0,0 +1,29 @@
+<macros>
+    <xml name="dftb_set">
+        <param type="select" name="dftb_set" value="3ob-3-1" display="radio" label="DFTB parameter set" help="The parameter set to use for DFTB+. Currently supported are: 3ob-3-1 and pbc-0-3. See help section at the bottom of the page for details.">
+            <option value="3ob-3-1">3ob-3-1</option>
+            <option value="pbc-0-3">pbc-0-3</option>
+        </param>
+    </xml>
+    <xml name="dftb+">
+        <expand macro="dftb_set"/>
+        <param type="boolean" name="dftb_pbc" label="Use periodic boundary conditions" help="Whether to turn on periodic boundary conditions in DFTB+." checked="true"/>
+    </xml>
+    <xml name="dftb_optionals">
+        <param type="text" argument="dftb_optionals" value="[]" optional="true" label="DFTB optional files" help="Additional optional json files to activate for DFTBArgs (for example, dftd3.json will use DFTD3 dispersion forces for 3ob-3-1 if DFTB+ has been compiled to support them)."/>
+    </xml>
+    <xml name="k_points_grid">
+        <param type="text" argument="k_points_grid" value="[1,1,1]" label="K-points grid" help="List of three integer k-points. Default is [1,1,1].">
+            <validator type="regex" message="Input should only contain whitespace, '[', ']', ',' and digits.">^[\s\d,\[\]]+$</validator>
+        </param>
+    </xml>
+    <!-- version of underlying tool (PEP 440) -->
+    <!-- citation should be updated with every underlying tool version -->
+    <!-- concept is not updated, and should only be used for referencing the idea of the software -->
+    <token name="@MUSPINSIM_VERSION@">2.2.1</token>
+    <token name="@MUSPINSIM_CITATION@">10.5281/zenodo.7733979</token>
+    <token name="@MUSPINSIM_CONCEPT@">10.5281/zenodo.6517626</token>
+    <token name="@PYMUONSUITE_VERSION@">0.3.0</token>
+    <token name="@PYMUONSUITE_CITATION@">10.5281/zenodo.8026711</token>
+    <token name="@PYMUONSUITE_CONCEPT@">10.5281/zenodo.7025643</token>
+</macros>
\ No newline at end of file
b
diff -r 331d0776abb4 -r e1e338f56656 muspinsim_config.xml
--- a/muspinsim_config.xml Fri Feb 03 15:39:07 2023 +0000
+++ b/muspinsim_config.xml Tue Jul 18 13:26:20 2023 +0000
[
b'@@ -1,25 +1,10 @@\n-<tool id="muspinsim_config" name="MuSpinSim Configure" version="@TOOL_VERSION@+galaxy@WRAPPER_VERSION@" python_template_version="3.5" profile="22.05" license="MIT">\n+<tool id="muspinsim_config" name="MuSpinSim Configure" version="@MUSPINSIM_VERSION@+galaxy@WRAPPER_VERSION@" python_template_version="3.5" profile="22.05" license="MIT">\n     <description>define simulation parameters</description>\n     <macros>\n-        <!-- version of underlying tool (PEP 440) -->\n-        <token name="@TOOL_VERSION@">2.0.2</token>\n         <!-- version of this tool wrapper (integer) -->\n         <token name="@WRAPPER_VERSION@">0</token>\n-        <!-- citation should be updated with every underlying tool version -->\n-        <!-- typical fields to update are version, month, year, and doi -->\n-        <token name="@TOOL_CITATION@">\n-            @software{muspinsim,\n-                author = {Sturniolo, Simone and Liborio, Leandro and Owen, Josh and Mudaraddi, Anish and Davies, Joel and Wilkinson, John and {Muon Spectroscopy Computational Project}},\n-                license = {MIT},\n-                title = {{muspinsim}},\n-                url = {https://github.com/muon-spectroscopy-computational-project/muspinsim},\n-                version = {v2.0.2},\n-                month = {1},\n-                year = {2023}\n-                doi = {10.5281/zenodo.7568830}\n-            }\n-        </token>\n         <import>config_macros.xml</import>\n+        <import>muon_macros.xml</import>\n     </macros>\n     <creator>\n         <person givenName="Anish" familyName="Mudaraddi" identifier="https://orcid.org/0000-0002-2135-2705"/>\n@@ -28,83 +13,60 @@\n         <organization url="https://muon-spectroscopy-computational-project.github.io/index.html" name="The Muon Spectroscopy Computational Project"/>\n     </creator>\n     <requirements>\n-        <requirement type="package" version="@TOOL_VERSION@">muspinsim</requirement>\n+        <requirement type="package" version="@MUSPINSIM_VERSION@">muspinsim</requirement>\n     </requirements>\n     <required_files>\n         <include type="literal" path="sample_fitting_data.dat"/>\n         <include type="literal" path="build_file.py"/>\n     </required_files>\n     <command detect_errors="exit_code"><![CDATA[\n+        #if $use_structure_file_conditional.use_structure_file == "true":\n+            #set generator_params = $use_structure_file_conditional.generator\n+            structure_name_internal=\\$(sed \'s/ /\\_/g\' <<< \'$generator_params.structure_file.name\') &&\n+            ln -s \'$generator_params.structure_file\' \\$structure_name_internal &&\n+            muspinsim-gen \\$structure_name_internal $generator_params.number_closest --out muspinsim_gen_out.in\n+            $generator_params.dipolar\n+            $generator_params.quadrupolar\n+            $generator_params.include_interatomic\n+            --muon_symbol $generator_params.muon_symbol\n+            #for $ignored_symbol in $generator_params.ignored_symbols:\n+            --ignore_symbol $ignored_symbol.ignored_symbol\n+            #end for\n+            &&\n+        #end if\n         cp \'${__tool_directory__}/sample_fitting_data.dat\' ./fitting_data.dat &&\n         python \'${__tool_directory__}/build_file.py\' inputs.json\n     ]]></command>\n     <configfiles>\n-        <inputs name="inputs" filename="inputs.json"/>\n+        <inputs name="inputs" data_style="paths" filename="inputs.json"/>\n     </configfiles>\n     <inputs>\n-        <param type="text" name="out_file_prefix" label="Name" help="A name with which to label this configuration" optional="true" value="muspinsim"/>\n-        <section name="spins" expanded="true" title="Spins">\n-            <repeat name="spins" title="Spins to simulate" min="1" help="Specify the spins to be used in the system. This should include a muon (mu) and one or more electrons (e)">\n-                <conditional name="spin_options">\n-                    <param name="spin_preset" type="select" value="mu" label="Species" help="Select \'custom\' '..b'value="false"/>\n+            <param name="ignored_symbol" value="Si"/>\n+            <param name="include_interatomic" value="false"/>\n+            <param name="experiment_preset" value="custom"/>\n+            <param name="time" value="range(0,8.0,1000)"/>\n+            <output name="out_file" file="test_9.in" ftype="txt" compare="diff"/>\n+        </test>\n+        <!-- Magres file with quadrupolar and interatomic -->\n+        <test expect_num_outputs="1">\n+            <param name="out_file_prefix" value="test_10"/>\n+            <param name="use_structure_file" value="true"/>\n+            <param name="structure_file" value="Basic.magres" ftype="cell"/>\n+            <param name="dipolar" value="true"/>\n+            <param name="quadrupolar" value="true"/>\n+            <param name="ignored_symbol" value="Si"/>\n+            <param name="include_interatomic" value="true"/>\n+            <param name="experiment_preset" value="custom"/>\n+            <param name="time" value="range(0,8.0,1000)"/>\n+            <output name="out_file" file="test_10.in" ftype="txt" compare="diff"/>\n+        </test>\n+        <!-- Magres file with quadrupolar, and extra interactions as well -->\n+        <test expect_num_outputs="1">\n+            <param name="out_file_prefix" value="test_11"/>\n+            <param name="use_structure_file" value="true"/>\n+            <param name="structure_file" value="Basic.magres" ftype="cell"/>\n+            <param name="dipolar" value="true"/>\n+            <param name="quadrupolar" value="true"/>\n+            <param name="ignored_symbol" value="Si"/>\n+            <param name="include_interatomic" value="false"/>\n+            <param name="interaction" value="hyperfine"/>\n+            <param name="hfine_index" value="2"/>\n+            <param name="hfine_matrix" value="[580 5  10 5   580 9 10  9   580]"/>\n+            <param name="interaction" value="hyperfine"/>\n+            <param name="hfine_index" value="3"/>\n+            <param name="hfine_matrix" value="[(300/2)  3   4*10 ], [3  15*10 6-3+2]  ,[4  5   15 ]"/>\n+            <param name="experiment_preset" value="custom"/>\n+            <param name="time" value="range(0,8.0,1000)"/>\n+            <output name="out_file" file="test_11.in" ftype="txt" compare="diff"/>\n+        </test>\n+        <!-- Test adding extra spins -->\n+        <test expect_num_outputs="1">\n+            <param name="out_file_prefix" value="test_12"/>\n+            <param name="use_structure_file" value="true"/>\n+            <param name="structure_file" value="Basic.magres" ftype="cell"/>\n+            <param name="dipolar" value="true"/>\n+            <param name="quadrupolar" value="true"/>\n+            <param name="ignored_symbol" value="Si"/>\n+            <param name="include_interatomic" value="false"/>\n+            <param name="spin_preset" value="e"/>\n+            <param name="spin_preset" value="custom"/>\n+            <param name="spin" value="F"/>\n+            <param name="atomic_mass" value="19"/>\n+            <param name="interaction" value="hyperfine"/>\n+            <param name="hfine_index" value="2"/>\n+            <param name="hfine_matrix" value="[580 5  10 5   580 9 10  9   580]"/>\n+            <param name="interaction" value="hyperfine"/>\n+            <param name="hfine_index" value="3"/>\n+            <param name="hfine_matrix" value="[(300/2)  3   4*10 ], [3  15*10 6-3+2]  ,[4  5   15 ]"/>\n+            <param name="experiment_preset" value="custom"/>\n+            <param name="time" value="range(0,8.0,1000)"/>\n+            <output name="out_file" file="test_12.in" ftype="txt" compare="diff"/>\n+        </test>\n     </tests>\n     <help><![CDATA[\n     Tool to create input parameter file for MuSpinSim.\n@@ -377,8 +426,6 @@\n             }\n         </citation>\n         <citation type="doi">10.1103/PhysRevLett.56.2720</citation>\n-        <citation type="bibtex">\n-            @TOOL_CITATION@\n-        </citation>\n+        <citation type="doi">@MUSPINSIM_CITATION@</citation>\n     </citations>\n </tool>\n'
b
diff -r 331d0776abb4 -r e1e338f56656 test-data/Basic.cell
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/test-data/Basic.cell Tue Jul 18 13:26:20 2023 +0000
b
@@ -0,0 +1,12 @@
+%BLOCK LATTICE_CART
+   14.18160000000000   0.000000000000000   0.000000000000000
+   0.000000000000000   14.18160000000000   0.000000000000000
+   0.000000000000000   0.000000000000000   14.18160000000000
+%ENDBLOCK LATTICE_CART
+
+%BLOCK POSITIONS_FRAC
+V             0.0791557133        0.0000005853        0.1708904764
+V             0.9161667724        0.0000005823        0.8325662729
+Si            0.4996287249        0.8331358706        0.8331663251
+H             0.1666672745        0.0000018274        0.0833332099
+%ENDBLOCK POSITIONS_FRAC
b
diff -r 331d0776abb4 -r e1e338f56656 test-data/Basic.magres
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/test-data/Basic.magres Tue Jul 18 13:26:20 2023 +0000
[
@@ -0,0 +1,17 @@
+#$magres-abinitio-v1.0
+[atoms]
+units lattice Angstrom
+lattice          14.18160000000000   0.000000000000000   0.000000000000000                 0.000000000000000   14.18160000000000   0.000000000000000                 0.000000000000000   0.000000000000000   14.18160000000000
+units atom Angstrom
+atom V       V   1     1.1225546637        0.0000083005        2.4235003801
+atom V       V   2     12.992710700        0.0000082580        11.807121856
+atom Si      Si  3     7.0855347250        11.815199663        11.815631556
+atom H:mu    H:mu   1     2.3636086201        0.0000259155        1.1817982368
+[/atoms]
+[magres]
+units efg au
+efg V  1         -0.008877        0.000022       -0.011811                  0.000022       -0.030585        0.000005                 -0.011811        0.000005        0.039462
+efg V  2          0.221597       -0.000002       -0.009013                 -0.000002       -0.109627       -0.000009                 -0.009013       -0.000009       -0.111970
+efg Si 3         -0.002604       -0.000000       -0.000001                 -0.000000       -0.002551       -0.000009                 -0.000001       -0.000009        0.005154
+efg H:mu  1      -0.034266        0.000000        0.000000                  0.000000       -0.034268        0.000000                  0.000000        0.000000        0.068534
+[/magres]
\ No newline at end of file
b
diff -r 331d0776abb4 -r e1e338f56656 test-data/muspinsim_gen_template.in
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/test-data/muspinsim_gen_template.in Tue Jul 18 13:26:20 2023 +0000
b
@@ -0,0 +1,106 @@
+spins
+    mu V V V V V V V V
+quadrupolar 2
+    -0.008877 2.2e-05 -0.011811
+    2.2e-05 -0.030585 5e-06
+    -0.011811 5e-06 0.039462
+dipolar 1 2
+    1.2410539563139198 1.7614965359999998e-05 -1.2417021305964
+dipolar 2 3
+    2.3114439642674407 4.25447999999999e-08 4.7979785243555995
+dipolar 2 4
+    2.3114439642674407 4.25447999999999e-08 -9.3836214756444
+dipolar 2 5
+    -11.87015603573256 4.25447999999999e-08 4.7979785243555995
+dipolar 2 6
+    0.0 0.0 14.1816
+dipolar 2 7
+    -14.1816 0.0 0.0
+dipolar 2 8
+    0.0 -14.1816 0.0
+dipolar 2 9
+    0.0 14.1816 0.0
+quadrupolar 3
+    0.221597 -2e-06 -0.009013
+    -2e-06 -0.109627 -9e-06
+    -0.009013 -9e-06 -0.11197
+dipolar 1 3
+    3.5524979205813603 1.7657510159999996e-05 3.5562763937592
+dipolar 3 4
+    0.0 0.0 -14.1816
+dipolar 3 5
+    -14.1816 0.0 0.0
+dipolar 3 6
+    -2.3114439642674407 -4.25447999999999e-08 9.3836214756444
+dipolar 3 7
+    -16.49304396426744 -4.25447999999999e-08 -4.7979785243555995
+dipolar 3 8
+    -2.3114439642674407 -14.1816000425448 -4.7979785243555995
+dipolar 3 9
+    -2.3114439642674407 14.1815999574552 -4.7979785243555995
+quadrupolar 4
+    0.221597 -2e-06 -0.009013
+    -2e-06 -0.109627 -9e-06
+    -0.009013 -9e-06 -0.11197
+dipolar 1 4
+    3.5524979205813603 1.7657510159999996e-05 -10.6253236062408
+dipolar 4 5
+    -14.1816 0.0 14.1816
+dipolar 4 6
+    -2.3114439642674407 -4.25447999999999e-08 23.5652214756444
+dipolar 4 7
+    -16.49304396426744 -4.25447999999999e-08 9.3836214756444
+dipolar 4 8
+    -2.3114439642674407 -14.1816000425448 9.3836214756444
+dipolar 4 9
+    -2.3114439642674407 14.1815999574552 9.3836214756444
+quadrupolar 5
+    0.221597 -2e-06 -0.009013
+    -2e-06 -0.109627 -9e-06
+    -0.009013 -9e-06 -0.11197
+dipolar 1 5
+    -10.62910207941864 1.7657510159999996e-05 3.5562763937592
+dipolar 5 6
+    11.87015603573256 -4.25447999999999e-08 9.3836214756444
+dipolar 5 7
+    -2.31144396426744 -4.25447999999999e-08 -4.7979785243555995
+dipolar 5 8
+    11.87015603573256 -14.1816000425448 -4.7979785243555995
+dipolar 5 9
+    11.87015603573256 14.1815999574552 -4.7979785243555995
+quadrupolar 6
+    -0.008877 2.2e-05 -0.011811
+    2.2e-05 -0.030585 5e-06
+    -0.011811 5e-06 0.039462
+dipolar 1 6
+    1.2410539563139198 1.7614965359999998e-05 12.9398978694036
+dipolar 6 7
+    -14.1816 0.0 -14.1816
+dipolar 6 8
+    0.0 -14.1816 -14.1816
+dipolar 6 9
+    0.0 14.1816 -14.1816
+quadrupolar 7
+    -0.008877 2.2e-05 -0.011811
+    2.2e-05 -0.030585 5e-06
+    -0.011811 5e-06 0.039462
+dipolar 1 7
+    -12.94054604368608 1.7614965359999998e-05 -1.2417021305964
+dipolar 7 8
+    14.1816 -14.1816 0.0
+dipolar 7 9
+    14.1816 14.1816 0.0
+quadrupolar 8
+    -0.008877 2.2e-05 -0.011811
+    2.2e-05 -0.030585 5e-06
+    -0.011811 5e-06 0.039462
+dipolar 1 8
+    1.2410539563139198 -14.18158238503464 -1.2417021305964
+dipolar 8 9
+    0.0 28.3632 0.0
+quadrupolar 9
+    -0.008877 2.2e-05 -0.011811
+    2.2e-05 -0.030585 5e-06
+    -0.011811 5e-06 0.039462
+dipolar 1 9
+    1.2410539563139198 14.18161761496536 -1.2417021305964
b
diff -r 331d0776abb4 -r e1e338f56656 test-data/test_10.in
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/test-data/test_10.in Tue Jul 18 13:26:20 2023 +0000
b
@@ -0,0 +1,54 @@
+
+#######################################################
+# Muspinsim Input File
+# Generated using Muon Galaxy Tool Muspinsim_Input
+#######################################################
+
+name
+    test_10
+average_axes
+    orientation
+x_axis
+    time
+y_axis
+    asymmetry
+time
+    range(0,8.0,1000)
+spins
+    mu V V V V
+quadrupolar 2
+    -0.008877 2.2e-05 -0.011811
+    2.2e-05 -0.030585 5e-06
+    -0.011811 5e-06 0.039462
+dipolar 1 2
+    1.2410539564 1.7615e-05 -1.2417021433000002
+dipolar 2 3
+    2.3114439636999995 4.2500000000000017e-08 4.7979785240999995
+dipolar 2 4
+    2.3114439636999995 4.2500000000000017e-08 -9.3836214759
+dipolar 2 5
+    -11.8701560363 4.2500000000000017e-08 4.7979785240999995
+quadrupolar 3
+    0.221597 -2e-06 -0.009013
+    -2e-06 -0.109627 -9e-06
+    -0.009013 -9e-06 -0.11197
+dipolar 1 3
+    3.5524979200999995 1.7657499999999998e-05 3.556276380799999
+dipolar 3 4
+    0.0 0.0 -14.1816
+dipolar 3 5
+    -14.1816 0.0 0.0
+quadrupolar 4
+    0.221597 -2e-06 -0.009013
+    -2e-06 -0.109627 -9e-06
+    -0.009013 -9e-06 -0.11197
+dipolar 1 4
+    3.5524979200999995 1.7657499999999998e-05 -10.6253236192
+dipolar 4 5
+    -14.1816 0.0 14.1816
+quadrupolar 5
+    0.221597 -2e-06 -0.009013
+    -2e-06 -0.109627 -9e-06
+    -0.009013 -9e-06 -0.11197
+dipolar 1 5
+    -10.6291020799 1.7657499999999998e-05 3.556276380799999
b
diff -r 331d0776abb4 -r e1e338f56656 test-data/test_11.in
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/test-data/test_11.in Tue Jul 18 13:26:20 2023 +0000
b
@@ -0,0 +1,50 @@
+
+#######################################################
+# Muspinsim Input File
+# Generated using Muon Galaxy Tool Muspinsim_Input
+#######################################################
+
+name
+    test_11
+hyperfine 3
+    (300/2) 3 4*10
+    3 15*10 6-3+2
+    4 5 15
+hyperfine 2
+    580 5 10
+    5 580 9
+    10 9 580
+average_axes
+    orientation
+x_axis
+    time
+y_axis
+    asymmetry
+time
+    range(0,8.0,1000)
+spins
+    mu V V V V
+quadrupolar 2
+    -0.008877 2.2e-05 -0.011811
+    2.2e-05 -0.030585 5e-06
+    -0.011811 5e-06 0.039462
+dipolar 1 2
+    1.2410539564 1.7615e-05 -1.2417021433000002
+quadrupolar 3
+    0.221597 -2e-06 -0.009013
+    -2e-06 -0.109627 -9e-06
+    -0.009013 -9e-06 -0.11197
+dipolar 1 3
+    3.5524979200999995 1.7657499999999998e-05 3.556276380799999
+quadrupolar 4
+    0.221597 -2e-06 -0.009013
+    -2e-06 -0.109627 -9e-06
+    -0.009013 -9e-06 -0.11197
+dipolar 1 4
+    3.5524979200999995 1.7657499999999998e-05 -10.6253236192
+quadrupolar 5
+    0.221597 -2e-06 -0.009013
+    -2e-06 -0.109627 -9e-06
+    -0.009013 -9e-06 -0.11197
+dipolar 1 5
+    -10.6291020799 1.7657499999999998e-05 3.556276380799999
b
diff -r 331d0776abb4 -r e1e338f56656 test-data/test_12.in
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/test-data/test_12.in Tue Jul 18 13:26:20 2023 +0000
b
@@ -0,0 +1,50 @@
+
+#######################################################
+# Muspinsim Input File
+# Generated using Muon Galaxy Tool Muspinsim_Input
+#######################################################
+
+name
+    test_12
+hyperfine 3
+    (300/2) 3 4*10
+    3 15*10 6-3+2
+    4 5 15
+hyperfine 2
+    580 5 10
+    5 580 9
+    10 9 580
+average_axes
+    orientation
+x_axis
+    time
+y_axis
+    asymmetry
+time
+    range(0,8.0,1000)
+spins
+    mu V V V V 19F e
+quadrupolar 2
+    -0.008877 2.2e-05 -0.011811
+    2.2e-05 -0.030585 5e-06
+    -0.011811 5e-06 0.039462
+dipolar 1 2
+    1.2410539564 1.7615e-05 -1.2417021433000002
+quadrupolar 3
+    0.221597 -2e-06 -0.009013
+    -2e-06 -0.109627 -9e-06
+    -0.009013 -9e-06 -0.11197
+dipolar 1 3
+    3.5524979200999995 1.7657499999999998e-05 3.556276380799999
+quadrupolar 4
+    0.221597 -2e-06 -0.009013
+    -2e-06 -0.109627 -9e-06
+    -0.009013 -9e-06 -0.11197
+dipolar 1 4
+    3.5524979200999995 1.7657499999999998e-05 -10.6253236192
+quadrupolar 5
+    0.221597 -2e-06 -0.009013
+    -2e-06 -0.109627 -9e-06
+    -0.009013 -9e-06 -0.11197
+dipolar 1 5
+    -10.6291020799 1.7657499999999998e-05 3.556276380799999
b
diff -r 331d0776abb4 -r e1e338f56656 test-data/test_8.in
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/test-data/test_8.in Tue Jul 18 13:26:20 2023 +0000
b
@@ -0,0 +1,26 @@
+
+#######################################################
+# Muspinsim Input File
+# Generated using Muon Galaxy Tool Muspinsim_Input
+#######################################################
+
+name
+    test_8
+average_axes
+    orientation
+x_axis
+    time
+y_axis
+    asymmetry
+time
+    range(0,8.0,1000)
+spins
+    mu V V Si Si
+dipolar 1 2
+    1.2410539563139198 1.7614965359999998e-05 -1.2417021305964
+dipolar 1 3
+    3.5524979205813603 1.7657510159999996e-05 3.5562763937592
+dipolar 1 4
+    -4.72192610499264 2.366426252954879 3.54776669347968
+dipolar 1 5
+    9.45967389500736 2.366426252954879 3.54776669347968
b
diff -r 331d0776abb4 -r e1e338f56656 test-data/test_9.in
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/test-data/test_9.in Tue Jul 18 13:26:20 2023 +0000
b
@@ -0,0 +1,34 @@
+
+#######################################################
+# Muspinsim Input File
+# Generated using Muon Galaxy Tool Muspinsim_Input
+#######################################################
+
+name
+    test_9
+average_axes
+    orientation
+x_axis
+    time
+y_axis
+    asymmetry
+time
+    range(0,8.0,1000)
+spins
+    mu V V V V V V V V
+dipolar 1 2
+    1.2410539564 1.7615e-05 -1.2417021433000002
+dipolar 1 3
+    3.5524979200999995 1.7657499999999998e-05 3.556276380799999
+dipolar 1 4
+    3.5524979200999995 1.7657499999999998e-05 -10.6253236192
+dipolar 1 5
+    -10.6291020799 1.7657499999999998e-05 3.556276380799999
+dipolar 1 6
+    1.2410539564 1.7615e-05 12.9398978567
+dipolar 1 7
+    -12.940546043600001 1.7615e-05 -1.2417021433000002
+dipolar 1 8
+    1.2410539564 -14.181582384999999 -1.2417021433000002
+dipolar 1 9
+    1.2410539564 14.181617615 -1.2417021433000002