# Set the initial magnetic moments (will auto-set ISPIN and MAGMOM)
atoms.set_initial_magnetic_moments([4.0,4.0])
# Run the VASP calculation
atoms.get_potential_energy()
Supercharged Calculator
This is the recommended approach for VASP users in the group.
A modified version of the Vasp calculator is available with the quacc package. It serves as (mostly) a drop-in replacement for the ASE calculator and comes with several benefits, including: 1) Useful automatic updates to input parameters via the "incar copilot"; 2) Automated error correction handling via Custodian; 3) Several additional keyword arguments to simplify calculator setup. In general, there is no reason not to use this supercharged calculator.
To use the quacc-based Vasp calculator, simply replace from ase.calculators.vasp import Vasp with from quacc.calculators.vasp import Vasp. You can use all the same ASE Vasp calculator input arguments except now the first positional argument to the calculator is the Atoms object. For instance:
from quacc.calculators.vasp import Vasp
from ase.io import read
# Read in the structure to make an Atoms object
atoms = read("Fe.cif")
# Set up the VASP calculator
calc = Vasp(
atoms,# input Atoms object
encut=520,# plane-wave kinetic energy cutoff (convergence parameter)
kpts=[10,10,10],# k-points in each dimension
xc="PBE",# exchange-correlation functional ("level of theory"); sets GGA = PE here
# Set the initial magnetic moments (will auto-set ISPIN and MAGMOM)
atoms.set_initial_magnetic_moments([4.0,4.0])
# Run the VASP calculation
atoms.get_potential_energy()
The quacc.calculators.vasp.Vasp module also has a keyword argument preset to use pre-defined parameter sets. For instance, preset="DefaultPBESet" will select the DefaultPBESet.yaml from here and provides sensible defaults.
from quacc.calculators.vasp import Vasp
from ase.io import read
# Read in the structure to make an Atoms object
atoms = read("Fe.cif")
# Set up the VASP calculator
calc = Vasp(atoms, preset="DefaultPBESet")
# Set the calculator for the Atoms object
atoms.calc = calc
# Set the initial magnetic moments (will auto-set ISPIN and MAGMOM)