10
0
mirror of https://github.com/LCPQ/quantum_package synced 2024-10-20 06:48:20 +02:00
quantum_package/docs/source/users_guide/qp_plugins.rst

115 lines
2.8 KiB
ReStructuredText
Raw Normal View History

2018-12-25 18:59:11 +01:00
.. _qp_plugins:
==========
qp_plugins
==========
2019-01-05 01:51:21 +01:00
.. program:: qp_plugins
2019-01-14 15:20:51 +01:00
This command deals with all external plugins of |qp|. Plugin repositories can
2018-12-25 18:59:11 +01:00
be downloaded, and the plugins in these repositories can be
2019-01-14 15:20:51 +01:00
installed/uninstalled or created.
2018-12-25 18:59:11 +01:00
Usage
-----
.. code:: bash
2019-01-14 19:52:41 +01:00
qp_plugins list [-i] [-u] [-q]
2018-12-25 18:59:11 +01:00
qp_plugins download <url>
qp_plugins install <name>...
qp_plugins uninstall <name>
2019-01-14 19:52:41 +01:00
qp_plugins create -n <name> [-r <repo>] [<needed_modules>...]
2018-12-25 18:59:11 +01:00
.. option:: list
List all the available plugins.
2019-01-14 15:20:51 +01:00
.. option:: -i, --installed
2018-12-25 18:59:11 +01:00
List all the *installed* plugins.
2019-01-14 15:20:51 +01:00
.. option:: -u, --uninstalled
2018-12-25 18:59:11 +01:00
List all the *uninstalled* plugins.
2019-01-14 15:20:51 +01:00
.. option:: -q, --repositories
2018-12-25 18:59:11 +01:00
List all the downloaded repositories.
2019-01-14 19:52:41 +01:00
.. option:: download <url>
2018-12-25 18:59:11 +01:00
Download an external repository. The URL points to a tar.gz file or a
git repository, for example:
* http://example.com/site/example.tar.gz
* git@gitlab.com:user/example_repository
.. option:: install <plugin_name>
Install the plugin ``plugin_name``.
.. option:: uninstall <plugin_name>
Uninstall the plugin ``plugin_name``.
2019-01-14 15:20:51 +01:00
.. option:: -n, --name=<plugin_name>
2018-12-25 18:59:11 +01:00
Create a new plugin named ``plugin_name`` (in local repository by default).
2018-12-25 18:59:11 +01:00
2019-01-14 15:20:51 +01:00
.. option:: -r, --repository=<repo>
2018-12-25 18:59:11 +01:00
Specify in which repository the new plugin will be created.
2018-12-25 18:59:11 +01:00
2019-01-10 17:52:54 +01:00
Example
-------
2019-01-14 15:20:51 +01:00
Let us download, install and compile some specific external plugins from
`<https://gitlab.com/eginer/qp_plugins_eginer>`_ .
2019-01-10 17:52:54 +01:00
2019-01-14 15:20:51 +01:00
First, download the git repo associated to these plugins. To do so, first go
to the `plugins` directory in the |QP| and execute:
2019-01-10 17:52:54 +01:00
.. code:: bash
qp_plugins download https://gitlab.com/eginer/qp_plugins_eginer
2019-01-14 15:20:51 +01:00
This will create in the directory `plugins` a local copy of the git repo
located at the URL you indicated. Then, go in `qp_plugins_eginer/stable/`
2019-01-10 17:52:54 +01:00
.. code:: bash
cd qp_plugins_eginer/stable/
2019-01-14 15:20:51 +01:00
In the directory `stable`, there are many directories which all correspond to a
specific plugin that have been developed by the person in charge of the git
repo. All these plugins might use some global variables and routines contained
2019-01-10 17:52:54 +01:00
in the core modules of the |QP|.
Now let us install the plugin `rsdft_cipsi`:
.. code:: bash
qp_plugins install rsdft_cipsi
2019-01-14 15:20:51 +01:00
This will link this directory to the |QP| which means that when the code will
be compiled, this plugin will be compiled to and therefore all the
executables/scripts/input keywords contained in this module will be available
as if there were part of the core of the |QP|.
2019-01-10 17:52:54 +01:00
2019-01-14 15:20:51 +01:00
Then, to compile the new plugin, just recompile the |QP| as usual by going at
the root of the |QP| directory:
2019-01-10 17:52:54 +01:00
2019-01-10 17:54:30 +01:00
.. code:: bash
cd $QP_ROOT
ninja
2019-01-14 15:20:51 +01:00
Finally, if you go back to the plugin directory you just installed, you should see
all the executables/scripts which have been created and which are now available
with the `qp_run` command.