Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
27 commits
Select commit Hold shift + click to select a range
f34ec92
On-the-fly training via AiiDA and FLARE :rocket:
bastonero Sep 8, 2023
8ec91e0
Merge branch 'examples/aiida' of https://github.com/bastonero/python-…
bastonero Sep 8, 2023
4a93dda
Fix logic for on-the-fly training
bastonero Sep 9, 2023
a64e3c1
Add on-the-fly examples :rocket:
bastonero Sep 9, 2023
f8d2b9d
Update testsuite yaml to perform tests using FLARE
bastonero Sep 9, 2023
2256e93
Improve on-the-fly
bastonero Dec 5, 2023
ee7488c
Merge branch 'master' of https://github.com/SSCHAcode/python-sscha in…
bastonero Jan 18, 2024
d1ae78b
Merge branch 'master' of https://github.com/SSCHAcode/python-sscha in…
bastonero Apr 3, 2024
3f9e922
Add submission in batches
bastonero Apr 4, 2024
8d145da
Add tweaks and examples
bastonero Apr 25, 2024
570a6d7
Spotting the infamous bug
bastonero May 7, 2024
511a479
Flush the stdout to avoid waiting aiida workchains
bastonero May 8, 2024
e85e810
Do not train hyperparameters if no DFT was done
bastonero May 8, 2024
8bcb779
Add `train_hyps` to the on-the-fly settings
bastonero Jun 19, 2024
e1edeb7
Trying to see if we fix the stress issue
bastonero Jun 20, 2024
5acc0d7
Fix little bug
bastonero Jun 20, 2024
ed837e0
Fix check on state of workchains to be `is_terminated`
bastonero Dec 19, 2024
7dc7654
Merge branch 'master' of https://github.com/SSCHAcode/python-sscha in…
bastonero Jan 20, 2026
7a2111a
Active-learning: new module and enhanced installation options
bastonero Jan 21, 2026
f9ae382
Examples: add realistic active learning examples
bastonero Jan 21, 2026
6eb1ce3
Examples: update active learning installation instructions
bastonero Jan 21, 2026
4aa3954
Add quasi-harmonic approximation scripts and notebooks
bastonero Apr 17, 2026
cd6779d
Merge branch 'master' of https://github.com/SSCHAcode/python-sscha in…
bastonero Apr 17, 2026
45977bc
Install mir-flare after installing BLAS library
bastonero Apr 17, 2026
3aceeac
Update protocol names
bastonero Apr 17, 2026
769ddc1
Fix example
bastonero Apr 17, 2026
0dc0b99
Remove unnecessary files and notebooks
bastonero Apr 19, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .github/workflows/python-testsuite.yml
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,7 @@ jobs:
run: |
sudo apt-get update
sudo apt-get install git gfortran libblas-dev liblapack-dev
pip install mir-flare
git clone https://github.com/SSCHAcode/CellConstructor.git
pip install meson meson-python ninja
cd CellConstructor
Expand Down
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,7 @@ frequencies*.*
timer.json
minim.dat
otf_run*
nohup.out
disp_*
_data_tmp_

Expand Down
44 changes: 37 additions & 7 deletions Examples/sscha_and_aiida/README.md
Original file line number Diff line number Diff line change
@@ -1,20 +1,31 @@
# Instructions

We provide here the script `run_aiida_sscha.py`, which performs a thermal expansion calculation using SSCHA and aiida-quantumespresso.
We provide here some scripts to run SSCHA using AiiDA, FLARE machine-learning potential, and a combination of the two as on-the-fly active learning.

It is preferable to execute the example that you already have some experience with both the SSCHA and AiiDA-QuantumEspresso codes. Nevertheless, you can try following the instructions and to run the example.
* `run_aiida_sscha.py`, which performs a thermal expansion calculation using SSCHA and aiida-quantumespresso.
* `run_flare_sscha.py`, which performs a thermal expansion calculation using SSCHA and FLARE machine-learning interatomic potential.
* `run_aiida_flare_sscha.py`, which performs an on-the-fly active learning SSCHA calculation using aiida-quantumespresso for DFT and FLARE as the ML potential.

