Skip to content

Commit

Permalink
Magmom_single_atom keyword is added
Browse files Browse the repository at this point in the history
It can be used for a single atom with [atom_no, magmom_value]
  • Loading branch information
sblisesivdin committed Apr 15, 2024
1 parent 5126c38 commit f6abbd1
Showing 1 changed file with 12 additions and 2 deletions.
14 changes: 12 additions & 2 deletions gpawsolve.py
Original file line number Diff line number Diff line change
Expand Up @@ -160,6 +160,7 @@ def __init__(self, struct):
self.Mixer_type = Mixer_type
self.Spin_calc = Spin_calc
self.Magmom_per_atom = Magmom_per_atom
self.Magmom_single_atom = Magmom_single_atom
self.DOS_npoints = DOS_npoints
self.DOS_width = DOS_width
self.DOS_convergence = DOS_convergence
Expand Down Expand Up @@ -244,7 +245,11 @@ def groundcalc(self):
time11 = time.time()
if Mode == 'PW':
if Spin_calc == True:
numm = [Magmom_per_atom]*bulk_configuration.get_global_number_of_atoms()
if 'Magmom_single_atom' in globals() and Magmom_single_atom is not None:
numm = [0.0]*bulk_configuration.get_global_number_of_atoms()
numm[Magmom_single_atom[0]] = Magmom_single_atom[1]
else:
numm = [Magmom_per_atom]*bulk_configuration.get_global_number_of_atoms()
bulk_configuration.set_initial_magnetic_moments(numm)
if Ground_calc == True:
# PW Ground State Calculations
Expand Down Expand Up @@ -396,7 +401,11 @@ def groundcalc(self):

elif Mode == 'LCAO':
if Spin_calc == True:
numm = [Magmom_per_atom]*bulk_configuration.get_global_number_of_atoms()
if 'Magmom_single_atom' in globals() and Magmom_single_atom is not None:
numm = [0.0]*bulk_configuration.get_global_number_of_atoms()
numm[Magmom_single_atom[0]] = Magmom_single_atom[1]
else:
numm = [Magmom_per_atom]*bulk_configuration.get_global_number_of_atoms()
bulk_configuration.set_initial_magnetic_moments(numm)
if Ground_calc == True:
parprint("Starting LCAO ground state calculation...")
Expand Down Expand Up @@ -1635,6 +1644,7 @@ def projected_weights(calc):
Mixer_type = MixerSum(0.1, 3, 50) # MixerSum(beta,nmaxold, weight) default:(0.1,3,50), you can try (0.02, 5, 100) and (0.05, 5, 50)
Spin_calc = False # Spin polarized calculation?
Magmom_per_atom = 1.0 # Magnetic moment per atom
Magmom_single_atom = None # Magnetic moment for a single atom [atom_no, magmom]
Total_charge = 0.0 # Total charge. Normally 0.0 for a neutral system.

# DOS ----------------------
Expand Down

0 comments on commit f6abbd1

Please sign in to comment.