Skip to content

Commit

Permalink
pseudoatom example
Browse files Browse the repository at this point in the history
  • Loading branch information
eahenle committed Jun 26, 2024
1 parent 12fdd58 commit c8100f4
Show file tree
Hide file tree
Showing 3 changed files with 58 additions and 0 deletions.
50 changes: 50 additions & 0 deletions docs/src/molecule.md
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,56 @@ Charges{Cart}(3, [0.7, -0.35, -0.35], Cart([0.0 -1.16 1.16; 0.0 0.0 0.0; 0.0 0.0

To see specific information about the atoms and charges attributes of the molecule see [`Atoms`](@ref) and [`Charges`](@ref).

## Pseudo-Atoms

Sometimes, [e.g. modeling quadrupolar molecules](https://github.com/SimonEnsemble/PorousMaterials.jl/issues/236), it is desirable to add a point charge in a location outside of any atomic nucleus.
In order to do this, a pseudo-atom label must be chosen (consistent with input data) and added to the global list of atomic masses.

Take the example of using [TraPPE](https://doi.org/10.1002/aic.690470719)-derived charges for the dinitrogen molecule.
Partial negative charges are assigned to the nitrogen atoms and a corresponding positive charge is placed at a pseudo-atom "dummy site" at the center of mass.
The atoms and charges input data for this "N2_TraPPE" molecule are like so:

```jldoctest molecule
dir = joinpath(rc[:paths][:molecules], "N2_TraPPE")
for file in readdir(dir)
@info file data=String(read(joinpath(dir, file)))
end
# output
┌ Info: atoms.csv
└ data = "atom,x,y,z\r\nN_in_N2,0,0,0.55\r\nPSEUDOATOM_LABEL,0,0,0\r\nN_in_N2,0,0,-0.55"
┌ Info: charges.csv
└ data = "q,x,y,z\r\n-0.482,0,0,0.55\r\n0.964,0,0,0\r\n-0.482,0,0,-0.55"
```

**atoms.csv**

```
atom,x,y,z
N_in_N2,0,0,0.55
PSEUDOATOM_LABEL,0,0,0
N_in_N2,0,0,-0.55
```

**charges.csv**

```
q,x,y,z
-0.482,0,0,0.55
0.964,0,0,0
-0.482,0,0,-0.55
```

In this example, `PSEUDOATOM_LABEL` is the label for the pseudo-atom; there are several common choices, so make sure you know which one is used in your particular data!

Before loading these data by calling `Molecule`, we need to add our (massless) pseudo-atom to the mass dictionary:

```juliadoctest
rc[:atomic_masses][:PSEUDOATOM_LABEL] = 0.
Molecule("N2_TraPPE")
# ouput
asdf
```

## Moving Molecules
We can translate and roatate a molecule:

Expand Down
4 changes: 4 additions & 0 deletions test/data/molecules/N2_TraPPE/atoms.csv
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
atom,x,y,z
N_in_N2,0,0,0.55
PSEUDOATOM_LABEL,0,0,0
N_in_N2,0,0,-0.55
4 changes: 4 additions & 0 deletions test/data/molecules/N2_TraPPE/charges.csv
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
q,x,y,z
-0.482,0,0,0.55
0.964,0,0,0
-0.482,0,0,-0.55

0 comments on commit c8100f4

Please sign in to comment.