It is preferable to execute the example that you already have some experience with both the SSCHA and AiiDA-QuantumESPRESSO codes. Nevertheless, you can try following the instructions and to run the example.

## Installation

We recommend to install all the packages via `mamba` (which is based on top of `conda`). After having installed `mamba`, you can simply run the following:
We recommend to install all the packages via `mamba` (which is based on `conda`). After having installed `mamba`, you can simply run the following:

```console
> mamba create -n aiida-sscha -c conda-forge python gfortran libblas lapack openmpi julia openmpi-mpicc pip numpy scipy spglib aiida-core
> pip install ase quippy-ase cellconstructor python-sscha aiida-quantumespresso aiida-pseudo
> mamba activate aiida-sscha
> mamba create -n sscha-aiida -c conda-forge python gfortran "blas=*=openblas" openblas lapack julia pip numpy scipy spglib pkg-config aiida-core
> pip install ase cellconstructor python-sscha aiida-quantumespresso aiida-pseudo
> mamba activate sscha-aiida
```
Then, you should configure an AiiDA profile and the pw.x code in order to use the example script (see also Prerequisites section).

Then, you should configure an AiiDA profile in order to use the example script (see also Prerequisites section).
For on-the-fly active learning you also need the FLARE package:

```console
> git clone --depth 1 https://github.com/mir-group/flare.git
> cd flare
> pip install .
```

## Prerequisites

Expand All @@ -23,6 +34,7 @@ You need to have installed in the same environment:
- `cellconstructor`
- `aiida-core`
- `aiida-quantumespresso`
- (optional, for active learning) `mir-flare`

For the AiiDA part, it is essential the dameon is running and you have:
1. Configured a computer where to run the code (e.g. on your own laptop; see `aiida-core` docs for further details)
Expand All @@ -33,6 +45,8 @@ Please refer to the aiida-core and aiida-quantumespresso for further installatio

## How-to run

### SSCHA with the aiida-quantumespresso interface

Open the `run_aiida_sscha.py` and change the data according to your needs and local installation. Then simply

```console
Expand All @@ -45,4 +59,20 @@ Usually an actual production run would take a while. We suggest to use instead
> nohup python run_aiida_sscha.py > run_aiida_sscha.log &
```

or a submit script at glance.

### On-the-fly active learning SSCHA with aiida-quantumespresso and FLARE interface

Open the `run_aiida_flare_sscha.py` and change the data according to your needs and local installation. Then simply

```console
> python run_aiida_flare_sscha.py > run_aiida_sscha.log
```

Usually an actual production run would take a while. We suggest to use instead

```console
> nohup python run_aiida_sscha.py > run_aiida_sscha.log &
```

or a submit script at glance.
56 changes: 56 additions & 0 deletions Examples/sscha_and_aiida/Si-dynamical-matrix1
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
Dynamical matrix file
File generated with the CellConstructor by Lorenzo Monacelli
1 2 0 1.8897259890000000 0.0000000000000000 0.0000000000000000 0.0000000000000000 0.0000000000000000 0.0000000000000000
Basis vectors
2.7154799999999999 2.7154799999999999 0.0000000000000000
2.7154799999999999 0.0000000000000000 2.7154799999999999
0.0000000000000000 2.7154799999999999 2.7154799999999999
1 'Si ' 25597.9124185021937592
1 1 -0.0000000000000004 0.0000000000000004 0.0000000000000004
2 1 1.3577400000000002 1.3577400000000006 1.3577400000000004

Dynamical Matrix in cartesian axes

q = ( 0.000000000000 0.000000000000 0.000000000000 )

