Giter Club home page Giter Club logo

ubermag's Introduction

ubermag

Marijan Beg1,2, Martin Lang2, Samuel Holt2,3, Swapneel Amit Pathak2,4, Ryan A. Pepper5, Thomas Kluyver6, Jeroen Mulkers7, Jonathan Leliaert7, and Hans Fangohr2,4,8

1 Department of Earth Science and Engineering, Imperial College London, London SW7 2AZ, UK
2 Faculty of Engineering and Physical Sciences, University of Southampton, Southampton SO17 1BJ, UK
3 Department of Physics, University of Warwick, Coventry CV4 7AL, UK
4 Max Planck Institute for the Structure and Dynamics of Matter, Luruper Chaussee 149, 22761 Hamburg, Germany
5 Research Software Group, University of Birmingham, Birmingham B15 2TT, UK
6 European XFEL GmbH, Holzkoppel 4, 22869 Schenefeld, Germany
7 Faculty of Sciences, Ghent University, Krijgslaan 281, S12, 9000 Ghent, Belgium
8 Center for Free-Electron Laser Science, Luruper Chaussee 149, 22761 Hamburg, Germany

Description Badge
Tests Build status
conda
Linting pre-commit.ci status
Code style: black
Releases PyPI version
Anaconda-Server Badge
Coverage codecov
Documentation Documentation
YouTube YouTube
Binder Binder
Platforms Platforms
Downloads Downloads
License License
DOI DOI

About

ubermag is a Python package, integrated with Jupyter, providing:

  • Meta package for Ubermag project,

  • Logging control in Ubermag packages.

It is available on Windows, MacOS, and Linux. It requires Python 3.8+.

Documentation

APIs and tutorials are available in the documentation. To access the documentation, use the badge in the table above.

Installation, testing, and upgrade

We recommend installation using conda package manager. Instructions can be found in the documentation.

Binder

This package can be used in the cloud via Binder. To access Binder, use the badge in the table above.

YouTube

YouTube video tutorials are available on the Ubermag channel.

Support

If you require support, have questions, want to report a bug, or want to suggest an improvement, please raise an issue in ubermag/help repository.

Contributions

All contributions are welcome, however small they are. If you would like to contribute, please fork the repository and create a pull request. If you are not sure how to contribute, please contact us by raising an issue in ubermag/help repository, and we are going to help you get started and assist you on the way.

Contributors:

License

Licensed under the BSD 3-Clause "New" or "Revised" License. For details, please refer to the LICENSE file.

How to cite

  1. M. Beg, M. Lang, and H. Fangohr. Ubermag: Towards more effective micromagnetic workflows. IEEE Transactions on Magnetics 58, 7300205 (2022).

  2. M. Beg, R. A. Pepper, and H. Fangohr. User interfaces for computational science: A domain specific language for OOMMF embedded in Python. AIP Advances 7, 56025 (2017).

  3. Marijan Beg, Martin Lang, Samuel Holt, Swapneel Amit Pathak, Ryan A. Pepper, Thomas Kluyver, Jeroen Mulkers, Jonathan Leliaert, and Hans Fangohr. ubermag: Meta package for Ubermag project. DOI: 10.5281/zenodo.3539495 (2022).

Acknowledgements

  • OpenDreamKit โ€“ Horizon 2020 European Research Infrastructure project (676541)

  • EPSRC Programme Grant on Skyrmionics (EP/N032128/1)

ubermag's People

Contributors

fangohr avatar jleliaert avatar lang-m avatar marijanbeg avatar pre-commit-ci[bot] avatar samjrholt avatar swapneelap avatar ubermag-bot avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

ubermag's Issues

Author, email, and url in setup.py

At the moment, in all packages, we have:

url='https://github.com/joommf/joommfutil',
author='Computational Modelling Group',
author_email='[email protected]',

Should we maybe use joommf.github.io for url and joommf-users email?

OOMMF Installation Obstacles

I could not install tclsh from the instructions in the repository. I had to create a tclsh symbolic link:
cd /usr/bin; sudo ln --symbolic tcl8.6 tclsh

I also required the following environment variables, which were not documented:
OOMMF_TK_CONFIG=/usr/lib/x86_64-linux-gnu/tk8.6/tkConfig.sh
OOMMF_TCL_CONFIG=/usr/lib/x86_64-linux-gnu/tk8.6/tclConfig.sh
OOMMF_TK_INCLUDE_DIR=/usr/include/tk/
OOMMF_TCL_INCLUDE_DIR=/usr/include/tcl/

I am running Ubuntu 14.04, and installed tcl and tk from the tcl-dev and tk-dev packages in apt.

`Quantity` class for material parameters

Quantity class should be implemented to represent material parameter constants, such as exchange energy constant, Dzyaloshinkii-Moriya energy constant, Gilbert damping, etc. The class should be, for example, able to:

  • assign units to values,
  • provide latex representation in Jupyter notebook.

Modules cross-import

Between energyterm.py and hamiltonian.py as well as between dynamicsterm.py and dynamics.py in micromagneticmodel package cross-imports exist. This might cause problems.

