Skip to content

Commit

Permalink
fix rendering of readme
Browse files Browse the repository at this point in the history
  • Loading branch information
jochym committed Dec 8, 2023
1 parent 8dae5a1 commit 5ebb812
Showing 1 changed file with 2 additions and 30 deletions.
32 changes: 2 additions & 30 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,14 +1,6 @@
# HECSS

::: {.cell 0=‘h’ 1=‘i’ 2=‘d’ 3=‘e’}

``` python
from nbdev import *
```

:::

> High Efficiency Configuration Space Sampler
<!-- WARNING: THIS FILE WAS AUTOGENERATED! DO NOT EDIT! -->

HECSS is a Monte-Carlo, configuration space sampler using sample
weighting algorithm for probability distribution sampling. It provides
Expand Down Expand Up @@ -44,42 +36,32 @@ 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 @@ -88,24 +70,14 @@ 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)
```

<div class="cell-output cell-output-display">

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

</div>

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

## Install

Expand Down

0 comments on commit 5ebb812

Please sign in to comment.