Author Topic: Use of a user specified norm conserving pseudopotentials in the calculations  (Read 9373 times)

0 Members and 1 Guest are viewing this topic.

Offline zhangguangping

  • QuantumATK Guru
  • ****
  • Posts: 193
  • Country: cn
  • Reputation: 2
    • View Profile
Dear QW supporters, As I know, it is possible for users to use their own norm conserving pseduopotentials in the calcualtions. And I searched this forum, and find the following way can be used to defined the users' pseduopotentials,
Code
basis_set = [
    GGABasis.Hydrogen_DoubleZetaPolarized(element=Hydrogen,filter_mesh_cutoff=200*Rydberg,
                                            pseudopotential = NormConservingPseudoPotential('/xxx/xxx/H.upf')),
    GGABasis.Carbon_DoubleZetaPolarized(element=Carbon,filter_mesh_cutoff=200*Rydberg,
                                            pseudopotential = NormConservingPseudoPotential('/xxx/xxx/C.upf')),
    GGABasis.Sulfur_DoubleZetaPolarized(element=Sulfur,filter_mesh_cutoff=200*Rydberg,
                                            pseudopotential = NormConservingPseudoPotential('/xxx/xxx/S.upf')),
    GGABasis.Silver_SingleZetaPolarized(element=Silver,filter_mesh_cutoff=200*Rydberg,
                                            pseudopotential = NormConservingPseudoPotential('/xxx/xxx/Ag.upf')),
    ]
However, the atkpython executable can not find my upf pseduopotential. Here the pseduopotentials are give by their absolute path. Must the users' pseduopotentials be put in the directory /xxx/xxx/xxx/share/pseudopotentials? If so, this will need a root privilege since the VNL-ATK is installed by the  administrator. Can I put my own pseduopotentials in a directory that can be avaiable to the executable when the job is running, and specify my own pseduopotentials in the basis_set above ? Thanks so much. With best regards, Guangping Zhang

Offline Jess Wellendorff

  • QuantumATK Staff
  • Supreme QuantumATK Wizard
  • *****
  • Posts: 933
  • Country: dk
  • Reputation: 29
    • View Profile
Should be quite easy to use a user-defined pseudopotential without sysadmin privileges. I am attaching an example where a custom Ga potential is used. I simply point to the absolute path of the upf file, and make sure that I have access to it at run-time. Be aware that you may need to adjust settings such as occupations and number of valence electrons to match your pseudopotential.

Offline zhangguangping

  • QuantumATK Guru
  • ****
  • Posts: 193
  • Country: cn
  • Reputation: 2
    • View Profile
Should be quite easy to use a user-defined pseudopotential without sysadmin privileges. I am attaching an example where a custom Ga potential is used. I simply point to the absolute path of the upf file, and make sure that I have access to it at run-time. Be aware that you may need to adjust settings such as occupations and number of valence electrons to match your pseudopotential.
Dear Jess, Thanks very much for your reply. However, problem persists. It reports that:
Code
Traceback (most recent call last):
  File "Ag-C6H4S2-Ag-Own-PPs.py", line 335, in <module>
    device_configuration.update()
  File "./zipdir/NL/CommonConcepts/Configurations/AtomicConfiguration.py", line 1072, in update
  File "./zipdir/NL/Calculators/DeviceCalculatorInterface.py", line 325, in _update
Exception: The compact_support_radius, 4.64453 Bohr, is shorter than the longest projector which is 5.72208 Bohr
This time, it seems the executable can find my own PPs, but the basis set seems to be problematic. Please find the attached py file and my own PPs. By the way, is there a method to define the size of the basis set use a EnergyShift of each basis orbital due to the confinement like in SIESTA. With best regards, /Guangping Zhang

Offline Anders Blom

  • QuantumATK Staff
  • Supreme QuantumATK Wizard
  • *****
  • Posts: 5576
  • Country: dk
  • Reputation: 96
    • View Profile
    • QuantumATK at Synopsys
The new error is hopefully quite obvious to you.

There is a function in the code to compute the confinement radius from the energy shift - see attached example.
« Last Edit: April 11, 2016, 19:05 by Anders Blom »

Offline zhangguangping

  • QuantumATK Guru
  • ****
  • Posts: 193
  • Country: cn
  • Reputation: 2
    • View Profile
The new error is hopefully quite obvious to you. There is a function in the code to compute the confinement radius from the energy shift - see attached example.
Dear Anders, Thanks very much for your kind reply. I did not understand the warning given by ATK, and searched much without any hints.
Code
Traceback (most recent call last):
  File "Ag-C6H4S2-Ag-Own-PPs.py", line 335, in <module>
    device_configuration.update()
  File "./zipdir/NL/CommonConcepts/Configurations/AtomicConfiguration.py", line 1072, in update
  File "./zipdir/NL/Calculators/DeviceCalculatorInterface.py", line 325, in _update