1 1
0.2590944141379855 0.0000000000000000 0.0000000000000001 0.0000000000000000 -0.0000000000000000 0.0000000000000000
0.0000000000000001 0.0000000000000000 0.2590944141379854 0.0000000000000000 -0.0000000000000002 0.0000000000000000
-0.0000000000000000 0.0000000000000000 -0.0000000000000002 0.0000000000000000 0.2590944141379854 0.0000000000000000
1 2
-0.2590944141379856 0.0000000000000000 -0.0000000000000000 0.0000000000000000 0.0000000000000000 0.0000000000000000
-0.0000000000000001 0.0000000000000000 -0.2590944141379856 0.0000000000000000 0.0000000000000002 0.0000000000000000
0.0000000000000001 0.0000000000000000 0.0000000000000002 0.0000000000000000 -0.2590944141379856 0.0000000000000000
2 1
-0.2590944141379856 0.0000000000000000 -0.0000000000000001 0.0000000000000000 0.0000000000000001 0.0000000000000000
-0.0000000000000000 0.0000000000000000 -0.2590944141379856 0.0000000000000000 0.0000000000000002 0.0000000000000000
0.0000000000000001 0.0000000000000000 0.0000000000000002 0.0000000000000000 -0.2590944141379855 0.0000000000000000
2 2
0.2590944141379858 0.0000000000000000 0.0000000000000001 0.0000000000000000 -0.0000000000000001 0.0000000000000000
0.0000000000000001 0.0000000000000000 0.2590944141379858 0.0000000000000000 -0.0000000000000001 0.0000000000000000
-0.0000000000000001 0.0000000000000000 -0.0000000000000001 0.0000000000000000 0.2590944141379858 0.0000000000000000

Diagonalizing the dynamical matrix

q = ( 0.000000000000 0.000000000000 0.000000000000 )

***************************************************************************
freq ( 1) = -0.00000009 [THz] = -0.00000305 [cm-1]
( 0.699099 0.000000 -0.097697 0.000000 0.041428 0.000000 )
( 0.699099 0.000000 -0.097697 0.000000 0.041428 0.000000 )
freq ( 2) = 0.00000020 [THz] = 0.00000677 [cm-1]
( 0.002505 0.000000 0.291167 0.000000 0.644372 0.000000 )
( 0.002505 0.000000 0.291167 0.000000 0.644372 0.000000 )
freq ( 3) = 0.00000026 [THz] = 0.00000855 [cm-1]
( -0.106088 0.000000 -0.636928 0.000000 0.288216 0.000000 )
( -0.106088 0.000000 -0.636928 0.000000 0.288216 0.000000 )
freq ( 4) = 14.80188490 [THz] = 493.73766382 [cm-1]
( -0.042416 0.000000 -0.451763 0.000000 -0.542320 0.000000 )
( 0.042416 0.000000 0.451763 0.000000 0.542320 0.000000 )
freq ( 5) = 14.80188490 [THz] = 493.73766382 [cm-1]
( -0.515182 0.000000 0.391193 0.000000 -0.285579 0.000000 )
( 0.515182 0.000000 -0.391193 0.000000 0.285579 0.000000 )
freq ( 6) = 14.80188490 [THz] = 493.73766382 [cm-1]
( -0.482481 0.000000 -0.377992 0.000000 0.352610 0.000000 )
( 0.482481 0.000000 0.377992 0.000000 -0.352610 0.000000 )
***************************************************************************
98 changes: 98 additions & 0 deletions Examples/sscha_and_aiida/Si-dynamical-matrix2
Original file line number Diff line number Diff line change
@@ -0,0 +1,98 @@
Dynamical matrix file
File generated with the CellConstructor by Lorenzo Monacelli
1 2 0 1.8897259890000000 0.0000000000000000 0.0000000000000000 0.0000000000000000 0.0000000000000000 0.0000000000000000
Basis vectors
2.7154799999999999 2.7154799999999999 0.0000000000000000
2.7154799999999999 0.0000000000000000 2.7154799999999999
0.0000000000000000 2.7154799999999999 2.7154799999999999
1 'Si ' 25597.9124185021937592
1 1 -0.0000000000000004 0.0000000000000004 0.0000000000000004
2 1 1.3577400000000002 1.3577400000000006 1.3577400000000004