Make times a property

units and headers are attributes providing lists, but times is a method (need to call times() to get the data). To make this consisted, we could turn times into a property (which called get_times).

Adding multiple energy terms (of the same type) to the Hamiltonian

It should not be possible to add multiple exchange or DMI energy objects to the Hamiltonian. This enhancement is to restrict physically meaningless models as well as not to take care of whether specific calculators support multiple exchange energies.

Having multiple Zeeman or Anisotropy energies can be physically possible, so this restriction at the moment should be made only for Exchange and Demag objects.

Saving other fields

Currently, in the TimeDriver classes, the saving of the magnetisation is hard coded. We need to expose the option to save the other fields that OOMMF allows. For each energy class, we can also save the field and the energy density. The syntax for this (with Oxs_UniformExchange as the example) is:

Destination archive mmArchive
Schedule Oxs_UniformExchange::Field archive Step 1
Schedule "Oxs_UniformExchange::Energy density" archive Step 1

replace Step with Stage/Done as necessary.

The inverted commas around the energy density part is needed because strings are first class citizens in Tcl, and the space gets misinterpreted otherwise.

Decide whether Python 2 support should be abandoned

Because of the inconsistencies between Python 2 and Python 3, the code gets more complicated and also testing becomes more difficult. This is mainly a problem with continuous integration and testing in multiple different Docker containers.

Mesh argument names

Arguments used to create a mesh should be renamed:

  • cmin to p1
  • cmax to p2
  • d to dxdydz or cell

This issue is closely related to #2 and #12.

If eventually is decided that fidimag should use the finite difference Mesh, another arguments, such as periodicity should be added.

Add more consts

Other constants such as elementary charge, Bohr magneton should be added to consts.

Delete `finitedifferencefield` and `oommffield` repositories

The OOMMFField class with its separate repository is derived from the finite difference Field class and only adds two methods for reading and writing OOMMF (.omf, .ohf) files. This functionality should be moved to the new discretisedfield repository.

Getting energies

At the moment, a system object contains system.dt which is a pandas dataframe and is created from the OOMMF .odt file.

The easiest and most obvious way of getting total and individual term energies is

system.total_energy()
system.exchange_energy()

which internally would read the pandas dataframe and return a value.

However, we want to have a clear hierarchy in the interface of what belongs to what. Also, what if we have multiple zeeman or anisotropy energies with different names... So, the most correct way of computing energies would be:

system.hamiltonian.energy()  # total energy
system.hamiltonian.exchange.energy()  # exchange energy

In a similar way, at the moment we access the parameters:

system.hamiltonian.zeeman.H
system.hamiltonian.exchange.A

The problem with this is that system.hamiltonian.exchange object should know about the dataframe which is an attribute of the system. This is not possible to solve in an elegant way. Two possibilities are:

  1. We internally pass system down to exchange, so that exchange has an attribute e.g. memberof which would be system.
  2. Another way, which would make the interface messy is to compute individual term energy as
system.hamiltonian.exchange(system)

I can imagine this would be the case if we implemented new micromagnetic code which would compute the energy (given m). For instance,

system.hamiltonian.exchange(m)

Any thoughts?

Offer function to check OOMMF-setup

oommfc.oommf.check() -> do tests to confirm that OOMMF can be found.
If we can call OOMMF (we may ask OOOMMF for its version number to check this), we could be silent.

If we cannot call OOMMF, we can print message with details:

  • is OOMMTCL set? If so, to where. Does the path exist?
  • are we attempting to use docker? If so, can we talk to the docker machine?

We could have an extra switch to raise an exception if OOMMF cannot be found (useful for automatic tests).

Latex representation strings in derived classes should be private properties

In order to make code consistent, all latex strings that are returned for the representation in Jupyter notebooks should be private class properties.

Also, it should be possible for the user to obtain _latex_str in an appropriate format so that equations can be easily copied/pasted into reports, manuscripts.

Default matplotlib backend

At the moment, we have

import matplotlib
matplotlib.use("nbagg")

in __init__.py file(s) across packages. This works fine only when the code is run from the command line python3 filename.py or inside Jupyter notebook.

However, inside python3 or ipython kernel, we cannot import the package because nbagg is not supported.

Do we need a default backend? If yes, what it should be?

(If we do not have a default one, we get warnings when packages are imported across different platforms, issue001 in discretisedfield).

Allow the choice of where OOMMF is run

At the moment if OOMMF is installed on the host machine, it is run on the host. If not, it is run inside Docker. User does not have any control of this process and cannot decide where to run OOMMF.

It would be useful, especially for testing, to specify via interface, where to run OOMMF. However, it is not clear how that should be specified. The most natural place would be in drivers or in its drive method. For instance,

td = oc.TimeDriver()
td.where = "host"  # or "docker"
td.drive(system, t=1e-9, n=100)

or

td = oc.TimeDriver()
td.drive(system, t=1e-9, n=100, where="host")

Also what would be the better name instead of where?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.