Exception: The compact_support_radius, 4.64453 Bohr, is shorter than the longest projector which is 5.72208 Bohr
So, can you please give some instruction information? Also, I used the script you give to see the  confinement radius from the energy shift. I write in the test.py the following,
Code
from NL.Calculators.DensityFunctionalTheory.LCAOCalculator.BasisSet import confinementRadiusFromEnergyShift

P = NormConservingPseudoPotential('/home/zhanggp/globe/ATK-TranSIESTA/ATK-own-PPs/PPs/H.upf')
P.load()
N = P._valenceCharge()
rc = confinementRadiusFromEnergyShift(P,6,0,0.001*Rydberg,GGA.PBE._radialBackEngine(),0.00)*Units.Bohr

print rc
and execute atkpython like atkpython test.py > test.out but I get errors.
Code
Traceback (most recent call last):
  File "test.py", line 1, in <module>
    from NL.Calculators.DensityFunctionalTheory.LCAOCalculator.BasisSet import confinementRadiusFromEnergyShift
ImportError: No module named DensityFunctionalTheory.LCAOCalculator.BasisSet
Can you please give some instructions? I not faimilar with the behavior of new version of ATK. Thanks very much. /Guangping Zhang
« Last Edit: April 12, 2016, 17:39 by zhangguangping »

Offline Jess Wellendorff

  • QuantumATK Staff
  • Supreme QuantumATK Wizard
  • *****
  • Posts: 933
  • Country: dk
  • Reputation: 29
    • View Profile
To avoid the import error, use
Code
from NL.Calculators.LCAOCalculator.BasisSet import confinementRadiusFromEnergyShift
Using custom pseudopotentials and/or basis sets is obviously an expert operation. The exception appear to tell you that there is some mismatch between the pseudopotential and basis set.

Offline Anders Blom

  • QuantumATK Staff
  • Supreme QuantumATK Wizard
  • *****
  • Posts: 5576
  • Country: dk
  • Reputation: 96
    • View Profile
    • QuantumATK at Synopsys
The original error message is simply because your basis set has a too short range.

The other one seems to depend on which version of ATK you use. Apparently the module path has changed in 2016, which I use, sorry for not noticing it was still as Jess wrote in 2015.

Offline zhangguangping

  • QuantumATK Guru
  • ****
  • Posts: 193
  • Country: cn
  • Reputation: 2
    • View Profile
Dear Anders and Jess, Thanks for your reply. Yes, the script should be like this,
Code
from NL.Calculators.LCAOCalculator.BasisSet import confinementRadiusFromEnergyShift

P = NormConservingPseudoPotential('/home/zhanggp/globe/ATK-TranSIESTA/ATK-own-PPs/PPs/H.upf')
P.load()
N = P._valenceCharge()
rc = confinementRadiusFromEnergyShift(P,6,0,200*Rydberg,GGA.PBE._radialBackEngine(),0.00)*Units.Bohr

nlprint(rc)
It could give me the rc in output file. However, this is not what I want. Because function confinementRadiusFromEnergyShift is not decribed in the manual. Now I want to compare the results from ATK-2015.1 and TranSIESTA. And for Ag-C6H4S2-Ag junction as attached below, I can set as much parameters as possible the same. At the moment, only pesudopotentials and basis set are maybe largely different. So, I use APE to generate the same pesudopotentials. But the ATK-2015 complains about the basis. The basis set in TranSIESTA I use is: PAO.EnergyShift       100 meV or FilterCutoff  200.0 Ry. So, I wonder, whether I can give a very close basis set in ATK. With best regards, Guangping Zhang
« Last Edit: April 12, 2016, 17:38 by zhangguangping »

Offline Anders Blom

  • QuantumATK Staff
  • Supreme QuantumATK Wizard
  • *****
  • Posts: 5576
  • Country: dk
  • Reputation: 96
    • View Profile
    • QuantumATK at Synopsys
Right, so now you know the confinement radius corresponding to that energy cut-off. Then you put this in the basis set definition, which you easiest get access to by setting the "Show default" on the "Script detail" in the Script Generator, then export the script. You will then find the entire basis set definition in the script, and you can easily modify the cut-off range.

Offline zhangguangping

  • QuantumATK Guru
  • ****
  • Posts: 193
  • Country: cn
  • Reputation: 2
    • View Profile
