Git Product home page Git Product logo

theochem / chemtools Goto Github PK

View Code? Open in Web Editor NEW
47.0 10.0 22.0 10.92 MB

A collection of interpretive chemical tools for analyzing outputs of the quantum chemistry calculations.

Home Page: https://chemtools.org/

License: GNU General Public License v3.0

Python 100.00%
conceptual-dft atoms-in-molecules population-analysis molecular-orbital-theory density-matrices kinetic-energy-density

chemtools's People

Contributors

ali-tehrani avatar clanssens avatar crisely09 avatar evohringer avatar fanwangm avatar farnazh avatar gabrielasd avatar kimt33 avatar leila-pujal avatar mattchan-tencent avatar msricher avatar paulwayers avatar sfias avatar tczorro avatar tovrstra avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

chemtools's Issues

[QUESTION] Will this repository be updated?

I would love to use this tool, but I am completely unable to install it. When trying to install the master branch, I run into issues installing Horton and Libint (#error LibInt must be compiled with an angular momentum limit of at least MAX_SHELL_TYPE, which I was not able to fix. I also tried installing the GSoC fork (#46), but then it tries to import something from denspart which doesn't seem to have ever existed? (ImportError: cannot import name 'partition' from 'denspart.mbis'). I tried using Conda too, but with no luck.

Will there be updates to the codebase and/or documentation to allow people to use it?

For completeness

  • OS: Debian 12
  • Python version: Python 3.11.2, Miniconda with Python 3.9.16
  • NumPy version: numpy 1.24.2
  • SciPy version: scipy 1.10.1

[BUG] Using ORCA output files

Describe the bug
I am trying to use chemtools with ORCA output files. Looking at the code, I've seen that both .wfn and .mkl files are parsed.

After using orca_2aim to generate the .wfn file, I try to load it using CondensedConceptualDFT.from_file(file_path, model="quadratic"), but get this error:

Traceback (most recent call last):
  File "cdft.py", line 11, in <module>
    tool = CondensedConceptualDFT.from_file(file_path, model="quadratic")
  File "/home/raphael/1XX_General/109_Software/109.02_Chemistry/chemtools/chemtools/toolbox/conceptual.py", line 452, in from_file
    molecules = cls.load_file(fname)
  File "/home/raphael/1XX_General/109_Software/109.02_Chemistry/chemtools/chemtools/toolbox/conceptual.py", line 142, in load_file
    molecule = Molecule.from_file(fnames)
  File "/home/raphael/1XX_General/109_Software/109.02_Chemistry/chemtools/chemtools/wrappers/molecule.py", line 111, in from_file
    iodata = IOData.from_file(os.path.join(os.getcwd(), str(fname)))
  File "/home/raphael/1XX_General/109_Software/109.05_Python/mambaforce/envs/chemtools37/lib/python3.7/site-packages/horton/io/iodata.py", line 308, in from_file
    result.update(load_wfn(filename))
  File "/home/raphael/1XX_General/109_Software/109.05_Python/mambaforce/envs/chemtools37/lib/python3.7/site-packages/horton/io/wfn.py", line 206, in load_wfn
    mo_count, mo_occ, mo_energy, coefficients, energy = load_wfn_low(filename)
  File "/home/raphael/1XX_General/109_Software/109.05_Python/mambaforce/envs/chemtools37/lib/python3.7/site-packages/horton/io/wfn.py", line 94, in load_wfn_low
    num_mo, num_primitives, num_atoms = helper_num(f)
  File "/home/raphael/1XX_General/109_Software/109.05_Python/mambaforce/envs/chemtools37/lib/python3.7/site-packages/horton/io/wfn.py", line 47, in helper_num
    assert line.startswith('GAUSSIAN')
AssertionError

The line begins with GTO instead of GAUSSIAN. If I remove this assertion, I get this error instead:

Traceback (most recent call last):
  File "cdft.py", line 11, in <module>
    tool = CondensedConceptualDFT.from_file(file_path, model="quadratic")
  File "/home/raphael/1XX_General/109_Software/109.02_Chemistry/chemtools/chemtools/toolbox/conceptual.py", line 452, in from_file
    molecules = cls.load_file(fname)
  File "/home/raphael/1XX_General/109_Software/109.02_Chemistry/chemtools/chemtools/toolbox/conceptual.py", line 142, in load_file
    molecule = Molecule.from_file(fnames)
  File "/home/raphael/1XX_General/109_Software/109.02_Chemistry/chemtools/chemtools/wrappers/molecule.py", line 111, in from_file
    iodata = IOData.from_file(os.path.join(os.getcwd(), str(fname)))
  File "/home/raphael/1XX_General/109_Software/109.05_Python/mambaforce/envs/chemtools37/lib/python3.7/site-packages/horton/io/iodata.py", line 308, in from_file
    result.update(load_wfn(filename))
  File "/home/raphael/1XX_General/109_Software/109.05_Python/mambaforce/envs/chemtools37/lib/python3.7/site-packages/horton/io/wfn.py", line 208, in load_wfn
    permutation = get_permutation_basis(type_assignment)
  File "/home/raphael/1XX_General/109_Software/109.05_Python/mambaforce/envs/chemtools37/lib/python3.7/site-packages/horton/io/wfn.py", line 163, in get_permutation_basis
    permutation = get_permutation_orbital(type_assignment)
  File "/home/raphael/1XX_General/109_Software/109.05_Python/mambaforce/envs/chemtools37/lib/python3.7/site-packages/horton/io/wfn.py", line 121, in get_permutation_orbital
    length = degeneracy[value]
KeyError: 4

If I use the .mkl file generated by orca_2mkl instead, I get this output instead:

User:           raphael
Machine info:   Linux Hydre 6.1.0-9-amd64 #1 SMP PREEMPT_DYNAMIC Debian 6.1.27-1 (2023-05-08) x86_64
Time:           2023-06-08T08:54:15.508964
Python version: 3.7.12 | packaged by conda-forge | (default, Oct 26 2021, 06:08:21) [GCC 9.4.0]
HORTON version: 2.1.0
Current Dir:    /home/raphael/tmp/orca
Command line:   cdft.py
HORTON module:  /home/raphael/1XX_General/109_Software/109.05_Python/mambaforce/envs/chemtools37/lib
                /python3.7/site-packages/horton/log.py

Initialized: <horton.gbasis.cext.GOBasis object at 0x14b38ee92910>
  Number of basis functions         : 138
  Number of normalization constants : 183
  Maximum shell type                : 3
  Center     0 :  S8 S8 S1 S1 S1 P3 P1 P1 P1 Dp1 Dp1 Dp1 Fp1 Fp1
  Center     1 :  S3 S1 S1 S1 P1 P1 P1 Dp1 Dp1
  Center     2 :  S3 S1 S1 S1 P1 P1 P1 Dp1 Dp1
  Center     3 :  S3 S1 S1 S1 P1 P1 P1 Dp1 Dp1
  Center     4 :  S3 S1 S1 S1 P1 P1 P1 Dp1 Dp1

Detected incorrect normalization of orbitals loaded from a file.
Trying to fix it as if it was a file generated by ORCA.
Initialized: <horton.gbasis.cext.GOBasis object at 0x14b38ee92280>
  Number of basis functions         : 138
  Number of normalization constants : 183
  Maximum shell type                : 3
  Center     0 :  S8 S8 S1 S1 S1 P3 P1 P1 P1 Dp1 Dp1 Dp1 Fp1 Fp1
  Center     1 :  S3 S1 S1 S1 P1 P1 P1 Dp1 Dp1
  Center     2 :  S3 S1 S1 S1 P1 P1 P1 Dp1 Dp1
  Center     3 :  S3 S1 S1 S1 P1 P1 P1 Dp1 Dp1
  Center     4 :  S3 S1 S1 S1 P1 P1 P1 Dp1 Dp1

Detected typical ORCA errors in file. Fixing them...
Traceback (most recent call last):
  File "cdft.py", line 11, in <module>
    tool = CondensedConceptualDFT.from_file(file_path, model="quadratic")
  File "/home/raphael/1XX_General/109_Software/109.02_Chemistry/chemtools/chemtools/toolbox/conceptual.py", line 453, in from_file
    return cls.from_molecule(molecules, model, approach, scheme, **kwargs)
  File "/home/raphael/1XX_General/109_Software/109.02_Chemistry/chemtools/chemtools/toolbox/conceptual.py", line 481, in from_molecule
    gcdft = GlobalConceptualDFT.from_molecule(molecule, model)
  File "/home/raphael/1XX_General/109_Software/109.02_Chemistry/chemtools/chemtools/toolbox/conceptual.py", line 249, in from_molecule
    dict_energy = get_dict_energy(molecule)
  File "/home/raphael/1XX_General/109_Software/109.02_Chemistry/chemtools/chemtools/toolbox/utils.py", line 190, in get_dict_energy
    nelec + 1: molecule.energy + lumo_e,
TypeError: unsupported operand type(s) for +: 'NoneType' and 'float'

To Reproduce

from chemtools import CondensedConceptualDFT

file_path = "sp.mkl" # or "sp.wfn"
tool = CondensedConceptualDFT.from_file(file_path, model="quadratic")

.wfn and .mkl files

Expected behavior
I would expect chemtools to parse the files correctly like it does for .fchk files and calculate the relevant properties.

System Information:

  • OS: Debian 11, Linux 6.1.0-9-amd64
  • Python version: 3.7.12 (conda)
  • Numpy version: 1.21.6
  • Scipy version: 1.7.3

Docker update

Hello, are you by any chance planning to update the Docker image that was published by tczorro on Dockerhub 3 years ago ?
Thank you for the info !

Matplotlib backend configuration

In some scenario's (not sure which), usage of matplotlib on macos with the default backend leads to non-obvious errors. See for example:

https://travis-ci.com/theochem/tinydft/jobs/200737929#L297
theochem/tinydft#1

This is solved in chemtools with the following line:

matplotlib.use('agg')

The problem with this solution is that it makes it impossible to use plt.show to pop up a windows with a plot.

The ideal solution would be to figure out how to install matplotlib on macos, such that the default backend works.

This is the corresponding matplotlib issue: matplotlib/matplotlib#13096 (It is closed??)

This is the corresponding conda issue: ContinuumIO/anaconda-issues#10554

How to plot NCI plot from outputs of VASP?

Dear developers,

Please help me with how we can plot NCI plots from POSCAR?

from chemtools import NCI nci = NCI.from_file('POSCAR') nci.generate_plot('poscar') nci.generate_scripts('poscar')

Error: AttributeError: Atomic Orbitals information is needed!

Thanks,

failing test test_plane_mesh

I think there are a few errors in the function plane_mesh: np.linspace needs scalars as the 2 first arguments, whereas arrays are supplied.
can you please take a look?
thank you in advance.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.