QuantumATK Forum

QuantumATK => General Questions and Answers => Topic started by: Hassan on June 26, 2015, 17:53

Title: Mistake in Reference Manual - Atomic Compensation Charge
Post by: Hassan on June 26, 2015, 17:53
In the manual page for AtomicCompensationCharge (http://quantumwise.com/documents/manuals/latest/ReferenceManual/index.html/ref.atomiccompensationcharge.html), you have the following code example:

Code
# Set up configuration
bulk_configuration = BulkConfiguration(
    bravais_lattice=FaceCenteredCubic(5.4306*Angstrom),
    elements=[Silicon, Silicon],
    fractional_coordinates=[[ 0.  ,  0.  ,  0.  ],
                            [ 0.25,  0.25,  0.25]]
    )

# Set a negative compensation charge on each atom, to compensate for p-doping
compensation_charge = AtomicCompensationCharge([[0, -0.0005], [1, -0.0005]])
bulk_configuration.setExternalPotential(compensation_charge)

# Calculator
numerical_accuracy_parameters = NumericalAccuracyParameters(
    k_point_sampling=(5, 5, 5),
    )
It is copied from the 13.8 Manual page (http://quantumwise.com/documents/manuals/ATK-13.8/ReferenceManual/ref.atomiccompensationcharge.html).

The problem is that you have changed the functionality of the atomic_shifts argument in 14.0 onwards (why...I'm not sure). It accepts tags and charge tuples rather than atom index and charge tuples so if you tried to use the code example you get an error.

It should read:

Code
bulk_configuration = BulkConfiguration(
    bravais_lattice=FaceCenteredCubic(5.4306*Angstrom),
    elements=[Silicon, Silicon],
    fractional_coordinates=[[ 0.  ,  0.  ,  0.  ],
                            [ 0.25,  0.25,  0.25]]
    )
bulk_configuration.addTags ('all_atoms', [0,1])

# Set a negative compensation charge on each atom, to compensate for p-doping
compensation_charge = AtomicCompensationCharge([('all_atoms', -0.0005)])
bulk_configuration.setExternalPotential(compensation_charge)
Title: Re: Mistake in Reference Manual - Atomic Compensation Charge
Post by: Anders Blom on June 28, 2015, 00:25
Thanks for noticing - we'll fix it!

Why we changed, is a longer story, but basically we couldn't make the old scheme work properly in all scenarios involving the Script Generator, nlsave/nlread, etc.