Tool to create input parameter file for MuSpinSim.
This tool creates a structured text file with keywords and values which describe the system to model for MuSpinSim. See MuSpinSim docs for more information https://muon-spectroscopy-computational-project.github.io/muspinsim/input/.
MuSpinSim allows expressions and special functions to be used when defining certain keywords. This tool also allows this. Check the hint at the bottom of each input to see what, if any, special function or expressions can be used.
Default expressions include the use of the operators
+ - * /
and^
for exponentiation. Expressions should not contain whitespace. For example, use1+2
not1 + 2
.
- Default constants include:
pi
: ratio of a circle and its diametere
: base of the natural logarithmdeg
: conversion factor between radians and degrees, equivalent to 180/piinf
: infinity- Special constants include:
muon_gyr
: gyromagnetic ratio of muon (135.5388 MHz/T)MHz
:1/(2*muon_gyr)
- Default functions include:
sin(x)
: sinecos(x)
: cosinetan(x)
: tangentarcsin(x)
: inverse of the sinearccos(x)
: inverse of the cosinearctan(x)
: inverse of the tangentarctan2(y, x)
: inverse of the tangent taking two arguments as (sine, cosine) to resolve the quadrantexp(x)
: exponential with base elog(x)
: natural logarithmsqrt(x)
: square root- Special functions include:
range(x, y, z)
: get z equally spaced values between x and yzcw(n)
: Zaremba-Conroy-Wolfsberg helper functioneulrange(n)
: helper function to create regular grid of n × n × n Euler angles with appropriate weights.- To enter vectors or matrices the following formats are accepted:
[[1, 2, 3], [4, 5, 6], [7, 8, 9]]
1 2 3 4 5 6 7 8 9
[1 2 3] [4 5 6] [7 8 9]
The fitting (function minimization) algorithms available are:
- Nelder-Mead
- A direct search method.
- Starting with a 'simplex' of candidates, the algorithm will iteratively move the position of the worst candidate towards the optimum until all candidates converge (have values within a predefined tolerance level).
- Scipy default tolerance is
1e-4
- L-BFGS
- Limited Memory Broyden–Fletcher–Goldfarb–Shanno algorithm.
- A second-order Quasi-Newton optimization algorithm
- Makes use of second-order derivative (Hessian Matrix) to converge on optimum.
- Scipy default tolerance is
1e-5