My Q-ATK version: Version V-2023.12-SP1
I am working on ChargedPointDefect module to calculate charge transition level.
I tested the CPD tutorial.(
https://docs.quantumatk.com/tutorials/charged_point_defect_study_object/charged_point_defect_study_object.html)
This tutorial is written for Script Generator but I did the same steps using Workflows because Q-ATK2023 does not support Script Generator.
Following the tutorial link, I could successfully obtain result for diamond with boron substitutional. See the attached image The problem is that ChargedPointDefect does not work for interstitial defect. It seems the calculation is okay, but GUI has some errors.The two py scripts of both substitutional boron and interstitial hydrogen are shown at the end of the post.
There are two errors: 1. libXss.so.1 import error 2. zipdir/NL/GUI issue
I think the second one is trouble because when I looked at atkpython libraries in the path of quantumatk/V-2023.12-SP1/atkpython/lib/python3.11/site-packages/, there is no library called NL.
Can anyone help me with this error?
One more question: Does anyone knows where is the .vnl directory. I could not find .vnl.
(
https://forum.quantumatk.com/index.php?topic=6335.0)
I'm using HPC of Rocky Linux 8.7, and Q-ATK is installed in root directory and I used it as a just user.
Thank you in advance
==================================================================================================Error message when I open interstitial hydrogen CPD result file:Error in sys.excepthook:
Traceback (most recent call last):
File "zipdir/ATKExceptionHandler.py", line 194, in __showCrashDialog
File "zipdir/ATKExceptionHandler.py", line 208, in __showCrashDialogTk
File "/opt/synopsys/tool/quantumatk/V-2023.12-SP1/atkpython/lib/python3.11/tkinter/__init__.py", line 38, in <module>
import _tkinter # If this fails your Python may not be configured for Tk
^^^^^^^^^^^^^^^
ImportError: libXss.so.1: cannot open shared object file: No such file or directory
Original exception was:
Traceback (most recent call last):
File "zipdir/NL/GUI/Tools/Data/DataCatalogWidget.py", line 844, in _onDoubleClicked
File "zipdir/NL/GUI/Tools/Data/DataCatalogWidget.py", line 945, in open
File "/tmp/tmp_xh4zvsfAddOns/ChargedPointDefectAnalyzer/ChargedPointDefectAnalyzerPlugin.py", line 112, in createWidget
File "/tmp/tmp_xh4zvsfAddOns/ChargedPointDefectAnalyzer/ChargedPointDefectAnalyzerWidget.py", line 91, in __init__
File "/tmp/tmp_xh4zvsfAddOns/ChargedPointDefectAnalyzer/DefectCollection.py", line 196, in addDefectCalculations
File "zipdir/NL/Defects/ChargedPointDefects/DefectResultsSummary.py", line 138, in __init__
File "zipdir/NL/Defects/ChargedPointDefects/DefectResultsSummary.py", line 1234, in loadData
File "zipdir/NL/Defects/ChargedPointDefects/DefectResultsSummary.py", line 1268, in loadDataStudy
TypeError: ChargedPointDefect._defectSymmetryGroups() missing 2 required positional arguments: 'supercell_repetitions' and 'charge_state'
^C
==================================================================================================py file for Interstitial hydrogen CPD:from SMW import *
# %% Diamond
# Set up lattice
vector_a = [3.56679, 0.0, 0.0]*Angstrom
vector_b = [0.0, 3.56679, 0.0]*Angstrom
vector_c = [0.0, 0.0, 3.56679]*Angstrom
lattice = UnitCell(vector_a, vector_b, vector_c)
# Define elements
elements = [Carbon, Carbon, Carbon, Carbon, Carbon, Carbon, Carbon, Carbon]
# Define coordinates
fractional_coordinates = [[ 0. , 0. , 0. ],
[ 0.25, 0.25, 0.25],
[ 0.5 , 0.5 , 0. ],
[ 0.75, 0.75, 0.25],
[ 0.5 , 0. , 0.5 ],
[ 0.75, 0.25, 0.75],
[ 0. , 0.5 , 0.5 ],
[ 0.25, 0.75, 0.75]]
# Set up configuration
diamond = BulkConfiguration(
bravais_lattice=lattice,
elements=elements,
fractional_coordinates=fractional_coordinates
)
diamond_name = "diamond"
# %% Set LCAOCalculator
# %% LCAOCalculator
density_mesh_cutoff = calculateDefaultDensityMeshCutoff(
calculator_type=LCAOCalculator,
configuration=diamond,
basis_set=None,
wave_function_cutoff=None
)
k_point_sampling = MonkhorstPackGrid(
na=8,
nb=8,
nc=8
)
numerical_accuracy_parameters = NumericalAccuracyParameters(
density_mesh_cutoff=density_mesh_cutoff,
k_point_sampling=k_point_sampling
)
calculator = LCAOCalculator(
numerical_accuracy_parameters=numerical_accuracy_parameters,
checkpoint_handler=NoCheckpointHandler
)
# %% Set Calculator
diamond.setCalculator(calculator)
nlsave('Diamond_results.hdf5', diamond)
# %% PointDefect
hydrogen_atomic_chemical_potential = AtomicChemicalPotential(
element=Hydrogen
)
atomic_chemical_potentials = Table(
columns=[
InstanceColumn(
key= 'atomic_chemical_potential',
title='Atomic Chemical Potential',
instance_types=AtomicChemicalPotential
)
]
)
atomic_chemical_potentials.setMetatext('Atomic Chemical Potentials')
atomic_chemical_potentials.appendRow([hydrogen_atomic_chemical_potential])
point_defect = Interstitial(
element=Hydrogen,
cartesian_coordinates=[1.783395, 1.783395, 1.783395]*Angstrom
)
nlsave('Diamond_results.hdf5', point_defect)
nlsave('Diamond_results.hdf5', atomic_chemical_potentials)
# %% ChargedPointDefect
charged_point_defect = ChargedPointDefect(
bulk_configuration=diamond,
filename='Diamond_results.hdf5',
object_id='cpd',
formation_energy_calculator=calculator,
point_defect=point_defect,
charge_states=[-1, 0, 1],
atomic_chemical_potentials=atomic_chemical_potentials.extract(AtomicChemicalPotential),
log_filename_prefix='charged_point_defect_',
number_of_processes_per_task=ProcessesPerNode
)
charged_point_defect.update()
==================================================================================================py file for substitutional boron CPD: (Did the same steps as in Q-ATK tutorial)
from SMW import *
# %% Diamond
# Set up lattice
vector_a = [3.56679, 0.0, 0.0]*Angstrom
vector_b = [0.0, 3.56679, 0.0]*Angstrom
vector_c = [0.0, 0.0, 3.56679]*Angstrom
lattice = UnitCell(vector_a, vector_b, vector_c)
# Define elements
elements = [Carbon, Carbon, Carbon, Carbon, Carbon, Carbon, Carbon, Carbon]
# Define coordinates
fractional_coordinates = [[ 0. , 0. , 0. ],
[ 0.25, 0.25, 0.25],
[ 0.5 , 0.5 , 0. ],
[ 0.75, 0.75, 0.25],
[ 0.5 , 0. , 0.5 ],
[ 0.75, 0.25, 0.75],
[ 0. , 0.5 , 0.5 ],
[ 0.25, 0.75, 0.75]]
# Set up configuration
diamond = BulkConfiguration(
bravais_lattice=lattice,
elements=elements,
fractional_coordinates=fractional_coordinates
)
diamond_name = "diamond"
# %% Set LCAOCalculator (2)
# %% LCAOCalculator
density_mesh_cutoff = calculateDefaultDensityMeshCutoff(
calculator_type=LCAOCalculator,
configuration=diamond,
basis_set=None,
wave_function_cutoff=None
)
k_point_sampling = MonkhorstPackGrid(
na=8,
nb=8,
nc=8
)
numerical_accuracy_parameters = NumericalAccuracyParameters(
density_mesh_cutoff=density_mesh_cutoff,
k_point_sampling=k_point_sampling
)
calculator = LCAOCalculator(
numerical_accuracy_parameters=numerical_accuracy_parameters,
checkpoint_handler=NoCheckpointHandler
)
# %% Set Calculator
diamond.setCalculator(calculator)
nlsave('Diamond_1_results.hdf5', diamond)
# %% PointDefect (2)
carbon_atomic_chemical_potential = AtomicChemicalPotential(
element=Carbon
)
boron_atomic_chemical_potential = AtomicChemicalPotential(
element=Boron
)
atomic_chemical_potentials = Table(
columns=[
InstanceColumn(
key= 'atomic_chemical_potential',
title='Atomic Chemical Potential',
instance_types=AtomicChemicalPotential
)
]
)
atomic_chemical_potentials.setMetatext('Atomic Chemical Potentials')
atomic_chemical_potentials.appendRow([carbon_atomic_chemical_potential])
atomic_chemical_potentials.appendRow([boron_atomic_chemical_potential])
point_defect = Substitutional(
element=Boron
)
nlsave('Diamond_1_results.hdf5', point_defect)
nlsave('Diamond_1_results.hdf5', atomic_chemical_potentials)
# %% ChargedPointDefect (2)
charged_point_defect = ChargedPointDefect(
bulk_configuration=diamond,
filename='Diamond_1_results.hdf5',
object_id='cpd',
formation_energy_calculator=calculator,
point_defect=point_defect,
charge_states=[-1, 0, 1],
atomic_chemical_potentials=atomic_chemical_potentials.extract(AtomicChemicalPotential),
dielectric_constant=6.28186,
log_filename_prefix='charged_point_defect_',
number_of_processes_per_task=ProcessesPerNode
)
charged_point_defect.update()