Skip to content

Commit

Permalink
add documentation for cube
Browse files Browse the repository at this point in the history
  • Loading branch information
robinzyb committed Jul 12, 2024
1 parent 83fd6b4 commit 26e2df3
Showing 1 changed file with 17 additions and 2 deletions.
19 changes: 17 additions & 2 deletions docs/cube/README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Manipulate CP2K Cube Files

The `CP2KData` Python package provides tools for working with cube files generated by the CP2K quantum chemistry software. One of the standout features of this package is its ability to handle CP2K cube files and perform various analyses.
The `CP2KData` Python package provides tools for working with cube files generated by the CP2K software. One of the features of this package is its ability to handle CP2K cube files and perform various analyses.

## Getting Started
Import the necessary modules and load a cube file:
Expand Down Expand Up @@ -35,7 +35,7 @@ ase.atoms.Atoms
```

## Integration over space
User can obtain the integration over space using the `get_integration()` method, for example, if you get integration using density cube, you will get the total number electrons in this cube
User can obtain the integration over the full unit cell using the `get_integration()` method, for example, if you get integration using density cube, you will get the total number electrons in this cube
```python
mycube.get_integration()
```
Expand All @@ -45,6 +45,21 @@ mycube.get_integration()
```
The result is not exactly an integer. User should round it to integer manually.

Sometimes, we need to integrate over a certain area instead of the full unit cell.
One can use `start_x`, `end_x`, `start_y`, `end_y`, `start_z`, and `end_z` variables to define the desired range of values for the x, y, and z axes.
```python
mycube = Cp2kCube("example.cube")
print(mycube.get_integration(start_z = 41.76))
print(mycube.get_integration(end_z = 41.76))
mycube.get_integration()
```
```shell
# output
0.8702837077294211
0.12970844915317598
```
Note that the integration by area is not applied to non-orthogonal cells.

## Planar Averaging
You can calculate planar average data from the cube file, both with and without interpolation:
```python
Expand Down

0 comments on commit 26e2df3

Please sign in to comment.