Package: mmt-multipole-inversion
MMT Numerical Libraries: Multipole InversionLibrary for the numerical inversion of a scan grid detecting the magnetic
signal from magnetic sources using a multipole expansion of the magnetic
potential of the sources. The mathematical background of this method and its
application to experimental data of a synthetic sample is developed inD. Cortés-Ortuño, K. Fabian, L. V. de GrootSingle Particle Multipole Expansions From Micromagnetic TomographyGeochemistry, Geophysics, Geosystems22(4), e2021GC009663 (2021)
DOI:https://doi.org/10.1029/2021GC009663This library is developed as part of theMimatom / MMTproject.LibraryThis library has two main modulesmultipole_inversion/magnetic_sample.py: contains theMagneticSampleclass to create a magnetic system with magnetic point sources (dipole or
higher order multipole sources) and generate the scan signal. This class also
has methods to save the scan signal data innpzformat and the scan grid
specifications injsonformat.multipole_inversion/multipole_inversion.py: contains theMultipoleInversionclass to perform a numerical inversion from a scan
signal data. This class requires scan surface specifications, particle (point
source) locations and the scan signal data. These can be passed from theMagneticSampleoutput or be specified manually (useful for combining with
other workflows such as micromagnetic simulations).An additional module to plot results from the inversions is provided inmultipole_inversion/plot_tools.py. Magnetic susceptibility and magnetic field
functions can be found in the main library as well, although not all of them
are documented in the tutorial yet.InstallationVia PyPI or from this repository usingpip .orpoetry installorpoetry build(which can be used withpip). Poetry is recommended for development.CUDAThis library contains an optional Nvidia CUDA library to populate the forward
matrix in themultipole_inversioncode. To build this library you need to set
theCUDAHOMEorCUDA_PATHenvironment variables to the location of CUDA in
your system. Alternatively, thenvcccompiler path can be set in thePATHvariable. The it is only necessary to install or build the library usingpoetry installorpoetry build.TutorialFor now you can visualize the Jupyter notebooks from thejupytextscripts in
thedoc/tutorial/folder. These notebooks can also be generated from their
associatedjupytextscript, for example,jupytext --to notebook multipoles_inversion_test.pyThe documentation of the classes can be generated usingsphinxand the
scripts to do this are located in thedocfolder. Future releases of this
library will include an online documentation of this code.CiteIf you find this library useful please cite us (you might need LaTeX'surlpackage)@Misc{Cortes2022,
  author       = {Cortés-Ortuño, David and Fabian, Karl and de Groot, Lennart V.},
  title        = {{MMT Numerical Libraries: Multipole Inversion}},
  publisher    = {Zenodo},
  note         = {Github: \url{https://github.com/Micromagnetic-Tomography/multipole_inversion}},
  year         = {2022},
  doi          = {10.5281/zenodo.6473257},
  url          = {https://doi.org/10.5281/zenodo.6473257},
}If you have a new version ofbiblatexyou can also use@Softwareinstead of@Misc, and add aversion={}entry. You can also cite the paper with the
theoretical framework of this library:@article{Cortes2021,
author = {Cortés-Ortuño, David and Fabian, Karl and de Groot, Lennart V.},
title = {Single Particle Multipole Expansions From Micromagnetic Tomography},
journal = {Geochemistry, Geophysics, Geosystems},
volume = {22},
number = {4},
pages = {e2021GC009663},
keywords = {magnetism, micromagnetic tomography, multipole, paleomagnetism, rock magnetism},
doi = {https://doi.org/10.1029/2021GC009663},
url = {https://agupubs.onlinelibrary.wiley.com/doi/abs/10.1029/2021GC009663},
eprint = {https://agupubs.onlinelibrary.wiley.com/doi/pdf/10.1029/2021GC009663},
note = {e2021GC009663 2021GC009663},
year = {2021}
}