Dynamical Matrix in cartesian axes

q = ( -0.184129509332 0.000000000000 0.000000000000 )

1 1
0.3548752551952572 0.0000000000000000 0.0000000000000000 0.0000000000000000 -0.0000000000000000 -0.0000000000000000
0.0000000000000000 -0.0000000000000000 0.2477607075541515 0.0000000000000000 0.0000000000000001 -0.0000000000000000
-0.0000000000000000 0.0000000000000000 0.0000000000000001 0.0000000000000000 0.2477607075541518 0.0000000000000000
1 2
0.0000000000000000 0.0000000000000000 -0.0000000000000000 0.0000000000000000 0.0000000000000000 -0.0000000000000000
0.0000000000000000 0.0000000000000000 0.0000000000000001 0.0000000000000000 -0.2008555582082014 -0.0000000087796757
-0.0000000000000000 -0.0000000000000000 -0.2008555582082012 -0.0000000087796757 -0.0000000000000002 -0.0000000000000000
2 1
0.0000000000000000 -0.0000000000000000 0.0000000000000000 -0.0000000000000000 -0.0000000000000000 0.0000000000000000
-0.0000000000000000 -0.0000000000000000 0.0000000000000001 0.0000000000000000 -0.2008555582082013 0.0000000087796757
0.0000000000000000 0.0000000000000000 -0.2008555582082014 0.0000000087796757 -0.0000000000000002 0.0000000000000000
2 2
0.3548752551952572 0.0000000000000000 0.0000000000000000 0.0000000000000000 -0.0000000000000000 -0.0000000000000000
0.0000000000000000 -0.0000000000000000 0.2477607075541515 0.0000000000000000 -0.0000000000000001 -0.0000000000000000
-0.0000000000000000 0.0000000000000000 -0.0000000000000001 0.0000000000000000 0.2477607075541518 0.0000000000000000

Dynamical Matrix in cartesian axes

q = ( 0.000000000000 0.000000000000 -0.184129509332 )

1 1
0.2477607075541515 0.0000000000000000 0.0000000000000000 -0.0000000000000000 -0.0000000000000000 0.0000000000000000
0.0000000000000000 0.0000000000000000 0.2477607075541516 -0.0000000000000000 0.0000000000000001 -0.0000000000000000
-0.0000000000000000 -0.0000000000000000 0.0000000000000001 0.0000000000000000 0.3548752551952568 0.0000000000000000
1 2
-0.0000000000000000 -0.0000000000000000 -0.2008555582082013 -0.0000000087796755 0.0000000000000000 0.0000000000000000
-0.2008555582082013 -0.0000000087796755 -0.0000000000000002 -0.0000000000000000 0.0000000000000000 -0.0000000000000000
-0.0000000000000001 -0.0000000000000000 0.0000000000000000 0.0000000000000000 0.0000000000000001 0.0000000000000000
2 1
-0.0000000000000000 0.0000000000000000 -0.2008555582082013 0.0000000087796755 -0.0000000000000001 0.0000000000000000
-0.2008555582082013 0.0000000087796755 -0.0000000000000002 0.0000000000000000 0.0000000000000000 -0.0000000000000000
0.0000000000000000 -0.0000000000000000 0.0000000000000000 0.0000000000000000 0.0000000000000001 -0.0000000000000000
2 2
0.2477607075541515 -0.0000000000000000 0.0000000000000001 -0.0000000000000000 -0.0000000000000000 0.0000000000000000
0.0000000000000001 -0.0000000000000000 0.2477607075541518 0.0000000000000000 0.0000000000000000 -0.0000000000000000
-0.0000000000000000 -0.0000000000000000 0.0000000000000000 0.0000000000000000 0.3548752551952572 0.0000000000000000

Dynamical Matrix in cartesian axes

q = ( 0.000000000000 -0.184129509332 0.000000000000 )

1 1
0.2477607075541516 -0.0000000000000000 0.0000000000000000 -0.0000000000000000 0.0000000000000000 -0.0000000000000000
0.0000000000000000 0.0000000000000000 0.3548752551952573 -0.0000000000000000 0.0000000000000001 0.0000000000000000
0.0000000000000000 0.0000000000000000 0.0000000000000001 -0.0000000000000000 0.2477607075541516 -0.0000000000000000
1 2
0.0000000000000000 -0.0000000000000000 0.0000000000000000 0.0000000000000000 -0.2008555582082014 -0.0000000087796755
-0.0000000000000000 -0.0000000000000000 -0.0000000000000000 -0.0000000000000000 -0.0000000000000000 -0.0000000000000000
-0.2008555582082015 -0.0000000087796755 0.0000000000000001 -0.0000000000000000 -0.0000000000000000 -0.0000000000000000
2 1
0.0000000000000000 0.0000000000000000 -0.0000000000000000 0.0000000000000000 -0.2008555582082015 0.0000000087796755
0.0000000000000000 -0.0000000000000000 -0.0000000000000000 0.0000000000000000 0.0000000000000001 0.0000000000000000
-0.2008555582082014 0.0000000087796755 -0.0000000000000000 0.0000000000000000 -0.0000000000000000 0.0000000000000000
2 2
0.2477607075541516 0.0000000000000000 -0.0000000000000000 0.0000000000000000 -0.0000000000000000 0.0000000000000000
-0.0000000000000000 -0.0000000000000000 0.3548752551952571 -0.0000000000000000 0.0000000000000000 -0.0000000000000000
-0.0000000000000000 -0.0000000000000000 0.0000000000000000 0.0000000000000000 0.2477607075541518 0.0000000000000000

Diagonalizing the dynamical matrix

q = ( -0.184129509332 0.000000000000 0.000000000000 )

***************************************************************************
freq ( 1) = 4.45331342 [THz] = 148.54652494 [cm-1]
( -0.000000 0.000000 0.703431 0.000000 0.072005 0.000000 )
( 0.000000 -0.000000 0.072005 -0.000000 0.703431 -0.000000 )
freq ( 2) = 4.45331342 [THz] = 148.54652494 [cm-1]
( 0.000000 -0.000000 -0.072005 -0.000000 0.703431 0.000000 )
( -0.000000 0.000000 0.703431 -0.000000 -0.072005 0.000000 )
freq ( 3) = 12.24928837 [THz] = 408.59222083 [cm-1]
( -0.145074 0.000000 0.000000 -0.000000 -0.000000 0.000000 )
( -0.989421 0.000000 0.000000 -0.000000 -0.000000 0.000000 )
freq ( 4) = 12.24928837 [THz] = 408.59222083 [cm-1]
( 0.989421 0.000000 -0.000000 -0.000000 -0.000000 0.000000 )
( -0.145074 0.000000 -0.000000 -0.000000 0.000000 0.000000 )
freq ( 5) = 13.77242792 [THz] = 459.39867995 [cm-1]
( 0.000000 -0.000000 0.411585 -0.000000 -0.574977 0.000000 )
( 0.000000 -0.000000 0.574977 -0.000000 -0.411585 0.000000 )
freq ( 6) = 13.77242792 [THz] = 459.39867995 [cm-1]
( 0.000000 -0.000000 0.574977 -0.000000 0.411585 -0.000000 )
( 0.000000 0.000000 -0.411585 0.000000 -0.574977 0.000000 )
***************************************************************************
Loading
Loading