Skip to content

Commit 4d3d525

Browse files
Update docs
1 parent ab93ab9 commit 4d3d525

File tree

4 files changed

+125
-51
lines changed

4 files changed

+125
-51
lines changed

docs/examples.md

Lines changed: 0 additions & 50 deletions
Original file line numberDiff line numberDiff line change
@@ -154,53 +154,3 @@ atoms.get_potential_energy()
154154
1. This file is provided in `raspa_ase/docs/files/MFI_SI.cif` for the sake of this tutorial. The `Atoms` object represents the framework to be studied and will be written out to the current working directory to be used by RASPA.
155155

156156
2. The framework parameters are to be specified as `info` attributes of the `Atoms` object. You do not need to include the framework number or framework name. These will be included automatically.
157-
158-
## Example 8: Adsorption isotherm of CO2 in Cu-BTC
159-
160-
!!! Note
161-
162-
This example is not ready yet since support for charges is ongoing.
163-
164-
```python
165-
from ase.io import read
166-
from raspa_ase import Raspa
167-
168-
atoms = read("Cu-BTC.cif") # (1)!
169-
atoms.info = { # (2)!
170-
"HeliumVoidFraction": 0.29,
171-
"ExternalTemperature": 323.0,
172-
"ExternalPressure": 100000.0,
173-
}
174-
atoms.set_initial_charges([1.0]) # (3)!
175-
176-
components = [
177-
{
178-
"MoleculeName": "CO2",
179-
"MoleculeDefinition": "ExampleDefinitions",
180-
"FugacityCoefficient": 1.0,
181-
"TranslationProbability": 0.5,
182-
"RotationProbability": 0.5,
183-
"ReinsertionProbability": 0.5,
184-
"SwapProbability": 1.0,
185-
"CreateNumberOfMolecules": 0,
186-
}
187-
]
188-
parameters = {
189-
"SimulationType": "MonteCarlo",
190-
"NumberOfCycles": 10000,
191-
"NumberOfInitializationCycles": 5000,
192-
"PrintEvery": 1000,
193-
"RestartFile": False,
194-
"Forcefield": "ExampleMOFsForceField",
195-
}
196-
calc = Raspa(components=components, parameters=parameters)
197-
198-
atoms.calc = calc
199-
atoms.get_potential_energy()
200-
```
201-
202-
1. This file is provided in `raspa_ase/docs/files/Cu-BTC.cif` for the sake of this tutorial. The `Atoms` object represents the framework to be studied and will be written out to the current working directory to be used by RASPA.
203-
204-
2. If you do not specify the "UnitCells" parameter, the calculator will automatically determine an appropriate value based on the size of the unit cell and the chosen cutoff (taken as 12.0 Angstroms if not specified) to account for the minimum image convention.
205-
206-
3. This will set `_atom_site_charge` label in the CIF file and will automatically enable "UseChargesFromCIFFile" in the `parameters` block.

docs/install.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
## RASPA
44

