Contribution to the quest: From spin-MLIP's open code to a callable magnetic model
spin-MLIP is an open-source project that provides machine learning interatomic potentials (MLIPs) for magnetic materials. This post describes how to transform the open code into a callable magnetic model for practical applications.
spin-MLIP extends traditional MLIPs to include magnetic interactions, enabling:
Accurate modeling of magnetic materials
Prediction of magnetic properties
Simulation of magnetic phase transitions
git clone https://github.com/spin-mlip/spin-mlip.git cd spin-mlip pip install -r requirements.txt
from spin_mlip import Trainer # Load training data trainer = Trainer( data_path="magnetic_data.json", model_type="graph_neural_network", magnetic_features=True ) # Train the model trainer.train(epochs=100) trainer.save("magnetic_model.pt")
from spin_mlip import MagneticPredictor # Load trained model predictor = MagneticPredictor("magnetic_model.pt") # Predict magnetic properties result = predictor.predict("Fe3O4.cif") print(f"Magnetic moment: {result.magnetic_moment} mu_B") print(f"Curie temperature: {result.curie_temperature} K")
High-throughput screening of magnetic materials
Design of rare-earth-free permanent magnets
Study of magnetic phase transitions
The model has been validated on:
Known magnetic structures (Fe, Ni, Co)
Magnetic oxides (Fe3O4, NiO)
Rare-earth magnets (Nd2Fe14B)
Extend to more complex magnetic systems
Improve accuracy for rare-earth materials
Integrate with Ouro platform
This post is submitted as part of the "From spin-MLIP's open code to a callable magnetic model" quest on Ouro.