Coder Social home page Coder Social logo

ragnarb83 / ash Goto Github PK

View Code? Open in Web Editor NEW
49.0 4.0 12.0 225.72 MB

ASH is a Python-based computational chemistry and QM/MM environment, primarily for molecular calculations in the gas phase, explicit solution, crystal or protein environment.

License: GNU General Public License v2.0

Python 98.24% Julia 1.14% Shell 0.62%
qm quantum mm python dft multiscale qm-mm

ash's Introduction

master: example workflow NEW: example branch parameter

drawing

ASH: a multi-scale, multi-theory modelling program

ASH is a Python-based computational chemistry and QM/MM environment for molecular calculations in the gas phase, explicit solution, crystal or protein environment. Can do single-point calculations, geometry optimizations, nudged elastic band calculations, surface scans, molecular dynamics, numerical frequencies and many other things using a MM, QM or QM/MM Hamiltonian. Interfaces to popular QM codes: ORCA, xTB, PySCF, MRCC, Psi4, Dalton, CFour, TeraChem, QUICK. Interface to the OpenMM library for MM and MD algorithms. Interfaces to specialized codes like Block, Dice and ipie for DMRG, SHCI and AFQMC calculations. Excellent environment for writing simple or complex computational chemistry workflows.

In case of problems: Please open an issue on Github and we will try to fix any problems as soon as possible.

Installation: See https://ash.readthedocs.io/en/latest/setup.html for detailed installation instructions. A proper ASH installation must usually be done in a conda/mamba environment.

Basic installation via pip:

#Install ASH using pip (default main branch)
pip install git+https://github.com/RagnarB83/ash.git

#Install the NEW (development) branch of ASH
pip install git+https://github.com/RagnarB83/ash.git@NEW

Documentation:

https://ash.readthedocs.io

Development:

ASH welcomes any contributions.

Ongoing priorities:

  • Improve packaging
  • Prepare for 1.0 release
  • Fix more Python faux pas
  • Write unit tests
  • Improve documentation of code, write docstrings.

Very basic example:

from ash import *

coords="""
H 0.0 0.0 0.0
F 0.0 0.0 1.0
"""
#Create fragment from multi-line string
HF_frag=Fragment(coordsstring=coords, charge=0, mult=1)
#Alternative: Create fragment from XYZ-file
#HF_frag2=Fragment(xyzfile="hf.xyz", charge=0, mult=1)

#Create ORCATheory object
input="! r2SCAN def2-SVP def2/J tightscf"
blocks="%scf maxiter 200 end"
ORCAcalc = ORCATheory(orcasimpleinput=input, orcablocks=blocks)

#Singlepoint calculation
Singlepoint(theory=ORCAcalc,fragment=HF_frag)

#Call optimizer
Optimizer(theory=ORCAcalc,fragment=HF_frag)

#Numerical frequencies
NumFreq(theory=ORCAcalc,fragment=HF_frag)

#Molecular dynamics calculation for 2 ps
OpenMM_MD(fragment=HF_frag, theory=ORCAcalc, timestep=0.001, simulation_time=2)

ash's People

Contributors

dockde avatar euhruska avatar ragnarb83 avatar zhujianwei31415 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  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

ash's Issues

Amber QM/MM docs fix

#Read coordinates from Amber INPCRD and PRMTOP FILES
elems,coords,boxdims=module_coords.read_ambercoordinates(prmtopfile=prmtopfile, inpcrdfile=inpcrdfile)
frag=Fragment(elems=elems,coords=coords, conncalc=False)

to be fixed

Docstrings

Need to write docstrings for pretty much everything

Polarizable QM/MM

To be looked into. Drude particle QM/MM should be straightforward.

xtb preoptimization

Add simple xtb preoptimization option that can be used in various places (benchmarking, thermochemprotocol, calc_xyzfiles etc.) Even if xtb-opt fails, use geometry still.

Best to just use xtb built-in optimizer. Add Opt method to xtBTheory.

Safires implementation

Should work together with ASE (to be tested more) but enforcing Rattle constraints in ASE-MD is too slow to be useful for fast MM MD or xTB/MM MD. Open_MM MD much faster but would require calling Safires step-by-step in loop. Discuss with BK.

openmm molcrys to openmm conversion bug

Introduced a bug at some point in openmm-basic-test.py and MD-cluster-openMMMD.py that converts from ASH forcefield file to OpenMM xml file:
openmmobject = OpenMMTheory(cluster_fragment=Cluster, ASH_FF_file=ff_file, platform='CPU')

Error message:

