Hi,
Thanks for your answer. I attached my script. I could manage to correct the error message when I decreased the doping concentration from 10^24 to 2*10^19. However my problem is in the doping part of the code. It is as below. In the GNR obviously there are both C and H atoms in the structure so how can I dope the right and left electrodes? When I write left_electrode.setExternalPotential(
AtomicCompensationCharge([(Carbon, -1*doping)]))
only C atoms in the electrode are doped, right? So what can I do for doping both C and H atoms? Thanks.
Whole doping part:
# -------------------------------------------------------------
# Add Doping
# -------------------------------------------------------------
doping_density = 2e+19
# Calculate the volume and convert it to cm^-3
# Note: right and left electrodes have the same volume,
volume = right_electrode_lattice.unitCellVolume()
volume = float(volume/(0.01*Meter)**3)
# Calculate charge per atom
doping = doping_density * volume / len(right_electrode_elements)
# Add p- and n-type doping to the central region
external_potential = AtomicCompensationCharge([
('p_doping', -1*doping), ('n_doping',doping)
])
central_region.setExternalPotential(external_potential)
# Add doping to left and right electrodes
left_electrode.setExternalPotential(
AtomicCompensationCharge([(Carbon, -1*doping)]))
right_electrode.setExternalPotential(
AtomicCompensationCharge([(Carbon, doping)]))
Nope. to dope tagged atoms use:
external_potential = AtomicCompensationCharge([
('tag1_name', -0.25),
('tag2_name', -0.002),
])
bulk_configuration.setExternalPotential(external_potential)
to add 0.25 and 0.002 electrons to each atom tagged by "tag1_name" and "tag2_name", respectively.
In the code below, len(left_electrode_elements) can include un-tagged elements.
So I need to replace len(left_electrode_elements) by number of tagged atoms ?
# Calculate charge per atom
doping_left = doping_density * volume_left / len(left_electrode_elements)
# -------------------------------------------------------------
# Add Doping
# -------------------------------------------------------------
doping_density = 1e+19
# Calculate the volume and convert it to cm^-3
# Note: right and left electrodes have the same volume,
volume_left = left_electrode_lattice.unitCellVolume()
volume_left = float(volume_left/(0.01*Meter)**3)
volume_right = right_electrode_lattice.unitCellVolume()
volume_right = float(volume_right/(0.01*Meter)**3)
# Calculate charge per atom
doping_left = doping_density * volume_left / len(left_electrode_elements)
doping_right = doping_density * volume_right / len(right_electrode_elements)
# Add p- and n-type doping to the central region
external_potential = AtomicCompensationCharge([
('p-side', -1*doping_left), ('n-side',doping_right)
])
central_region.setExternalPotential(external_potential)
# Add doping to left and right electrodes
left_electrode.setExternalPotential(
AtomicCompensationCharge([(Phosphorus, -1*doping_left)]))
right_electrode.setExternalPotential(
AtomicCompensationCharge([(Tungsten, doping_right)]))
Oh I see, yes, you should normalize the doping concentration to the number of atoms you actually want to dope.
If you tagged your atoms in the left electrode with "doping_left", for example, you can use:
doping_left = doping_density * volume_left / len(left_electrode.indicesFromTags('doping_left'))