5-
First, install RASPA based on the [official instructions](https://iraspa.org/raspa/).
5+
First, install RASPA based on the [official instructions](https://iraspa.org/raspa/) and set the `$RASPA_DIR` environment variable as instructed.
66

77
!!! Tip
88

docs/intro.md

Lines changed: 123 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,123 @@
1+
# Overview
2+
3+
The calculator is quite straightforward to use. For details on each parameter, refer to the RASPA manual.
4+
5+
## Instantiating the Calculator
6+
7+
The calculator is applied to an `Atoms` object, representing the framework under investigation. To run a RASPA calculator, call the `.get_potential_energy()` method like so:
8+
9+
```python
10+
from ase.io import read
11+
from raspa_ase import Raspa
12+
13+
atoms = read("my_framework.cif")
14+
atoms.calc = Raspa()
15+
atoms.get_potential_energy()
16+
```
17+
18+
## Parameters
19+
20+
Of course, you need to actually provide some input parameters. In short, the calculator takes an `Atoms` object and three optional keyword arguments. The parameters are case-insensitive, booleans will be converted to "Yes" or "No" as appropriate, lists will be converted to space-separated strings, and dictionaries will be converted to properly formatted key-value pairs.
21+
22+
### Framework Properties
23+
24+
The calculator is applied to an `Atoms` object. If you want to run a calculation without a framework (i.e. with just a box of molecules), you can use an empty `Atoms` object, defined as `Atoms()`.
25+
26+
For framework-specific properties, they should be attached to the `Atoms` object's `.info` attribute.
27+
28+
For instance:
29+
30+
```python
31+
atoms.info["HeliumVoidFraction"] = 0.149
32+
```
33+
34+
would be equivalent to
35+
36+
```python
37+
Framework 0
38+
FrameworkName framework0
39+
HeliumVoidFraction 0.149
40+
```
41+
42+
You never need to specify the framework number or the framework name, and the the CIF will be automatically written out for you based on the `Atoms` object. If you don't specify a "UnitCells" entry in `atoms.info`, `raspa_ase` will ensure that the minimum image convention is satisfied based on your "CutOff" value.
43+
44+
If you want to run a calculation with partial atomic charges on the framework, you can set the initial charges:
45+
46+
For instance:
47+
48+
```python
49+
atoms.set_initial_charges([1.0, 2.0])
50+
```
51+
52+
would write out the `_atom_site_charge` column in the CIF as 1.0 and 2.0 for atom number 0 and 1, respectively. It will also automatically set "UseChargesFromCIFFile" to "Yes".
53+
54+
### Boxes
55+
56+
The optional `boxes` keyword argument, of type `list[dict]`, is a list where each entry is a given set of box parameters formatted as a dictionary.
57+
58+
For instance:
59+
60+
```python
61+
boxes = [{"BoxLengths": [30, 30, 30]}, {"BoxLengths": [40, 40, 40], "BoxAngles": [90, 120, 120]}]
62+
Raspa(boxes=boxes)
63+
```
64+
65+
is equivalent to
66+
67+
```
68+
Box 0
69+
BoxLengths 30 30 30
70+
Box 1
71+
BoxLengths 40 40 40
72+
BoxAngles 90 120 120
73+
```
74+
75+
You never need to specify the box number. This is determined based on the index of the box in the list.
76+
77+
### Components
78+
79+
The optional `components` keyword argument, of type `list[dict]`, is a list where each entry is a given set of component parameters formatted as a dictionary.
80+
81+
For instance:
82+
83+
```python
84+
components = [
85+
{"MoleculeName": "CO2", "MoleculeDefinition": "ExampleDefinitions"},
86+
{"MoleculeName": "N2", "MoleculeDefinition": "ExampleDefinitions"},
87+
]
88+
```
89+
90+
is equivalent to
91+
92+
```
93+
Component 0 MoleculeName CO2
94+
MoleculeDefinition ExampleDefinitions
95+
Component 1 MoleculeName N2
96+
MoleculeDefinition ExampleDefinitions
97+
```
98+
99+
You never need to specify the component number. This is determined based on the index of the component in the list. The "MoleculeName" will also be formatted automatically for you.
100+
101+
### Keywords
102+
103+
The optional `keywords` keyword argument, of type `dict`, is a dictionary of all other parameters to be passed to RASPA.
104+
105+
For instance:
106+
107+
```python
108+
keywords = {
109+
"SimulationType": "MonteCarlo",
110+
"NumberOfCycles": 10000,
111+
"NumberOfInitializationCycles": 1000,
112+
"Movies": True,
113+
}
114+
```
115+
116+
is equivalent to
117+
118+
```
119+
SimulationType MonteCarlo
120+
NumberOfCycles 10000
121+
NumberOfInitializationCycles 1000
122+
Movies Yes
123+
```

mkdocs.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ site_url: https://quantum-accelerators.github.io/raspa_ase/
66
nav:
77
- Home: index.md
88
- install.md
9+
- intro.md
910
- examples.md
1011
- Code Documentation: reference/ # keep me!
1112
- About:

0 commit comments

Comments
 (0)