Skip to content

Commit cbdf4ca

Browse files
committed
Updated the documentation
1 parent bab8ca4 commit cbdf4ca

4 files changed

Lines changed: 125 additions & 10 deletions

File tree

UserGuide/_static/about.html

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
<h3>About</h3>
2+
<p>SSCHA code documentation</p>
3+
<p><a href="https://www.sscha.eu">
4+
<img src="http://sscha.eu/img/SSCHA_Logo_original_Horizontala_leyeda_Gabe.png"
5+
alt="www.sscha.eu" width="200" height="50" />
6+
</a></p>

UserGuide/advanced.rst

Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -138,6 +138,56 @@ You can plot all the minimization path (frequencies, free energy, gradients) cal
138138
The sscha-plot-data.py script is automatically installed within the SSCHA code.
139139

140140

141+
Load from the output files
142+
--------------------------
143+
144+
It is possible to load an ensemble directly from a list of output files from a specific program,
145+
like quantum ESPRESSO.
146+
This is usefull when a calculation ended with an error on the cluster,
147+
and the ensemble has not been saved on the disk (but you have the output files of the
148+
configurations that have been already computed succesfully).
149+
150+
In this case, you can restart the minimization using an ensemble with the following code:
151+
152+
.. code-block:: python
153+
154+
# Load the dynamical matrix
155+
dyn = CC.Phonons.Phonons("dyn", 4)
156+
157+
# Load the ensemble
158+
ens = sscha.Ensemble.Ensemble(dyn, 300)
159+
160+
# Load the ensemble from the output of the calculator
161+
# In this case, the pwo files are output of the quantum espresso program.
162+
# Any output file that ASE is able to read can be used to load the ensemble.
163+
ens.load_from_calculator_output(directory="data", out_ext=".pwo")
164+
165+
166+
# Run the minimization
167+
minim = sscha.SchaMinimizer.SSCHA_Minimizer(ens)
168+
minim.init()
169+
minim.set_minimization_step(0.01)
170+
minim.run()
171+
minim.finalize()
172+
173+
An example of this procedure is provided in the ``tests/test_load_ensemble_from_calculator_output`` directory.
174+
175+
Alternatively, you can also use the ensemble to restart a full relax procedure.
176+
In this case, you need to provide the key ``restart_from_ens = True`` to the
177+
``relax`` or ``vc_relax`` methods of the ``SSCHA`` class in the ``Relax`` module.
178+
179+
.. code-block:: python
180+
181+
# Initialize the minimizer minim (see example above)
182+
relax = sscha.Relax.SSCHA(minim, ase_calculator=calculator,
183+
N_configs = 100, max_pop = 20)
184+
relax.relax(restart_from_ens = True)
185+
186+
# Or, if you want to perform a variable cell relaxation
187+
relax.vc_relax(restart_from_ens = True)
188+
189+
190+
141191
Cluster configuration with a code different from Quantum ESPRESSO
142192
-----------------------------------------------------------------
143193

UserGuide/conf.py

Lines changed: 22 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -63,9 +63,9 @@
6363
# built documents.
6464
#
6565
# The short X.Y version.
66-
version = u'1.2'
66+
version = u'1.4'
6767
# The full version, including alpha/beta/rc tags.
68-
release = u'1.2'
68+
release = u'1.4'
6969

7070
# The language for content autogenerated by Sphinx. Refer to documentation
7171
# for a list of supported languages.
@@ -93,11 +93,24 @@
9393
#
9494
html_theme = 'alabaster'
9595

96+
9697
# Theme options are theme-specific and customize the look and feel of a theme
9798
# further. For a list of options available for each theme, see the
9899
# documentation.
99100
#
100-
# html_theme_options = {}
101+
html_theme_options = {
102+
"rightsidebar": "true",
103+
"relbarbgcolor": "black"
104+
}
105+
106+
html_sidebars = {
107+
"**": [
108+
"about.html",
109+
"navigation.html",
110+
"relations.html",
111+
"searchbox.html"
112+
]
113+
}
101114

102115
# Add any paths that contain custom static files (such as style sheets) here,
103116
# relative to this directory. They are copied after the builtin static files,
@@ -109,12 +122,12 @@
109122
#
110123
# This is required for the alabaster theme
111124
# refs: http://alabaster.readthedocs.io/en/latest/installation.html#sidebars
112-
html_sidebars = {
113-
'**': [
114-
'relations.html', # needs 'show_related': True theme option to display
115-
'searchbox.html',
116-
]
117-
}
125+
# html_sidebars = {
126+
# '**': [
127+
# 'relations.html', # needs 'show_related': True theme option to display
128+
# 'searchbox.html',
129+
# ]
130+
# }
118131

119132

120133
# -- Options for HTMLHelp output ------------------------------------------

UserGuide/install.rst

Lines changed: 47 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,11 +5,57 @@ The SSCHA code is a collection of 2 python packages: CellConstructor and python-
55
In this guide, we refer to the installation of python-sscha.
66

77

8+
Easy installation using Anaconda
9+
--------------------------------
10+
11+
The easy way to install python-sscha is to use the anaconda distribution of python.
12+
13+
.. code-block:: console
14+
15+
conda create -n sscha -c conda-forge python=3.11 gfortran libblas lapack openmpi julia openmpi-mpicc pip numpy scipy spglib
16+
conda activate sscha
17+
pip install ase julia mpi4py
18+
pip install cellconstructor python-sscha tdscha
19+
20+
21+
This will create a new environment called sscha, install all the dependencies and the packages.
22+
To use the code, you need to activate the environment:
23+
24+
.. code-block:: console
25+
26+
conda activate sscha
27+
28+
29+
The sscha code exploits the julia language to speed up the calculation.
30+
To install the julia dependencies, you need to run the following command:
31+
32+
.. code-block:: console
33+
34+
python -c 'import julia; julia.install()'
35+
36+
37+
And that's it! You can now run the sscha code.
38+
39+
.. code-block:: console
40+
41+
sscha -h
42+
43+
44+
SSCHA also works as a library, so you can import it in your python scripts.
45+
To check that everything is working, you can run the following script:
46+
47+
.. code-blocK:: python
48+
49+
import sscha, sscha.Ensemble
50+
print("Hello world!")
51+
52+
If it runs without problems, the SSCHA code is working correctly.
53+
854
Requirements
955
------------
1056

1157
To install python-sscha you need:
12-
1. python (either 2.7 or 3.*)
58+
1. python<=3.11
1359
2. numpy
1460
3. scipy
1561
4. matplotlib

0 commit comments

Comments
 (0)