Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

xTB support request #158

Closed
licheng-xu-echo opened this issue Jul 13, 2023 · 7 comments
Closed

xTB support request #158

licheng-xu-echo opened this issue Jul 13, 2023 · 7 comments

Comments

@licheng-xu-echo
Copy link

Dear developers,

Is there any play to the xTB? A cheap and powerful QC package.

@leeping
Copy link
Owner

leeping commented Jul 19, 2023 via email

@licheng-xu-echo
Copy link
Author

Thank you for your kind response. I appreciate your help. I've come across another minor issue while examining the document for the ASE API in xtb-python. It appears that the keywords "charge" and "mult" are not currently supported. I attempted to modify these parameters, but unfortunately, the changes didn't yield the desired results. It's possible that there might be a need for an update in the geomeTRIC documentation, specifically in the section where it's mentioned: "--ase-kwargs='{"method":"GFN2-xTB", "charge":0, "mult":1}'." Your assistance in resolving this matter would be greatly appreciated.

@leeping
Copy link
Owner

leeping commented Aug 14, 2023

The codes I added to geomeTRIC for setting the charge and multiplicity in ASE/XTB was based on this discussion:

grimme-lab/xtb-python#58

The user cannot directly pass the charge and multiplicity to the calculator constructor, but one can pass an array of initial charges and spins. The workaround was to assign the total net charge and spin to the first atom in the system.

I tested this with a charged system and I thought it was working properly. Are you saying it's not working for you? Could you provide an example?

@licheng-xu-echo
Copy link
Author

licheng-xu-echo commented Aug 15, 2023

I have carefully reviewed the discussion you provided. However, it seems that resolving this issue might require modifications to the XTB class and related APIs within the xtb-python package.

Without modification of APIs in xtb-python package, I conducted an experiment using a benzene anion with one hydrogen removed to test the "charge" and "mult" parameters within the "ase-kwargs." I executed two geomeTRIC commands as follows:

  1. geometric-optimize --engine ase --ase-class xtb.ase.calculator.XTB --ase-kwargs='{"method":"GFN2-xTB","charge":-1,"mult":1}' benzene_noH.xyz
  2. geometric-optimize --engine ase --ase-class xtb.ase.calculator.XTB --ase-kwargs='{"method":"GFN2-xTB","charge":0,"mult":2}' benzene_noH.xyz

I approached these commands by treating the molecule as an anion and a radical, respectively. Unfortunately, the optimization process yielded identical 'log' files and '_optim.xyz' files for both cases. My suspicion is that the unsupported parameter within 'ase-kwargs' might not be generating an error but rather is failing to produce the intended differentiation.

For your reference, the molecule I utilized is described below:

11
benzene_noH
 C                 -4.82412325   -1.48754588    0.00068200
 C                 -3.42896325   -1.48754588    0.00068200
 C                 -2.73142525   -0.27979488    0.00068200
 C                 -3.42907925    0.92871412   -0.00051700
 C                 -4.82390425    0.92863612   -0.00099600
 C                 -5.52150525   -0.27956988    0.00000000
 H                 -5.37388225   -2.43986288    0.00113200
 H                 -2.87945525   -2.44005888    0.00199700
 H                 -1.63174525   -0.27971488    0.00131600
 H                 -5.37402625    1.88091712   -0.00194900
 H                 -6.62110925   -0.27938688   -0.00018000

I hope this detailed information assists you in understanding the issue more comprehensively. Your guidance in addressing this matter would be greatly appreciated.
benzene_noH.tar.gz

@leeping
Copy link
Owner

leeping commented Aug 15, 2023

I'm not seeing the result you're seeing. Is it possible we are using different versions? The functionality I talked about might not be in the 1.0 release but instead the development version. I am running this with the latest commit (9981b39).

When I attempted to use your command, I got a TypeError: unsupported operand type(s) for -: 'str' and 'int'. I then removed the quotes around the numbers for charge and mult, and the job ran successfully.

My outputs are attached. The results seem different for the anion and radical cases.

These are the relevant packages:

(main) leeping@libra:~/temp/geometric-test/benzene-noH-ase/0_anion$ conda list | grep -i "ase\|xtb"
ase                       3.22.1             pyhd8ed1ab_1    conda-forge
gst-plugins-base          1.20.3               hf6a322e_0    conda-forge
libwebp-base              1.2.4                h166bdaf_0    conda-forge
matplotlib-base           3.6.0            py39hf9fd14e_0    conda-forge
xtb                       6.3.3                h323e27b_1    conda-forge
xtb-python                20.2             py39hbd71b63_2    conda-forge

benzene-noH-ase.tar.gz

@licheng-xu-echo
Copy link
Author

licheng-xu-echo commented Aug 15, 2023

Thank you for your kind attention! I have uploaded the log file and corrected the command for the previous comment. With the previous package version, the log file are just identical. I install the latest geomeTRIC from the source and the ase-related package just as you provide, the log file are different for the anion and radical cases!

@leeping
Copy link
Owner

leeping commented Aug 15, 2023

That's great! I apologize that the features in the documentation aren't consistent with the release. It probably means we should do a new release very soon. :)

@leeping leeping closed this as completed Aug 15, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants