Skip to content

Commit

Permalink
Regenerate readme
Browse files Browse the repository at this point in the history
  • Loading branch information
jochym committed Dec 8, 2023
1 parent 0b785df commit 8dae5a1
Show file tree
Hide file tree
Showing 5 changed files with 36 additions and 25 deletions.
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -165,3 +165,5 @@ checklink/cookies.txt

# Quarto
.quarto

/.quarto/
37 changes: 32 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,15 +1,22 @@
HECSS
================
# HECSS

<!-- WARNING: THIS FILE WAS AUTOGENERATED! DO NOT EDIT! -->
::: {.cell 0=‘h’ 1=‘i’ 2=‘d’ 3=‘e’}

``` python
from nbdev import *
```

:::

> High Efficiency Configuration Space Sampler
HECSS is a Monte-Carlo, configuration space sampler using sample
weighting algorithm for probability distribution sampling. It provides
an alternative way to create representations of systems at thermal
equilibrium without running a very expensive molecular dynamics
simulation. The theoretical foundation of the code are presented in the
section [Background](00_Background.html) in the
[Documentation](https://jochym.gitlab.io/hecss/). More detailed examples
[Documentation](https://jochym.github.io/hecss/). More detailed examples
are included in the [LAMMPS](01_LAMMPS_Tutorial.html) and
[VASP](01_VASP_Tutorial.html) tutorials.

Expand Down Expand Up @@ -37,32 +44,42 @@ OpenKIM database. Here we will sample the thermodynamic distribution of
the crystal and energy/forces calculator, run the sampler and finally
plot the energy distribution.

::: {.cell 0=‘a’ 1=‘s’ 2=‘a’ 3=‘p’}

``` python
from hecss import HECSS
from hecss.util import select_asap_model, create_asap_calculator
from hecss.monitor import plot_stats
from ase.build import bulk
```

:::

Then we define the crystal and interaction model used in the
calculation. In this case we use 3x3x3 supercell of the SiC crystal in
zincblende structure and describe the interaction using LAMMPS potential
from the OpenKIM database and ASAP3 implementation of the calculator.

::: {.cell 0=‘a’ 1=‘s’ 2=‘a’ 3=‘p’}

``` python
model = select_asap_model('SiC')
cryst = bulk('SiC', crystalstructure='zincblende',
a=4.38120844, cubic=True).repeat((3,3,3))
cryst.set_calculator(create_asap_calculator(model))
```

:::

Then we define the sampler parameters (N – number of samples, T –
temperature) and run it. The parameter with the `lambda` anonymous
function is required in this case, due to the peculiarities of the ASAP
implementation of the ASE calculator which cannot be re-used when the
sampler is re-executed. This construct is probably not required for
other calculators.

::: {.cell 0=‘a’ 1=‘s’ 2=‘a’ 3=‘p’}

``` python
T = 300
N = 100
Expand All @@ -71,14 +88,24 @@ samples = hecss.sample(T, N)
distrib = hecss.generate(samples, T)
```

:::

And finally we plot the histogram of the resulting energy distribution
which corresponds to the thermal equilibrium distribution.

::: {.cell 0=‘a’ 1=‘s’ 2=‘a’ 3=‘p’}

``` python
plot_stats(distrib, T, sqrN=True)
```

![](index_files/figure-gfm/cell-5-output-1.png)
<div class="cell-output cell-output-display">

![](index_files/figure-commonmark/cell-6-output-1.png)

</div>

:::

## Install

Expand Down
2 changes: 1 addition & 1 deletion index.ipynb

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion nbdev.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,4 +6,4 @@ website:
site-url: "https://jochym.github.io//hecss/"
description: "High Efficiency Configuration Space Sampler"
repo-branch: devel
repo-url: "https://gitlab.com/jochym/hecss/-/"
repo-url: "https://github.com/jochym/hecss/"
18 changes: 0 additions & 18 deletions sidebar.yml

This file was deleted.

0 comments on commit 8dae5a1

Please sign in to comment.