diff --git a/UserGuide/_static/about.html b/UserGuide/_static/about.html new file mode 100644 index 00000000..206a2fd3 --- /dev/null +++ b/UserGuide/_static/about.html @@ -0,0 +1,6 @@ +
SSCHA code documentation
+ diff --git a/UserGuide/advanced.rst b/UserGuide/advanced.rst index 2b285206..9343158b 100644 --- a/UserGuide/advanced.rst +++ b/UserGuide/advanced.rst @@ -138,6 +138,56 @@ You can plot all the minimization path (frequencies, free energy, gradients) cal The sscha-plot-data.py script is automatically installed within the SSCHA code. +Load from the output files +-------------------------- + +It is possible to load an ensemble directly from a list of output files from a specific program, +like quantum ESPRESSO. +This is usefull when a calculation ended with an error on the cluster, +and the ensemble has not been saved on the disk (but you have the output files of the +configurations that have been already computed succesfully). + +In this case, you can restart the minimization using an ensemble with the following code: + +.. code-block:: python + + # Load the dynamical matrix + dyn = CC.Phonons.Phonons("dyn", 4) + + # Load the ensemble + ens = sscha.Ensemble.Ensemble(dyn, 300) + + # Load the ensemble from the output of the calculator + # In this case, the pwo files are output of the quantum espresso program. + # Any output file that ASE is able to read can be used to load the ensemble. + ens.load_from_calculator_output(directory="data", out_ext=".pwo") + + + # Run the minimization + minim = sscha.SchaMinimizer.SSCHA_Minimizer(ens) + minim.init() + minim.set_minimization_step(0.01) + minim.run() + minim.finalize() + +An example of this procedure is provided in the ``tests/test_load_ensemble_from_calculator_output`` directory. + +Alternatively, you can also use the ensemble to restart a full relax procedure. +In this case, you need to provide the key ``restart_from_ens = True`` to the +``relax`` or ``vc_relax`` methods of the ``SSCHA`` class in the ``Relax`` module. + +.. code-block:: python + + # Initialize the minimizer minim (see example above) + relax = sscha.Relax.SSCHA(minim, ase_calculator=calculator, + N_configs = 100, max_pop = 20) + relax.relax(restart_from_ens = True) + + # Or, if you want to perform a variable cell relaxation + relax.vc_relax(restart_from_ens = True) + + + Cluster configuration with a code different from Quantum ESPRESSO ----------------------------------------------------------------- diff --git a/UserGuide/conf.py b/UserGuide/conf.py index 82ababf3..b6e6b95b 100644 --- a/UserGuide/conf.py +++ b/UserGuide/conf.py @@ -63,9 +63,9 @@ # built documents. # # The short X.Y version. -version = u'1.2' +version = u'1.4' # The full version, including alpha/beta/rc tags. -release = u'1.2' +release = u'1.4' # The language for content autogenerated by Sphinx. Refer to documentation # for a list of supported languages. @@ -93,11 +93,24 @@ # html_theme = 'alabaster' + # Theme options are theme-specific and customize the look and feel of a theme # further. For a list of options available for each theme, see the # documentation. # -# html_theme_options = {} +html_theme_options = { + "rightsidebar": "true", + "relbarbgcolor": "black" + } + +html_sidebars = { + "**": [ + "about.html", + "navigation.html", + "relations.html", + "searchbox.html" + ] + } # Add any paths that contain custom static files (such as style sheets) here, # relative to this directory. They are copied after the builtin static files, @@ -109,12 +122,12 @@ # # This is required for the alabaster theme # refs: http://alabaster.readthedocs.io/en/latest/installation.html#sidebars -html_sidebars = { - '**': [ - 'relations.html', # needs 'show_related': True theme option to display - 'searchbox.html', - ] -} +# html_sidebars = { +# '**': [ +# 'relations.html', # needs 'show_related': True theme option to display +# 'searchbox.html', +# ] +# } # -- Options for HTMLHelp output ------------------------------------------ diff --git a/UserGuide/install.rst b/UserGuide/install.rst index 8f152399..c01d36d3 100644 --- a/UserGuide/install.rst +++ b/UserGuide/install.rst @@ -5,11 +5,57 @@ The SSCHA code is a collection of 2 python packages: CellConstructor and python- In this guide, we refer to the installation of python-sscha. +Easy installation using Anaconda +-------------------------------- + +The easy way to install python-sscha is to use the anaconda distribution of python. + +.. code-block:: console + + conda create -n sscha -c conda-forge python=3.11 gfortran libblas lapack openmpi julia openmpi-mpicc pip numpy scipy spglib + conda activate sscha + pip install ase julia mpi4py + pip install cellconstructor python-sscha tdscha + + +This will create a new environment called sscha, install all the dependencies and the packages. +To use the code, you need to activate the environment: + +.. code-block:: console + + conda activate sscha + + +The sscha code exploits the julia language to speed up the calculation. +To install the julia dependencies, you need to run the following command: + +.. code-block:: console + + python -c 'import julia; julia.install()' + + +And that's it! You can now run the sscha code. + +.. code-block:: console + + sscha -h + + +SSCHA also works as a library, so you can import it in your python scripts. +To check that everything is working, you can run the following script: + +.. code-blocK:: python + + import sscha, sscha.Ensemble + print("Hello world!") + +If it runs without problems, the SSCHA code is working correctly. + Requirements ------------ To install python-sscha you need: -1. python (either 2.7 or 3.*) +1. python<=3.11 2. numpy 3. scipy 4. matplotlib