For this code to work, you would have had to save the configuration to the VNL with the name "system_name".
If you know that the VNL file only contains a single configuration, you can always use the construction
...
vnlfile=VNLFile("file.vnl")
configs=vnlfile.readAtomicConfigurations()
twoprobe_config=configs[configs.keys()[0]]
where "file.vnl" should be the proper name of the VNL file.
Otherwise, if you forgot the name used to store the configuration, use this code:
...
vnlfile=VNLFile("file.vnl")
configs=vnlfile.readAtomicConfigurations()
print configs.keys()
This will print the configuration name; let's say it is "my_system". Then use that in
twoprobe_config=vnlfile.readAtomicConfigurations()["my_system"]
You can also open the VNL file in the Result Browser in VNL, then you will see the configuration name.
Dear Sir,
I was trying to obtain the atoms in the central region for nanotube using the below mentioned code:
from ATK.TwoProbe import *
from displayCentralRegion import displayCentralRegionAtoms
vnl_file=VNLFile("CNT.vnl")
atomic_configuration_dict = vnl_file.readAtomicConfigurations()
atomic_configuration = atomic_configuration_dict["twoprobe_configuration"]
displayCentralRegionAtoms(atomic_configuration)
then i tried using code mentioned below, but got errors:
...
vnlfile=VNLFile("file.vnl")
configs=vnlfile.readAtomicConfigurations()
twoprobe_config=configs[configs.keys()[0]]
I get:
File "Li_SW15_2-Trans.Spec.py", line 9, in ?
twoprobe_config=configs[configs.keys()[0]]
IndexError: list index out of range
Traceback (most recent call last):
And, when I try to get the configuration name using
...
vnlfile=VNLFile("file.vnl")
configs=vnlfile.readAtomicConfigurations()
print configs.keys()
I get only []
How do i obtain the central region atoms with periodic_atom_configuration such as in nanotubes?