If your original script looked something like this (as it would if generated by VNL)
...
# Opening vnlfile
if processIsMaster(): file = VNLFile('myfile.vnl')
# Scattering elements and coordinates
...
if processIsMaster(): nlPrint(twoprobe_configuration)
if processIsMaster(): file.addToSample(twoprobe_configuration, 'twoprobe_configuration')
######################################################################
# Central region parameters
######################################################################
...
runtime_parameters = runtimeParameters(
verbosity_level = 10,
checkpoint_filename = "mycheckpoint.nc"
)
# Perform self-consistent field calculation
scf = executeSelfConsistentCalculation(
twoprobe_configuration,
two_probe_method,
runtime_parameters = runtime_parameters
)
Always make sure to specify a checkpoint file!!!
You can then use code which looks something like the following to create new VNL files, which contain the geometry plus some MPSH states:
from ATK.TwoProbe import *
if processIsMaster():
geo_file = VNLFile('myfile.vnl')
samples = geo_file.readAtomicConfigurations()
geometry = samples[samples.keys()[0]]
scf = restoreSelfConsistentCalculation("mycheckpoint.nc")
######################################################################
# Calculate physical properties
######################################################################
quantum_numbers = (0,1,2,3)
projected_hamiltonian_eigenstates = calculateProjectedHamiltonianEigenstates(
self_consistent_calculation = scf,
projection_atoms = (0,),
quantum_numbers = quantum_numbers
)
if processIsMaster():
mpsh_file = VNLFile('mpsh_%s.vnl' %s str(quantum_numbers))
file.addToSample(geometry, 'twoprobe_configuration')
for i in range(len(quantum_numbers)):
label = 'Projected Hamiltonian Eigenstates'+' '+str(quantum_numbers[i])
if processIsMaster(): file.addToSample(projected_hamiltonian_eigenstates[i], 'twoprobe_configuration', label)
Note that we make new VNL files all the time, but "copy" the geometry from the old file.
Make sure to change file names, projection atoms, etc above to match your own conditions!
I didn't test the above extensively, there might be a typo, but you still need to make it work for your case (file names etc). So just let me know if there are any problems.