Giter VIP home page Giter VIP logo

xtp's Introduction

Codacy Badge CI Docker DOI JOSS

This is VOTCA, which provides the two following subpackages:

  • VOTCA-CSG, a library which provides tools to develop coarse-grained potentials from atomistic simulation data
  • VOTCA-XTP, a library providing the DFT+GW-BSE method to calculate electronically excited states in single molecules, in molecular materials with quantum-classical embedding, as well as electron, hole, and exciton dynamics in atomistic MD-trajectories.

Basic installation

(see performance advice in Install Guide)

prefix=WHERE/TO/INSTALL/VOTCA
version=master # or 'v2024.1'
git clone -b ${version} https://github.com/votca/votca.git
cmake -B builddir -S votca -DBUILD_XTP=ON -DCMAKE_INSTALL_PREFIX=${prefix}
cmake --build builddir --parallel <number of cores>
ctest --test-dir builddir # to test build
cmake --build builddir --target install

Using this code via docker

docker pull votca/votca
docker run -it votca/votca /bin/bash

More detailed information:

  1. Installation
  2. Further Information
  3. Developers Guide
  4. VOTCA_LANGUAGE_GUIDE
  5. Code of Conduct

You find the VOTCA-CTP repository here

License:

Copyright 2009-2023 The VOTCA Development Team (http://www.votca.org)

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

xtp's People

Contributors

alexander-malafeev avatar b2bagher avatar baumeier avatar codacy-badger avatar crionez avatar felipez avatar floaltvater avatar gtirimbo avatar jameskirkpatrick avatar jenswehner avatar jenswehnerteaching avatar joshuasbrown avatar junghans avatar majklikikik avatar nicorenaud avatar onurcaylak avatar pmadhikar avatar rhalver avatar rubengerritsen avatar votca-bot avatar yoaruo avatar zetadin 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

Watchers

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

xtp's Issues

Extra constraints in partial charge fit

Partial charge fit needs additional extra constraints:

  • single charge to a fixed value
  • group of charges to a fixed value
  • single/group of charges identical to other single/group of charges

Geometry optimizer

Review BFGS-TRM implementation, add plain BFGS, state filter based on wave function or density matrix.

v1.4.1 fails with gcc-7

[  959s] [ 61%] Building CXX object src/libxtp/CMakeFiles/votca_xtp.dir/qmpackages/gaussian.cc.o
[  959s] cd /home/abuild/rpmbuild/BUILD/xtp-1.4.1/build/src/libxtp && /usr/bin/c++  -Dvotca_xtp_EXPORTS -I/home/abuild/rpmbuild/BUILD/xtp-1.4.1/build/include -I/home/abuild/rpmbuild/BUILD/xtp-1.4.1/include -I/home/abuild/rpmbuild/BUILD/xtp-1.4.1/build/src/libxtp  -fomit-frame-pointer -fmessage-length=0 -grecord-gcc-switches -O2 -Wall -D_FORTIFY_SOURCE=2 -fstack-protector-strong -funwind-tables -fasynchronous-unwind-tables -fstack-clash-protection -g -DNDEBUG -fopenmp -O1 -fPIC   -std=gnu++11 -o CMakeFiles/votca_xtp.dir/qmpackages/gaussian.cc.o -c /home/abuild/rpmbuild/BUILD/xtp-1.4.1/src/libxtp/qmpackages/gaussian.cc
[  965s] /home/abuild/rpmbuild/BUILD/xtp-1.4.1/src/libxtp/qmpackages/gaussian.cc: In member function 'virtual bool votca::xtp::Gaussian::ParseLogFile(votca::xtp::Orbitals*)':
[  965s] /home/abuild/rpmbuild/BUILD/xtp-1.4.1/src/libxtp/qmpackages/gaussian.cc:1150:43: error: call of overloaded 'advance(std::__cxx11::list<std::__cxx11::basic_string<char> >::iterator&, int)' is ambiguous
[  965s]                      advance(coord_block, 3);

Details here

Appropriate Rate Equation for Capturing Metallic to Hopping transitition, as well as adiabatic to diabatic transition

Causes of Localization
To consider localized vs delocalized transport and or band like/hopping transport we need to identify the mechanisms that are responsible for localization. These include:

  1. Thermal localization, a result of decoherence of the wavefunction as a result of scattering
  2. Geometrical localization, structural molecular considerations like 90 degree angles between conjugated rings that significantly reduce the electronic coupling.
  3. Polaronic considerations, these include the rearrangement of a molecule and the surrounding medium to lower the energy of the system and result in an energetic barrier.

A complete model should be able to consider all of these criteria seamlessly.

For a polaronic model to apply the charge must:
o become localized on a small number of sites
o overcome an energy barrier to move from the initial to the final state
a. in a perfect periodic crystal the existence of a barrier is dependent on the interplay between reorganization energy and electronic coupling.
b. for a small polaron to form:
H_ab <= 1/2 lambda
where H_ab - is the charge transfer integral (electronic coupling)
lambda - is the reorganization energy

Bug in the xyz reader

Hi,

I found a small bug in the xyz reader (file xtp/src/tools/Md2QmEngine.cc, function Md2QmEngine::getIntCoords). The actual reader cannot handle correctly xyz file with comments in the second line. For example

5
Lattice="29.823 0.0 14.9115 0.0 29.823 14.9115 0.0 0.0 21.0881" Properties=species:S:1:pos:R:3 pbc="T T T"
C      22.35000000      22.36000000      10.54000000 
H      22.54000000      22.69000000      11.55000000 
H      22.37000000      21.28000000      10.52000000 
H      21.41000000      22.73000000      10.12000000 
H      23.17000000      22.78000000       9.99000000

A simple solution could be to just ignore the second line since there is no need to read it. I implemented the correction in a fork mbarbry@dbdbebd Do you have some particular rules before that I open a merge request?

Best regards,
Marc Barbry

Running gwbse calculations

Hi,

I'm a new user of Votca-XTP. I managed to run edft and idft calculations using the DFT packages nwchem and obtained the transfer integral. Now I would like to use the gwbse module of xtp in order to obtain more accurate HOMO/LUMO energies. However, I could find only very little documentation on this module and I don't have any clues how to run such calculations. Does there is some examples somewhere? Could you provide me some guideline?

Thanks in advance,
Marc Barbry

xjobwriter H-bonds

For some QM/MM applications, it is important to include also H-bonded solvent molecules in the QM region. Automatic generation of such a list of segments is desired, but I think it requires additional information about segment-internal bond structure.

Fix clang-4 warnings

With clang-4 I get:

[ 94%] Building CXX object xtp/src/libxtp/CMakeFiles/votca_xtp.dir/qmpackages/nwchem.cc.o
cd /home/votca/votca/build/xtp/src/libxtp && /usr/lib64/ccache/clang++  -DBOOST_UBLAS_NDEBUG -DGWBSE_DOUBLE=0 -Dvotca_xtp_EXPORTS -I/home/votca/votca/build/xtp/include -I/home/votca/votca/xtp/include -I/home/votca/votca/tools/include -I/home/votca/votca/build/tools/include -I/home/votca/votca/csg/include -I/home/votca/votca/moo/include -I/home/votca/votca/ctp/include -I/home/votca/votca/build/xtp/src/libxtp  -O2 -DNDEBUG -fPIC   -std=c++11 -o CMakeFiles/votca_xtp.dir/qmpackages/nwchem.cc.o -c /home/votca/votca/xtp/src/libxtp/qmpackages/nwchem.cc
In file included from /home/votca/votca/xtp/src/libxtp/qmpackages/nwchem.cc:22:
In file included from /home/votca/votca/xtp/include/votca/xtp/qminterface.h:36:
In file included from /home/votca/votca/xtp/include/votca/xtp/espfit.h:24:
/home/votca/votca/xtp/include/votca/xtp/elements.h:83:42: warning: comparison of unsigned expression >= 0 is always true [-Wtautological-compare]
        for ( unsigned i=temp.size2()-1;i>=0;i-- ){
                                        ~^ ~
1 warning generated.

Auto Generate Segments.xml File

It would be nice to automatically generate this file, as it is a major pain for the user. Especially as the molecular systems become more complex. A safe first step would be to consider each molecule a fully conjugated segment. In terms of determining the rigid fragments this can be achieved by looking for rings, fused rings or single carbon chains of ~ 2 atoms.

image
image
image

Determination of which combination of rigid fragments constitutes a single conjugated segment... is a little more complicated. One first step would be to look at the charge transfer integral between each rigid fragment. We would have to look at the charge transfer integrals of all the energy relevant energy levels which may not just consist of the HOMO.

QM/MM energy (output)

At least in a non-polarized one-step QMMM calculation, the MM energies are not reasonable:

Example 1: Actually without any segments in MM1/MM2:
T00 ... ... Summary - iteration 1:
T00 ... ... ... QM Size = 16 atoms
T00 ... ... ... E(QM) = -2.639952442e+03
T00 ... ... ... E(GWBSE) = +4.976300666e+00
T00 ... ... ... E(SF) = +0.000000000e+00
T00 ... ... ... E(FM) = +0.000000000e+00
T00 ... ... ... E(MM) = +1.398043276e-76
T00 ... ... ... E(QMMM) = -2.634976141e+03

Example 2: With cutoff1=0 (no segments in polarizable shell), cutoff2=1nm:

  • same as above?

Example 3: With cutoff1=0.5nm and cutoff2=1nm but polarization switched off (effectively the same as example 2)

  • dito

Example 4: As Example 3 but with polarization switched on

  • dito

I guess some reporting/interface has been changed. But where?

mps file defaults in xstateserver

mps.tab written by stateserver has as defaults MP_FILES/"moleculename"_k.mps (k=n,e,h) from its use in charge transport.

  1. Better to take the MPS file <multipoles_k> given in mapping file (if defined). Right now it turns into a sed exercise.
  2. Is the default to list (n,e,h) really required and if so for what?
    [3) Why are we having that file anyways? First we make that mapping file to fill the SQL file also with the MPS instructions, then write the MPS table to file, and upon xqmmm (or other) which accesses the SQL file anyways, we also read the same info from file? Maybe I'm not seeing the reason.]

Undescriptive error message when trying to install xtp without gromacs

I tried re-installing votca while gromacs was not yet installed. I could install csg just fine. When I tried to install xtp, I got the error message below.

The error message I got when making the make files for xtp:

-- Checking for module 'libvotca_csg'
--   Found libvotca_csg, version 1.5-dev
-- Found VOTCA_CSG: /home/yoar/votca/lib/libvotca_csg.so  
-- Looking for VotcaCsgFromC in /home/yoar/votca/lib/libvotca_csg.so
-- Looking for VotcaCsgFromC in /home/yoar/votca/lib/libvotca_csg.so - not found
CMake Error at CMakeModules/FindVOTCA_CSG.cmake:45 (message):
  Could not find VotcaCsgFromC in /home/yoar/votca/lib/libvotca_csg.so, take
  look at the error message in
  /home/yoar/votca/src/xtp/CMakeFiles/CMakeError.log to find out what was
  going wrong.  If you don't have pkg-config installed you will most likely
  have to set VOTCA_CSG_LIBRARY by hand, which set votca_csg lib it's
  dependencies (i.e.
  -DVOTCA_CSG_LIBRARY='/path/to/libvotca_csg.so;/path/to/libgsl.so;/path/to/libm.so')
  !
Call Stack (most recent call first):
  CMakeLists.txt:135 (find_package)


-- Configuring incomplete, errors occurred!
See also "/home/yoar/votca/src/xtp/CMakeFiles/CMakeOutput.log".
See also "/home/yoar/votca/src/xtp/CMakeFiles/CMakeError.log".

Boost version w boost::filesystem

There is a problem with boost 1.53 and the boost::filesystem

../libxtp/libvotca_xtp.so.5: undefined reference to `boost::filesystem::detail::copy_file(boost::filesystem::path const&, boost::filesystem::path const&, boost::filesystem::copy_option, boost::system::error_code*)'
collect2: error: ld returned 1 exit status
make[2]: *** [src/tests/unit_test_glink] Error 1
make[1]: *** [src/tests/CMakeFiles/unit_test_glink.dir/all] Error 2
make[1]: *** Waiting for unfinished jobs....
../libxtp/libvotca_xtp.so.5: undefined reference to `boost::filesystem::detail::copy_file(boost::filesystem::path const&, boost::filesystem::path const&, boost::filesystem::copy_option, boost::system::error_code*)'
collect2: error: ld returned 1 exit status
make[2]: *** [src/tests/unit_test_atom] Error 1
make[1]: *** [src/tests/CMakeFiles/unit_test_atom.dir/all] Error 2
[ 89%] Linking CXX executable unit_test_aobasis
../libxtp/libvotca_xtp.so.5: undefined reference to `boost::filesystem::detail::copy_file(boost::filesystem::path const&, boost::filesystem::path const&, boost::filesystem::copy_option, boost::system::error_code*)'
collect2: error: ld returned 1 exit status
make[2]: *** [src/tests/unit_test_aobasis] Error 1
make[1]: *** [src/tests/CMakeFiles/unit_test_aobasis.dir/all] Error 2
make: *** [all] Error 2

Either the copy command needs to be replaced with something else: either a home made file copy command/ or a call to the enviornment cp command, or the requirements on the boost version should be updated.

dftengine in xqmmm

xqmmm uses qmmachine, which is templated to QMPackage.
To use our dftengine, we could register it as a QMPackage with dummy implementations, e.g. for ParseLogfile() and the like.
Better options?

_state_index and overlap

In the routine Iterate of qmmachine.cc, there is an issue with the vector _state_index.
This vector will have a size different than 1 only if the option overlap is set to True.
However, at the end of _do_gwbse, the routine tries to access to different part of the vector _state_index. For example,

_state_index[_state - 1  - orb_iter_input.getGWAmin()]

and _state - 1 - orb_iter_input.getGWAmin() seems to get values different than 0 even if the option overlap is set to False. And I get some segfault since its try to access to not allocated part of the vector. I guess that the index should be set to 0 if the option overlap is set to False.

Automate Identification of Rigid Fragments

Currently, each molecular fragment is custom defined. Automating this process would greatly improve the user friendliness of running calculations with larger polymer chains.

  1. The criteria we will use to define rigid fragments will be based on the bond structure.
    2.a Examples: Take for instance a polymer chain such as P3HT. The thiophene rings are rigid while the single bond connecting the rings has a torsional degree of freedom.
    thiophenerings
    2.b In an alternating single double bond segment we will consider a single bond double bond pair as a rigid fragment.
    alternatingbonds
    2.c In complex molecules we will look for fused ring structures.
    carbonpolymer
  2. The algorithm to do this will make use of graph theory and will explore a molecule by looking at each atom with 3 or more bonds.
  3. These atoms will be used as starting points.
  4. Each bond associating with the starting point will be considered a branch
  5. If one branch interacts with another branch at a point other than at a starting point the point of contention is recorded.
  6. Once the branches have been completely explored the points of contention are addressed, a point of contention means that a ring or loop must exist connecting the two branches. The two branches will be merged into a single branch.
  7. When the merges are complete the remaining branches will be split up into unique segments.
  8. The same process will be repeated on these unique segments until each of the atoms with 3 or more bonds has been explored and the segments can no longer be broke into smaller subsections.
  9. The final step will seek to identify segments that are the same/repeat.
  10. It should be enough at this point to create the appropriate input file for VOTCA.
  11. Where the next step would be to determine, to be consistent in my language, the conjugated segments exist in the molecule by calculating the electronic transfer integrals.

Fix compilation warning in hdf5

Warning:

xtp/include/votca/xtp/checkpointwriter.h:88:41: warning: narrowing conversion of ‘((const Eigen::EigenBase<Eigen::Matrix<double, -1, 1> >*)(& matrix))->Eigen::EigenBase<Derived>::rows<Eigen::Matrix<double, -1, 1> >()’ from ‘Eigen::EigenBase<Eigen::Matrix<double, -1, 1> >::Index {aka long int}’ to ‘hsize_t {aka long long unsigned int}’ inside { } [-Wnarrowing]
                           matrix.cols()};  // eigen vectors are n,1 matrices
                                        ^
xtp/include/votca/xtp/checkpointwriter.h:88:41: warning: narrowing conversion of ‘((const Eigen::EigenBase<Eigen::Matrix<double, -1, 1> >*)(& matrix))->Eigen::EigenBase<Derived>::cols<Eigen::Matrix<double, -1, 1> >()’ from ‘Eigen::EigenBase<Eigen::Matrix<double, -1, 1> >::Index {aka long int}’ to ‘hsize_t {aka long long unsigned int}’ inside { } [-Wnarrowing]
xtp/include/votca/xtp/checkpointwriter.h: In instantiation of ‘void votca::xtp::CheckpointWriter::WriteData(const CptLoc&, const Eigen::MatrixBase<Derived>&, const string&) [with T = Eigen::Matrix<double, -1, -1>; votca::xtp::CptLoc = H5::Group; std::__cxx11::string = std::__cxx11::basic_string<char>]’:
xtp/include/votca/xtp/checkpointwriter.h:43:9:   required from ‘typename std::enable_if<(! std::is_fundamental<_Tp>::value)>::type votca::xtp::CheckpointWriter::operator()(const T&, const string&) [with T = Eigen::Matrix<double, -1, -1>; typename std::enable_if<(! std::is_fundamental<_Tp>::value)>::type = void; std::__cxx11::string = std::__cxx11::basic_string<char>]’
xtp/src/libxtp/orbitals.cc:639:54:   required from here
xtp/include/votca/xtp/checkpointwriter.h:88:41: warning: narrowing conversion of ‘((const Eigen::EigenBase<Eigen::Matrix<double, -1, -1> >*)(& matrix))->Eigen::EigenBase<Derived>::rows<Eigen::Matrix<double, -1, -1> >()’ from ‘Eigen::EigenBase<Eigen::Matrix<double, -1, -1> >::Index {aka long int}’ to ‘hsize_t {aka long long unsigned int}’ inside { } [-Wnarrowing]
xtp/include/votca/xtp/checkpointwriter.h:88:41: warning: narrowing conversion of ‘((const Eigen::EigenBase<Eigen::Matrix<double, -1, -1> >*)(& matrix))->Eigen::EigenBase<Derived>::cols<Eigen::Matrix<double, -1, -1> >()’ from ‘Eigen::EigenBase<Eigen::Matrix<double, -1, -1> >::Index {aka long int}’ to ‘hsize_t {aka long long unsigned int}’ inside { } [-Wnarrowing]

State identification in numerical forces

  • needed for gradients of excited states which are energetically close

  • similar to QM/MM state following, could be overlap based or density matrix based

  • for approximate spectra evaluation, add gradient mode that calculates all gradients (no extra effort, since spectrum is available in numerical grads for all states at the same time), but no opt, see @gtirimbo 's approach

Implement Charge Patching Method

It remains difficult to run QC calculations on large molecules such as conjugated polymers. It is is near impossible to do this with a system of polymers. In order to address this problem we will be implementing a version of the Charge Patching Method originally described by Lin-Wang Wang in 2002 and Lin-Wang Wang and Nenad Vukirmov in 2008.

A description of this method as I understand it is outlined below:

Step 1 A molecule is chosen
Step 2 The bond structure of each atom is identified. Every unique bond structure pattern forms a unique motif. If two atoms share the same bond structure they can be modeled with the same motif.
E.g. Pentane can be described as a 5 carbon molecule with a total of two carbon motifs.
o The first motif consists of a carbon with 3 hydrogen bonds and 1 carbon bond.
o The second motif consists of a carbon atom with 2 hydrogen bonds and 2 carbon bonds
Step 3 one the motifs have been identified they are run with a scf QC method to determine the charge density.
Step 4 The charge density of the target atom is extracted from the motif.
o This is done by using for instance an spherical exponential function originating at the position of the target atom.
o The charge density associated with the target atom is weighted by the exponential function (function choice is somewhat arbitrary).
Step 5 At this point we will have the charge densities of the individual atoms with consideration given to their bond structure. We will proceed to determine the charge density of the polymer system or large molecule by appropriately adding the charge densities to resemble the whole molecule.

Final Notes:
To increase the accuracy of the calculation consideration of deviations in the bond angles can be taken into account. Thus for a given bond structure motif, we could proceed to execute extra scf QC calculations by altering the bond angles or distances. Interpolation between the different calculations be used to calculate the density even with slight deviations.

Warning:
It is important to consider that the densities calculated using this method assume localization. A strongly delocalized molecule will need to be subject to further corrections... perhaps by considering larger motifs . Furthermore, if external fields play a dominant role their effects will also need to be considered.

HDF Matrix Readin is flawed

For quadratic matrices hdf5 read in and readout is accurate but columns and rows are exchanged.
For non quadratic matrices the data is the read in incorrectly.

It is also read out in the same incorrect way. So for checkpointing it is not problematic but for reading out the hdf5 file with python or so it is.

Example is qpert from GW calculations

Implement hdf5 error handling

Hdf5 related code simply crashes now if it tries to read non-existing data or overwrite existing data. Proper error handling should be implemented.

QMMM: nwchem - options

It seems that to be able to use nwchem with QMMM, the option

set bq background

must be present. However, if the option is missing, no error messages are printed and the program get stuck into a while loop (it seems). At least nwchem calculations fail since the molecule geometry is not written in the input file.

A line checking if _write_charges is true would be necessary.

ORCA parser does not detect failed calculation

Not successful (= not converged) calculations such as

     ************************************************************
      *                     SERIOUS PROBLEM IN SOSCF             *
      *                     ------------------------             *
      *            HUGE, UNRELIABLE STEP WAS ABOUT TO BE TAKEN   *
      *                         ABORTING THE RUN                 *
      ************************************************************

are reported as COMPLETE.

HDF5 orb file

What savefile should contain

of external charges

bool APEorNot
number of alpha electrons
number of beta electrons
alpha/beta MOs reordert in xtp
alpha/beta MOEnergies
qm_atoms
TotalGSEnergy
Basisset name and object
ECP name and object
Vxc
Functional name
frac of EXX
Original qmpackage name
GW pert energies
GW diag energies and states
GW aux basisset name and object
BSE S/T Energies
BSE S/T Coefficients
BSE S/T AR_Coefficients
BSE Hamiltionian parts

maybe:
Fragment pops
Transition dipoles

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.