Traceback (most recent call last):
  File "/Users/bjornsson/ownCloud/ASH-tests/testsuite/openmm-basic-test.py", line 12, in <module>
    openmmobject = OpenMMTheory(cluster_fragment=Cluster, ASH_FF_file=ff_file, platform='CPU')
  File "/Users/bjornsson/ASH/ash-dev/ash/interfaces/interface_OpenMM.py", line 549, in __init__
    self.system = self.forcefield.createSystem(self.topology, nonbondedMethod=openmm.app.NoCutoff,
  File "/Users/bjornsson/miniconda/envs/ASHnewv1/lib/python3.9/site-packages/openmm/app/forcefield.py", line 1206, in createSystem
    templateForResidue = self._matchAllResiduesToTemplates(data, topology, residueTemplates, ignoreExternalBonds)
  File "/Users/bjornsson/miniconda/envs/ASHnewv1/lib/python3.9/site-packages/openmm/app/forcefield.py", line 1420, in _matchAllResiduesToTemplates
    raise ValueError('No template found for residue %d (%s).  %s' % (res.index+1, res.name, _findMatchErrors(self, res)))
ValueError: No template found for residue 1 (RS0).  This might mean your input topology is missing some atoms or bonds, or possibly that you are using the wrong force field.

At least a bug present in the PDB-file that is created:

ATOM  1     R00  RS0      1     -2.630  -1.841   0.331  1.00  0.00      SEG B
ATOM  2     R01  RS0      1     -1.902   2.488   0.331  1.00  0.00      SEG B
ATOM  3     R02  RS0      1     -2.630  -2.488  -4.036  1.00  0.00      SEG B
ATOM  4     R03  RS0      1     -1.902   1.841  -4.036  1.00  0.00      SEG B
ATOM  5     R04  RS0      1      2.630   1.841  -0.331  1.00  0.00      SEG B
ATOM  6     R05  RS0      1      1.902  -2.488  -0.331  1.00  0.00      SEG B
ATOM  7     R06  RS0      1      2.630   2.488   4.036  1.00  0.00      SEG B
ATOM  8     R00  RS0      2      1.902  -1.841   4.036  1.00  0.00      SEG B
ATOM  9     R01  RS0      2     -4.031  -0.210   2.062  1.00  0.00      SEG C

Probably related

Highlevel workflows

Rewrite whole thing into classes and clean up.

  • - CC_CBS is the main one
  • - Also FCI_CBS
  • - Add F12 to CC_CBS
  • - Try and modularize as much as possible.
  • - Define a general class that we can use to define seperate W1, W1-F12, DLPNO-W1 versions etc.
  • More Aux/C choices. Currently using Autoaux-lmax
  • - Write tests
  • Restart feature in CC_CBS_Theory. Suggested by Heidar (16 jan)
  • Separate triples extrapolation, with/without PNO extrapolation.

OpenMM: Gromacsfile

Todo: Deal with CustomNonbondedforce problem

See: /home/bjornsson/ASH-openMM/FeFeH2ase-DDH-WT-QM_MM_MD/Gromacs-route

Improve OpenMM Modeller support for special residues

  • - Document how to easily create XML file for metal cofactor residue and use.
  • - Figure out the best way to support deprotonated cysteines (use CYX in PDB or use residue_variants)
  • - Other residue modifications
  • - Make sure residue numbering that OpenMM reports is understandable.

Benchmarking extensions

  • Extend benchmarking to molecular properties: Mössbauer isomer shifts, quadrupole couplings etc.
  • Add geometric benchmarking

Write Multiwfn interface

Support ORCA, Psi4 and MRCC WF files.

  • electron density Cube file
  • Hirshfeld charges spinpop
  • ORCA support
  • MRCC support
  • Other charges
  • Bond orders
  • Cleanup
  • Documentation

Optimization cleanup

Class-ify geometricoptimizer. For future TruncPC and micro-iterative opt projects.

Automatic HOMO-LUMO rotation feature

Add feature for ORCATheory that flips HOMO and LUMO for either alpha, beta or both.
Apply in beginning of job or after SCF convergence, i.e. add options for both. After SCF convergence is probably the more reliable version.

Fe atom works as good test system:
Fe-atom-IPs/CCSDT/HF-Fe0

Add testsuite

Integrate current testsuite into repository and figure out automatic testing

Plumed interface

  • Debug OpenMM-MD part.
  • Test behaviour of Plumed plugin on Linux vs. MacOS. Strange behaviour (rising temp) on Mac OS. Possible behaviour due to dynamics of ASE: ASE 3.22.0 vs, 3.21.1 ??
  • Test QM/MM metadynamics properly

MD-analyze-trajectory tools

Tools to analyze trajectory:

  • Reimage trajectory
  • RMSD for subset of atoms
    Probably best done via interface to Mdtraj or MDAnalysis.

Plotting:

  • Make png plot of temperature vs time. With/without running average
  • Same for RMSD and other

calc_xyzfiles: improvements

Further extend calc_xyzfiles.
Support high-level theory, frequency calculations (grab thermochem corrections), gather things in dictionary and the print the results in an ordered way.
Possibly combine with thermochemprotocol, highlevel workflows etc.

QM/MM

Need to figure out how to disable MM energy+forces for specific regions

actregiondefine

actregiondefine contains a bug (see BF's system) and needs to be rewritten

General cleanup

  • Remove old uncommented code
  • Remove unused variables
  • Remove duplicate versions of code (e.g. xyz-file read in module_coords)
  • Fix Python faux pas
  • Adhere to PEP8 style-guide (within reason)

ASH orcadir

  • Change so that if orcadir is not provided then ASH will find the orca binary in path and then set orcadir automatically.
  • Print warning and perhaps even test if it's a working correct binary (not orca screen reader). Make similar to xtb maybe?
  • Print warning about correct OpenMPI also. perhaps test mpirun command also.

molcrys: CIF

Compile list of molecules where reading CIF is not successful and try to fix those parsing bugs.
See VCO6 molecule.

Long project: MD

Write our own code for molecular dynamics so that we don't have to rely on ASE.

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.