pipを用意します。
$ sudo apt update $ sudo apt install python3-pip
仮想環境を作って、そこにインストールする方法です。
$ sudo apt install python3-venv $ python3 -m venv ~/venv_cif2cell $ source ~/venv_cif2cell/bin/activate (venv_cif2cell) $ pip install cif2cell
これで使えるようになります。 終了するには
(venv_cif2cell) $ deactivate
とします。
cif2cellは小さいプログラムなので、仮想環境を作らなくても特に問題は生じないと思います。 毎回、仮想環境をアクティベートするのが面倒だと感じる人は、以下のようにすればシステム全体にインストールできます。
$ sudo pip install cif2cell --break-system-packages
基本的な使い方は
$ cif2cell -h
で確認することができます。 例えばmaterial.cifからPWscfの入力ファイルのひな形を作りたければ
$ cif2cell -p pwscf -f material.cif -o material.scf.in
などとします。 また、以下のオプションで CELL_PARAMETERS(基本並進ベクトル)と ATOMIC_POSITIONS の種類を指定できます。
| オプション | CELL_PARAMETERS | ATOMIC_POSITIONS |
|---|---|---|
| なし | alat | crystal |
| --pwscf-atomic-units | alat | crystal |
| --pwscf-alat-units | alat | alat |
| --pwscf-cartesian | angstrom | angstrom |
| --pwscf-cartesian-latticevectors | angstrom | crystal |
| --pwscf-cartesian-positions | alat | angstrom |
(Python2が必要なので非推奨です)
以下のサイトからダウンロード。
ホーム・ディレクトリにおいて展開し、展開先のディレクトリに入って次のコマンドを実行。
$ sudo python setup.py install
インストールは一瞬で終わります。