Skip to content

library for performing a cluster expansion fitting with PyTorch

Notifications You must be signed in to change notification settings

jwjeffr/cluster_expansion_pytorch

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

25 Commits
 
 
 
 
 
 

Repository files navigation

Cluster Expansion Fitting Using PyTorch

The goal of the cluster expansion is to fit energy data to some Hamiltonian (using the Einstein summation convention):

$$\mathcal{H} = N_{\alpha\beta n}u_{\alpha\beta n}$$

where $N_{\alpha\beta n}$ is the number of $\alpha$-$\beta$ bonds in the $n$'th neighbor shell and $u_{\alpha\beta n}$ is the $\alpha$-$\beta$ interaction at the $n$'th nearest neighbor distance. Note that Greek letters index atom types.

We can count the number of bonds by occupation matrices $x_{i\alpha}$, where:

$$x_{i\alpha} = \begin{cases} 1 & \text{site $i$ occupied by $\alpha$} \\ 0 & \text{else} \end{cases}$$

Then, the Hamiltonian is:

$$\mathcal{H} = \frac{1}{2}u_{\alpha\beta n}A_{ijn} x_{i\alpha} x_{j\beta}$$

where $A$ is defined by:

$$A_{ijn} = \begin{cases} 1 & \text{sites $i$ and $j$ are $n$'th nearest neighbors} \\ 0 & \text{else} \end{cases}$$

Note that $u_{\alpha\beta n}$ is intensive, and therefore can be used on a larger lattice with a larger adjacency tensor.

This repository contains a library (cluster_expand.py) and an example mixed Lennard Jones solid calculation using the library (cluster_expansion_example.ipynb).

The library uses PyTorch and cooper to fit $u_{\alpha\beta n}$ in terms of configuration matrices and energies with an input adjacency tensor.

  • PyTorch is used to create a Model class and accelerate the tensor operations and optimization
  • Cooper is used to constrain the optimization such that $u_{\alpha\beta n} = u_{\beta\alpha n}$

About

library for performing a cluster expansion fitting with PyTorch

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published