I designed an alternative way to do this, while we wait for the release of version R-2020.09 later this year, which will have proper support for isotopes in QuantumATK.
Now, I haven't had time to test this fully or anything, but basically you need to redefine the atomicMasses() method in the DeviceConfiguration base class. This should be done before you create the configuration:
import NLEngine
def customMasses(self):
masses = NLEngine.elementsToAtomicMasses(self.elements())
for i in self.indicesFromTags("HSi"):
masses[i] = Heavysimass
return masses*Units.atomic_mass_unit
DeviceConfiguration.atomicMasses = customMasses
Then you define the device_configuration as usual, and finally you need to add the tag "HSi" to all atoms you want to have the different mass.
Like so (not 100% ready code, but I think you get the idea; you still need to define Z_mid and the heavy mass and so on, like before):
heavy_atoms = numpy.where(device_configuration.cartesianCoordinates()[:,2] > Z_mid)[0]
device_configuration.addTags("HSi", heavy_atoms)
Note that your case is a bit different than the example in the future, in that your right electrode also needs to consist of "heavy atoms". Using the tag approach, this is automatically taken care of, whereas in your script, if it had worked technically (e.g. if you used an older version of the code), you actually only replaced the atoms inside the central region.
Hope it work, like I said, I didn't test it properly.