# CRYSTALClear 💎

## Description 📄

A python framework for the [CRYSTAL](https://www.crystal.unito.it) code. Forked from [CRYSTALpytools](https://github.com/crystal-code-tools/CRYSTALpytools).

## Table of Contents 📑

- [Features](#features)
- [Installation](#installation)
- [Usage](#usage)
- [Contributing](#contributing)
- [License](#license)
- [Contact](#contact)

## Features ✨

- Band structure and DOSS
- Elastic properties (Young and shear moduli, linear compressibility, Poisson ratio)
- Harmonic and anharmonic IR and Raman spectra
- Electron densities and laplacian topological analysis
- Transport properties
- Extraction of information from CRYSTAL .out file

## Installation 💻

Public releases of the code are distributed through Pypi.

### Requirements 📦

The following will be installed if not already present:

- Python 3.x
- pymatgen>=2022
- numpy
- mendeleev
- ase

### Steps 🛠️

1. Create a conda environment (suggested)
   ```sh
   conda create --name crystalclear python=3.9
   ```
2. Activate the environment (suggested)
   ```sh
   conda activate crystalclear
   ```
3. Install
   ```sh
   pip install CRYSTALClear
   ```

## Usage 🚀

In order to use any of the feature available in the package the user need to generate
a CRYSTAL object through the crystal_io module. Three classes are available to the user
for different use cases:

1. **Crystal_output**: To extract informations and generate the object required to plot
   from any .out file of the CRYSTAL package.
2. **Properties_output**: To generate the objects required to plot any of quantities
   stored in the .DAT and .f25 files generated by the PROPERTIES module.
3. **External_unit**: To generate the objects required to plot any of the quantites stored
   in .DAT and .f25 file generated by CRYSTAL.

```py
   from CRYSTALClear.crystal_io import class
   #Crystal_output
   data = class(file).function(*args,**kwargs)
   #Properties_output and External_unit
   data = class().functione(file)
```

Once the object is generated the user can generate the desired plot using the functions
in the plot module

```py
   import CRYSTALClear.plot as CCplt
   CCplt.function(data,*args,**kwargs)
```

The function will return one (or a list of) [matplotlib object(s)](https://matplotlib.org/) that the user can easily modify
as any other plot produced with the library.

For further information check the [Documentation](https://crystaldevs.github.io/CRYSTALClear/).

## Contributing 🤝

Contributions are what make the open source community such an amazing place to be, learn, inspire, and create. Any contributions you make are **greatly appreciated**.

1.  Fork the Project
2.  Create your Feature Branch (`git checkout -b feature/AmazingFeature`)
3.  Commit your Changes (`git commit -m 'Add some AmazingFeature'`)
4.  Push to the Branch (`git push origin feature/AmazingFeature`)
5.  Open a Pull Request

## License 📜

Distributed under the `MIT` License. See `LICENSE.txt` for more information.

## Contact 📬

- Website: https://www.crystal.unito.it
- Email: crystalunito@gmail.com
- Instagram: [@crystaldevs](https://www.instagram.com/crystaldevs/)