Dear Anders, Thanks very much for your reply. It is useful of the "Show default" feature. I was not aware of this. However, I yet can not make the executable run. When the code gave errors,
Code
Traceback (most recent call last):
  File "Ag-C6H4S2-Ag-Own-PPs.py", line 485, in <module>
    device_configuration.update()
  File "./zipdir/NL/CommonConcepts/Configurations/AtomicConfiguration.py", line 1072, in update
  File "./zipdir/NL/Calculators/DeviceCalculatorInterface.py", line 325, in _update
Exception: The compact_support_radius, 3.942 Bohr, is shorter than the longest projector which is 5.72208 Bohr
I changed the radial_cutoff_radius for Ag 4d orbital to .73 Bohr,
Code
silver_4d = ConfinedOrbital(
    principal_quantum_number=4,
    angular_momentum=2,
    radial_cutoff_radius=5.73*Bohr,
    confinement_start_radius=3.71562127585*Bohr,
    additional_charge=0,
    confinement_strength=21.5307196457*Hartree,
    confinement_power=1,
    radial_step_size=0.001*Bohr,
    )
However. the executable gave error like this
Code
** Back Engine Exception : mesh does not extend sufficiently beyond projectors
** Location of Exception : radialschrodinger.cpp:920

atkpython: line 11: 12293 Aborted                 $EXEC_DIR/atkpython_exec "$@"
Does this mean the mesh range of my PPs are not sufficient? But they can be used without any problem by TranSIESTA. With best regards, Guangping Zhang

Offline Jess Wellendorff

  • QuantumATK Staff
  • Supreme QuantumATK Wizard
  • *****
  • Posts: 933
  • Country: dk
  • Reputation: 29
    • View Profile
I have no experience with this, but it appears to me from the back-engine exception that you need the radial_cutoff_radius to extend "sufficiently" beyond the projector range, i.e. more than 5.73 Å.

Offline zhangguangping

  • QuantumATK Guru
  • ****
  • Posts: 193
  • Country: cn
  • Reputation: 2
    • View Profile
Dear Jess,

I do not think so. Because I change the radial_cutoff_radius of Ag to 10 Bhor, the error persists. It was that " the mesh does not extend sufficiently beyond projectors ".

With best regards,

/Guangping Zhang

Offline Daniele Stradi

  • Supreme QuantumATK Wizard
  • *****
  • Posts: 286
  • Country: dk
  • Reputation: 3
    • View Profile
Dear zhangguangping,

I have tested *.psf pseudos with ATK and never had this kind of problems. Could you please attach your pseudo so that we can test it?

Thanks,
Daniele.

Offline zhangguangping

  • QuantumATK Guru
  • ****
  • Posts: 193
  • Country: cn
  • Reputation: 2
    • View Profile
Dear Daniele,

Thanks for your reply.

I have attached all the PPs and the *.py  file at the 3rd floor.
Also, I attached them again here.

Here, I just want to use the same PPs for ATK and TranSIESTA, as well as a as similar as possible a basis set.
In TranSIESTA, I use PAO.EnergyShift or FilterCutoff to set the basis set, or even I can use a PAO.Basis block to define the basis set like

%block PAO.Basis           
H                     1     
 n=1   0   2 P   1         
   4.767      3.782   
   1.000      1.000   
C                     2     
 n=2   0   2               
   4.129      3.361   
   1.000      1.000   
 n=2   1   2 P   1         
   4.868      3.467   
   1.000      1.000   
S                     2     
 n=3   0   2               
   4.127      3.480   
   1.000      1.000   
 n=3   1   2 P   1         
   4.987      3.789   
   1.000      1.000   
Ag                    2     
 n=5   0   1 P   1         
   6.879   
   1.000   
 n=4   2   1               
   3.942   
   1.000   
%endblock PAO.Basis

With best regards,

Guangping Zhang
« Last Edit: April 14, 2016, 11:22 by zhangguangping »

Offline Daniele Stradi

  • Supreme QuantumATK Wizard
  • *****
  • Posts: 286
  • Country: dk
  • Reputation: 3
    • View Profile
Dear Guangping,

I have investigated the issue. It looks like the projectors automatically generated by APE are too long ranged for the default ATK basis set. Unfortunately, we cannot support all the pseudopotential generators. There are 2 solutions to this problem:

1) Increase the "radial_cutoff_radius" in your script, until the error disappear. Notice the the required cutoff radius could be much larger (approx. 1.5x-2x) than the default one.
2) Generate the *.psf pseudopotentials with the SIESTA pseudopotential generator. In this case, the generated projectors are much more compatible with our basis set, and ATK should run without problems. I have tested this for Ag, with a *.psf pseudopotential generated using the same configuration of your *.upf pseudopotential.

Regards,
Daniele.