Author Topic: (Edited) ChargedPointDefect: interstitial doesn't work / substitutional is fine  (Read 4338 times)

0 Members and 1 Guest are viewing this topic.

Offline beomjin

  • New QuantumATK user
  • *
  • Posts: 3
  • Country: kr
  • Reputation: 0
    • View Profile
(Final revision: May 31, 2024, 10:30)

Q-ATK Version: V-2023.12-SP1
HPC OS: Rocky Linux 8.7
User: Non-sudoer

Hello, this is my first post on the Q-ATK forum. There might be mistakes in my post, so I appreciate your understanding and any feedback.

I am currently working on the ChargedPointDefect (CPD) module to calculate the charge transition level of defects. I followed the CPD tutorial (https://docs.quantumatk.com/tutorials/charged_point_defect_study_object/charged_point_defect_study_object.html), using Workflows instead of Script Generator as Q-ATK2023 does not support Script Generator.
Also, there was a previous post about Charged defects in the Q-ATK forum, but it's a different problem.
(https://forum.quantumatk.com/index.php?topic=11055.msg37116#msg37116)

I successfully obtained results for diamond with a boron substitutional defect (see attached image). However, the ChargedPointDefect module does not work for an interstitial defect. The two .py scripts for substitutional boron and interstitial hydrogen are attached.
Fortunately, I can export data from ChargedPointDefect .hdf5 file at Nanolab and it gives me formation energy for each charge state (See attached image). So only the GUI function that makes the charge transition plot doesn't work.

Error: Missing 2 required positional arguments: 'supercell_repetitions' and 'charge_state'    (The full error code is provided at the end of this post.)
In the attached .py scripts, 'supercell_repetitions' defaults to (1x1x1). The 'charge_state' parameter is correctly set in the CPD block, and it works for substitutional boron. However, using the same input scripts for interstitial hydrogen results in an input argument error.

It seems the ChargedPointDefect module works for substitutional defects but not for interstitial defects.

ChatGPT Suggestions:

1. Function Definition and Call Issue: The 'update' method or another method within the ChargedPointDefect class might be calling '_defectSymmetryGroups' without properly passing the required arguments.
2. Incorrect Function Call: Another part of the code might be calling '_defectSymmetryGroups' and missing the necessary arguments.
The 'ChargedPointDefect' library in the QATK.zip file is in .pye format, not .py, so I cannot access its content.

Can someone help me with this error?

Side Question: Does anyone know where the .vnl directory is? I couldn't find it. Some suggest that GUI issues can be solved by removing the ".hdf" file in the ".vnl" directory (https://forum.quantumatk.com/index.php?topic=6335.0).

Thank you in advance.

======================================================================================================
Error message when I try to open CPD .hdf5 result file of interstitial hydrogen from Nanolab GUI as belows:
Exporting CPD .hdf5 file seems to be okay as I mentioned.

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'
« Last Edit: June 1, 2024, 02:45 by beomjin »

Offline Anders Blom

  • QuantumATK Staff
  • Supreme QuantumATK Wizard
  • *****
  • Posts: 5575
  • Country: dk
  • Reputation: 96
    • View Profile
    • QuantumATK at Synopsys
The .vnl directory was renamed into .quantumatk, located in C:\users\<username> on Windows and $HOME on Linux. However, your issue will not be resolved by removing any file there.

I think the problem is that the tutorial is designed for an older version, and we now use a few different classes for a defect study. The tell-tale sign is the "import SMW" at the top of your script; this module is now more or less retired.

What I would recommend is to open the Workflow Builder in the new version of NanoLab and go to Templates in the right-hand panel. From there, insert the Defect Formation workflow (under Defects and Defect Diffusion). Now, you need to add the actual materials to use in the empty boxes, and define calculators etc, but hopefully it's intuitive enough, even without a tutorial. If not, let us know here and we can guide more.

Offline beomjin

  • New QuantumATK user
  • *
  • Posts: 3
  • Country: kr
  • Reputation: 0
    • View Profile
Thank you for the feedback.

I've tried Defect Formation in Templates, but there's still problems. I think it's complex and there should be mistakes.

Currently, I'm trying to post-process defect formation energy data using Doped python library.

If I return to Q-ATK post-processing GUI, I will ask questions. (Q-ATK offers many functions on defect.)

Thank you

Offline beomjin

  • New QuantumATK user
  • *
  • Posts: 3
  • Country: kr
  • Reputation: 0
    • View Profile
Dear Dr. Anders Blom,

I have additional question.

I'm working on calculating charge transition level of ultra thin films of thickness 1~2 nm.

Can I still use "ChargedPointDefect" for this thin structures?

For example, I'm trying to do CPD calculation for LCAO_Calculator with FFT2D solver (XY PBC and Z Neumann, Dirichlet boundary condition).

Does the ChargedPointDefect block still works for this LCAO_Calculator?

Or should I manually use correction terms from other software? like below reference
PRL 102, 016402 (2009): Fully Ab Initio Finite-Size Corrections for Charged-Defect Supercell Calculations

Thank you in advance
« Last Edit: July 3, 2024, 10:55 by beomjin »

Offline Anders Blom

  • QuantumATK Staff
  • Supreme QuantumATK Wizard
  • *****
  • Posts: 5575
  • Country: dk
  • Reputation: 96
    • View Profile
    • QuantumATK at Synopsys
The tool is designed for bulk structures. For 2D materials and generally interfaces and thin films, one should use anisotropic dipole corrections, which is something we are currently looking into.

The workflow works well with LCAO but you might need a band gap correction method like HSE or DFT+1/2.