modifyDoping¶
- modifyDoping(configuration, tag, new_charge=None, new_doping_type=None, new_tag=None)¶
Modify the doping on a configuration.
- Parameters:
configuration (AtomicConfiguration) – The configuration to dope.
tag (str) – The tag of the doping.
new_charge (float | None) – The new doping charge to apply. This value is interpreted as being in the unit e/atom.
new_doping_type (NType | PType | None) – The new doping type to apply to the tagged atoms.
new_tag (str | None) – The new tag to assign to the tagged atoms.
Usage Examples¶
Modify the doping charge, type and tag on the selection of atoms tagged ‘doping_0’.
# --- Setup a configuration ---
# Set up lattice
vector_a = [5.4306, 0.0, 0.0]*Angstrom
vector_b = [0.0, 5.4306, 0.0]*Angstrom
vector_c = [0.0, 0.0, 16.291800000000002]*Angstrom
lattice = UnitCell(vector_a, vector_b, vector_c)
# Define elements
elements = [Silicon, Silicon, Silicon, Silicon, Silicon, Silicon, Silicon,
Silicon, Silicon, Silicon, Silicon, Silicon, Silicon, Silicon,
Silicon, Silicon, Silicon, Silicon, Silicon, Silicon, Silicon,
Silicon, Silicon, Silicon]
# Define coordinates
fractional_coordinates = [[ 0. , 0. , 0. ],
[ 0. , 0. , 0.333333333333],
[ 0. , 0. , 0.666666666667],
[ 0.25 , 0.25 , 0.083333333333],
[ 0.25 , 0.25 , 0.416666666667],
[ 0.25 , 0.25 , 0.75 ],
[ 0.5 , 0.5 , 0. ],
[ 0.5 , 0.5 , 0.333333333333],
[ 0.5 , 0.5 , 0.666666666667],
[ 0.75 , 0.75 , 0.083333333333],
[ 0.75 , 0.75 , 0.416666666667],
[ 0.75 , 0.75 , 0.75 ],
[ 0.5 , 0. , 0.166666666667],
[ 0.5 , 0. , 0.5 ],
[ 0.5 , 0. , 0.833333333333],
[ 0.75 , 0.25 , 0.25 ],
[ 0.75 , 0.25 , 0.583333333333],
[ 0.75 , 0.25 , 0.916666666667],
[ 0. , 0.5 , 0.166666666667],
[ 0. , 0.5 , 0.5 ],
[ 0. , 0.5 , 0.833333333333],
[ 0.25 , 0.75 , 0.25 ],
[ 0.25 , 0.75 , 0.583333333333],
[ 0.25 , 0.75 , 0.916666666667]]
# Set up configuration
bulk_configuration = BulkConfiguration(
bravais_lattice=lattice,
elements=elements,
fractional_coordinates=fractional_coordinates
)
# Add external potential
external_potential = AtomicCompensationCharge()
bulk_configuration.setExternalPotential(external_potential)
# Make a selection of atoms to add doping to
selected_indices = numpy.array([2, 5, 8, 11, 14, 17, 20, 23])
# Add doping
addDoping(
configuration=bulk_configuration,
indices=selected_indices,
charge=0.000200195107106,
doping_type=N_type,
tag='doping_0'
)
# --- Modify all aspects of the doping ---
modifyDoping(
configuration=bulk_configuration,
tag='doping_0',
new_charge=0.000400390214212,
new_doping_type=P_type,
new_tag='my_doping'
)
See also Notes on Doping.