/awesome-quantum-chemistry

Quantum Chemistry is awesome. Throw your textbook in the garbage, light the garbage can on fire, and blend the ashes into your cold brew almond milk latte and read this.

Primary LanguagePythonMIT LicenseMIT

Awesome Quantum Chemistry

A curated list of awesome quantum chemistry frameworks, libraries, software and resources.

chemistry

Textbooks on Cheminformatics & Quantum Chemistry strangle the subject to sleep 😴 and command a wild price 🤑 for the naps they induce.

Want a better way to learn than some random repo on github?

Spend 4-12 years of your life and hundreds of thousands of dollars chasing a paper with a stamp on it 🥇.

Or feed yourself 🍼.

Information should be cheap, fast enjoyable, silly, shared, disproven, contested, and most of all free.

Knowledge hodlers, and innovation stifflers are boring and old. This is for the young chemists of mind and spirit 🚼 that are looking for cheap ways to mine gold.

Tools

DeepQMC/PauliNet

Deep-learning quantum Monte Carlo for electrons in real space

FermiNet

Implementation of the Fermionic Neural Network for ab-initio electronic structure calculations

Hande

Highly parallel code for stochastic quantum chemistry. Can be used as standalone program or library from an existing quantum chemistry code.

PySCF

Simple, lightweight, and efficient python platform for quantum chemistry calculations and methodology development.

PSi4

Suite of ab initio quantum chemistry programs designed for efficient, high-accuracy simulations of molecular properties

QMCTorch

Pytorch Implementation of Real Space Quantum Monte Carlo Simulations of Molecular Systems

NWChem

Machine Learning the Schrodinger Equation

source

Solving the Quantum Many-Body Problem with Artificial Neural Networks (2016)

In principle, an exponential amount of information is needed to fully encode a generic many-body quantum state.

However, Nature often proves herself benevolent, and a wave function representing a physical many-body system can be typically characterized by an amount of information much smaller than the maximum capacity of the corresponding Hilbert space. A limited amount of quantum entanglement, as well as the typicality of a small number of physical states, are then the blocks on which modern approaches build upon to solve the many-body Schrödinger’s equation with a limited amount of classical resources.

FermiNet

FermiNet is the implementation of the (2020) paper "Ab-Initio Solution of the Many-Electron Schroedinger Equation with Deep Neural Networks"

It is a neural network for learning the ground state wavefunctions of atoms and molecules using a variational Monte Carlo approach.

Setup.py

FermiNet's setup file has some key dependencies that give us a peek into what is going on:

Base Config.py

The base_config.py file lets the user set the system and hyperparameters.

enum

The code begins:

import enum
import ml_collections
from ml_collections import config_dict

Simmilar to enums in to C++ 11:

// color may be red (value 0), yellow (value 1), green (value 20), or blue (value 21)
enum color
{
    red,
    yellow,
    green = 20,
    blue
};

Python enums introduced in >= python 3.4 are a set of symbolic names (members) bound to unique, constant values:

class NBA_ORG_RANKING(Enum):
  CELTICS = 7
  JAZZ = 4
  KNICKS = 31
  NETS = 1

FermiNet instantiates classes using enum. The code continues:

class SystemType(enum.IntEnum):
  MOLECULE = 0

IntEnum creates enumerated constants that are also subclasses of the int class.

"Members of an IntEnum can be compared to integers; by extension, integer enumerations of different types can also be compared to each other...However, they can’t be compared to standard Enum enumerations:

from enum import Enum
from enum import IntEnum

class Knicks(IntEnum):
  RANDLE = 1
  BARRETT = 2
  NTILIKINA = 3

class Nets(Enum):
  DURANT = 1
  IRVING = 2
  HARDEN = 3

print(Knicks.RANDLE == Nets.DURANT)
>> False

@classmethod decorator

The code continues:

class SystemType(enum.IntEnum):
  MOLECULE = 0

  @classmethod
  def has_value(cls, value):
    return any(value is item or value == item.value for item in cls)

The @classmethod decorator:

"...take a cls parameter that points to the class—and not the object instance—when the method is called." source

"Because the class method only has access to this cls argument, it can’t modify object instance state. That would require access to self. However, class methods can still modify class state that applies across all instances of the class." source

What we have here is the factorymethod design pattern.

chaplin

class Nets:
  def __init__(self, skills):
    self.skills = skills

  def __repr__(self):
    return f'Nets({self.skills!r})'

  @classmethod
  def Joe_Harris(cls):
    return cls(['3Pts', 'drives'])

  @classmethod
  def Nic_Claxton(cls):
    return cls(['D', 'jams'])

print(Nets.Nic_Claxton())
print(Nets.Joe_Harris())

>> Nets(['D', 'jams'])
>> Nets(['3Pts', 'drives'])

In this example we can create new Players of the Nets class configured with the skills that we want them to have from a single init but many constructors. Now the class (cls) is the first argument rather than the instance of the class (self).

"Another way to look at this use of class methods is that they allow you to define alternative constructors for your classes. Python only allows one init method per class. Using class methods it’s possible to add as many alternative constructors as necessary." source

ml_collections ConfigDict

def default() -> ml_collections.ConfigDict:
  """Create set of default parameters for running qmc.py.
  Note: placeholders (cfg.system.molecule and cfg.system.electrons) must be
  replaced with appropriate values.
  Returns:
    ml_collections.ConfigDict containing default settings.
  """

Default returns a mlcollections.ConfigDict

ConfigDict...is a "dict-like" data structure with dot access to nested elements...Supposed to be used as a main way of expressing configurations of experiments and models.

References

(2021) QUANTUM MONTE-CARLO INTEGRATION: THE FULL ADVANTAGE IN MINIMAL CIRCUIT DEPTH

(2021) A MLIR Dialect for Quantum Assembly Languages

(2020) "Ab-Initio Solution of the Many-Electron Schroedinger Equation with Deep Neural Networks" - FermiNet

(2020) Deep neural network solution of the electronic Schrödinger equation - PauliNet

(2020) Variational Principles in Quantum Monte Carlo: The Troubled Story of Variance Minimization

(2020) Fermionic neural-network states for ab-initio electronic structure

(2020) Data Driven Science & Engineering:Machine Learning, Dynamical Systems and Control

(2020) Better, Faster Fermionic Neural Networks

(2019) Quantum Entanglement in Deep Learning Architectures

(2019) Solving Many-Electron Schrodinger Equation Using Deep Neural Networks

(2019) Variational neural network ansatz for steady states in open quantum systems

(2019) Variational Quantum Monte Carlo Method with a Neural-Network Ansatz for Open Quantum Systems

(2018) Quantum Chemical Approaches in Structure-Based Virtual Screening and Lead Optimization

(2016) Solving the Quantum Many-Body Problem with Artificial Neural Networks

(2015) Optimizing Neural Networks with Kronecker-factored Approximate Curvature

(2006) MontePython: Implementing Quantum Monte Carlo using Python