addToSample — Adds an object (calculation result, atomic configuration, etc.) to a VNL input file.
The method addToSample() belongs the VNLFile object. Its usage is to add different
quantities to samples in the VNLFile, which
in return can be imported into Virtual NanoLab in order to visualize the
corresponding physical and geometric quantities.
List of arguments
The object to be added to sample_name. The object can be one of the following:
An ElectronDensity created by calculateElectronDensity().
A LocalPotential created either by calculateEffectivePotential() or calculateElectrostaticDifferencePotential().
An Eigenstate, which can be a molecular wave function
or a Bloch state, created by calculateEigenstates(), an MPSH wave function created by calculateProjectedHamiltonianEigenstates(), or
transmission eigenstate created by calculateTransmissionEigenstates().
A MolecularEnergySpectrum created by calculateMolecularEnergySpectrum().
A LocalDensityOfStates created by calculateLocalDensityOfStates().
A TransmissionSpectrum created by calculateTransmissionSpectrum().
A DensityOfStates created by calculateDensityOfStates().
AtomicForces created by calculateAtomicForces().
EigenstateOccupations created by calculateEigenstateOccupations().
The FermiEnergy created by calculateFermiEnergy().
The ProjectedHamiltonianEnergySpectrum created by calculateProjectedHamiltonianEnergySpectrum().
TransmissionCoefficients created by calculateTransmissionCoefficients().
The Current created by calculateCurrent().
The TotalEnergy created by calculateTotalEnergy().
MullikenPopulation created by calculateMullikenPopulation().
EnergyBands created by calculateEnergyBands().
TransmissionEigenValues created by calculateTransmissionEigenvalues().
Default:
None
The sample name you want to add the calculated property under.
Default:
None
The label you want to give the property you are adding; It is optional to specify the label. This will also be the label of the plot when you visualize it in the Nanoscope.
Default:
None
from ATK.KohnSham import * au_fcc = BulkConfiguration(...) method = KohnShamMethod(...) scf = method.apply(au_fcc) electron_density = calculateElectronDensity(scf) file = VNLFile("mysessionfile.vnl") file.addToSample(au_fcc, "Gold sample", "configuration") file.addToSample(electron_density, "Gold sample", "electron density")
Properties will be stored under the sample with the given label. If another object stored in the same sample with the same label, it will overwrite the already existing object. This ensures that the outcome, of running a script, always will be the same.
If the label is not given, it will choose an appropriate label.
If sample_name already exists in the VNLFile, the information is added to the given
sample. If sample_name does not exists, a new sample with that
name is created in the VNLFile.
Only one atomic configuration object (MoleculeConfiguration, BulkConfiguration, or TwoProbeConfiguration) can be added per sample, but a VNLFile can contain several samples. Attempting to add an atomic configuration to a sample will overwrite the existing atomic configuration in the sample.