|
| 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 | +``` |
0 commit comments