Giter VIP home page Giter VIP logo

diffiqult's Introduction

DiffiQult

DiffiQult is an open source autodifferentiable Quantum Chemistry package, that optimized RHF energies of small molecules with respect of the parameters a given intial the basis function. It generates energy gradients with automatic differentiation tools.

Getting started with DiffiQult

Requirements

Installation

  • From source:

    git clone https://github.com/ttamayo/DiffiQult.git

    python setup.py install

Usage

Molecular system

We define the molecular systems by creating an object of the class System_mol, where we specify the molecular geometry in atomic units, basis sets and number of electrons, optionally we can specify a tag. For example:


  # Basis set is sto_3G
  from diffiqult.Basis import basis_set_3G_STO as basis
     # Our molecule H_2
     d = -1.64601435
     mol = [(1,(0.0,0.0,0.20165898)),(1,(0.0,0.0,d))]
     
     # Number of electrons
     ne = 2
     system = System_mol(mol,                                ## Geometry
                         basis,                              ## Basis set (if shifted it should have the coordinates too)
                         ne,                                 ## Number of electrons
                         shifted=False,                      ## If the basis is going to be on the atoms coordinates 
                         mol_name='agua')                    ## Units -> Bohr

Tasks

The jobs in Diffiqult are managed by an Tasks object. For example, if we want to obtain a file with the results.

   manager = Tasks(system,
                name='h2_sto_3g',      ## Prefix for all optput files
                verbose=True)          ## If there is going to be an output

where we define the molecular system to optimize with system and output options with verbose.

The method Tasks.runtask computes one the following tasks:

Task Key Description
Single point energies Energy Calculate the RHF energy and update it in an attibute in system
Optimization Opt Optimize a given parameter and update the basis set in sytem

Single point calculation

To calculate the RHF of a molecule we use the option Energy, optionally we can produce a molden file with the information of the geometry, basis and MO.

        manager.runtask('Energy',
                     max_scf=50,                        # Maximum number of SCF cycles
                     printcoef=True,                    # This will produce a npy file with the molecular coefficients
                     name='Output.molden',              # Name of the output
                     output=True)

Notes:

  • It currently doesn't have convergence options for the SCF .
  • The molden file also contains an input section that can be used as input for system with the option shifted
  • The geometry and MOs can be vizualized with molden,and the molden file.

Optimization

To optimize one or many input parameters, we use the option ```Opt` ``, it updates the attributes of the molecular system object.

For example:


    manager.runtask('Opt',
                     max_scf=50,
                     printcoef=False,
                     argnum=[2],  # Optimization of centers
                     output=True) # We optimized all the steps

where argnum recieves a list with the parameters to optimize with the following convention:

Parameter argnum
Width 0
Contraction coefficients 1
Gaussian centers 2

For example, we can optimize the atomic centered basis function with respect of their widths and contraction coefficients in the following way.

 manager.runtask('Opt',
                     max_scf=50,
                     printcoef=False,
                     argnum=[0,1],  # Optimization of centers
                     output=True)   # We print a molden file of all steps

diffiqult's People

Contributors

ttamayo avatar

Watchers

 avatar  avatar

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.