1
1
# moments
2
2
Program for calculating rotational constants from an xyz molecular geometry.
3
- Supports nonstandard isotopologues and will calculate internal rotation parameters for 1 methyl rotor.
3
+ Supports nonstandard isotopologues and will calculate internal rotation parameters for 1 internal rotor.
4
4
5
5
[ ![ DOI] ( https://zenodo.org/badge/674807150.svg )] ( https://zenodo.org/badge/latestdoi/674807150 )
6
6
7
+ ![ ac-ala-ome-ab] ( https://github.com/kncrabtree/moments/assets/20146313/0a6a9fe0-c6f4-4c14-aae4-46cc3a3c2d9a )
8
+
9
+
7
10
### Installation and Requirements
8
11
9
- The program is self-contained in a single script: ` moments.py ` . On Mac/Linux, you can make the script executable and place in a directory contained in your ` PATH ` environment variable. The program requires only Python3, numpy, scipy, matplotlib, and pandas.
12
+ The program is self-contained in a single script: ` moments.py ` . On Mac/Linux, you can make the script executable and place in a directory contained in your ` PATH ` environment variable. The program requires only Python3, numpy, scipy, matplotlib, and pandas. It can also be imported and used as part of a python script; see moments-example.ipynb.
10
13
11
14
### Usage - Quickstart
12
15
@@ -15,31 +18,31 @@ The program is self-contained in a single script: `moments.py`. On Mac/Linux, yo
15
18
16
19
- Basic usage, generates output files ` examples/acetaldehyde.xyz-moments.csv ` and ` examples/acetaldehyde.xyz-coords.png `
17
20
18
- ``` moments.py examples/acetaldehyde.xyz ```
21
+ ``` moments.py examples/acetaldehyde/acetaldehyde .xyz ```
19
22
20
23
- Nonstandard isotopes (change atom 0 to $^{13}\text{C}$ and atom 2 to $^{18}\text{O}$)
21
24
22
- ``` moments.py examples/acetaldehyde.xyz -i 0-13,2-18 ```
25
+ ``` moments.py examples/acetaldehyde/acetaldehyde .xyz -i 0-13,2-18 ```
23
26
24
27
- Calculate PAM and RAM Hamiltonian terms (methyl atoms are 1, 4, 5, and 6)
25
28
26
- ``` moments.py examples/acetaldehyde.xyz -m 1,4,5,6 ```
29
+ ``` moments.py examples/acetaldehyde/acetaldehyde .xyz -r 1,4,5,6 ```
27
30
28
31
- As above, but suppress output printing and specify names of output files
29
32
30
- ``` moments.py examples/acetaldehyde.xyz -m 1,4,5,6 -q -o output.csv -p coordinates.png ```
33
+ ``` moments.py examples/acetaldehyde/acetaldehyde .xyz -r 1,4,5,6 -q -o output.csv -p coordinates.png ```
31
34
32
35
- Do not generate plots
33
36
34
- ``` moments.py examples/acetaldehyde.xyz -m 1,4,5,6 -q -o output.csv --no-plots ```
37
+ ``` moments.py examples/acetaldehyde/acetaldehyde .xyz -r 1,4,5,6 -q -o output.csv --no-plots ```
35
38
36
39
### Usage - Details
37
40
38
41
From a command line, run the script and pass the name of a file containing the molecular geometry in xyz format. As an example:
39
- ``` moments.py examples/acetaldyhyde.xyz ```
42
+ ``` moments.py examples/acetaldehyde/ acetaldyhyde.xyz ```
40
43
The script will print information to standard output (see below for examples) and will generate 2 output files: a csv file containing the spectrosscopic constants and atomic masses, and an image file showing the molecular geometry in principal axis coordinates.
41
44
42
- The input file should be in JMOLplot-like format. For example, the examples/acetaldehyde.txt file contains:
45
+ The input file should be in JMOLplot-like format. For example, the examples/acetaldehyde/acetaldehyde .txt file contains:
43
46
```
44
47
7
45
48
@@ -54,7 +57,7 @@ H -1.7052250 0.2181590 -0.8793310
54
57
The first line is ignored. The second line may optionally contain the molecule's name, and the remaining lines contain the atoms and their coordinates. By default, the program assumes the coordinates are in units of Angstrom, but this can be modified by passing the ` -b ` or ` --bohr ` flag. Any whitespace characters may be used to separate the columns. Atom labels are case-sensitive. The script will remove any dummy atoms (indicated by ` x ` or ` X ` ), but any ghost atoms will need to be removed manually.
55
58
56
59
By default, the program will use the mass corresponding to the most abundant isotopologue for the indicated atom. To use a different mass for an atom, there are two options. You may append the atomic mass number (as an integer) to the end of the respective line in the input file, or you may pass the desired mass numbers for particular atoms using the ` -i ` /` --isotopes ` flag. Atoms are specified by their index, starting from 0, followed by a dash and finally the mass number. For example, to change the first carbon atom (0) to $^{13}\text{C}$, the oxygen (2) to $^{18}\text{O}$, and the last three hydrogens (4, 5, and 6) to D, call the script with
57
- ``` moments.py examples/acetaldehyde.xyz -i 0-13,2-18,4-2,5-2,6-2 ```
60
+ ``` moments.py examples/acetaldehyde/acetaldehyde .xyz -i 0-13,2-18,4-2,5-2,6-2 ```
58
61
or edit the input file as follows:
59
62
```
60
63
7
@@ -68,45 +71,59 @@ H -1.7051140 0.2178780 0.8795140 2
68
71
H -1.7052250 0.2181590 -0.8793310 2
69
72
```
70
73
71
- If the molecule contains a methyl group , the program can be used to additional compute internal rotation parameters relevant for the RAM Hamiltonian (e.g., $\rho$, $F$, $D_ {ab}$, etc). To do so, use the ` -m ` /` --ch3 ` / ` --methyl ` flad and pass the indices of the methyl atoms in a comma-delimited list. For example,
72
- ``` moments.py examples/acetaldehyde.xyz -m 1,4,5,6 ```
74
+ If the molecule contains an internal rotor , the program can be used to additional compute internal rotation parameters relevant for the RAM Hamiltonian (e.g., $\rho$, $F$, $D_ {ab}$, etc). To do so, use the ` -r ` /` --rotor ` flag and pass the indices of the rotor in a comma-delimited list. For example,
75
+ ``` moments.py examples/acetaldehyde/acetaldehyde .xyz -r 1,4,5,6 ```
73
76
The list must contain exactly 4 atoms, and the atom numbering starts at 0. This may produce the following output:
74
77
```
75
- ./moments.py examples/acetaldehyde.xyz -m 1,4,5,6
76
78
Initial coordinates
77
- Atom Mass X (A) Y (A) Z (A)
78
- C 12.000000 0.23187200 0.40202100 -0.00000100
79
- C 12.000000 -1.16929900 -0.14928500 -0.00000100
80
- O 15.994915 1.23481800 -0.27776300 0.00000100
81
- H 1.007825 0.30482900 1.50721500 -0.00000400
82
- H 1.007825 -1.14847500 -1.23756000 -0.00017600
83
- H 1.007825 -1.70511400 0.21787800 0.87951400
84
- H 1.007825 -1.70522500 0.21815900 -0.87933100
79
+ Atom Mass X (A) Y (A) Z (A)
80
+ C 12.000000 0.13614694 0.41789221 -0.00000089
81
+ C 12.000000 -1.26502406 -0.13341379 -0.00000089
82
+ O 15.994915 1.13909294 -0.26189179 0.00000111
83
+ H 1.007825 0.20910394 1.52308621 -0.00000389
84
+ H 1.007825 -1.24420006 -1.22168879 -0.00017589
85
+ H 1.007825 -1.80083906 0.23374921 0.87951411
86
+ H 1.007825 -1.80095006 0.23403021 -0.87933089
85
87
86
88
Principal Axis Coordinates
87
- Atom Mass a (A) b (A) c (A)
88
- C 12.000000 -0.13614694 -0.41789221 -0.00000099
89
- C 12.000000 1.26502406 0.13341379 0.00000007
90
- O 15.994915 -1.13909294 0.26189179 0.00000025
91
- H 1.007825 -0.20910394 -1.52308621 -0.00000403
92
- H 1.007825 1.24420006 1.22168879 -0.00017496
93
- H 1.007825 1.80083839 -0.23374920 0.87951547
94
- H 1.007825 1.80095072 -0.23403022 -0.87932953
89
+ Atom Mass a (A) b (A) c (A)
90
+ C 12.000000 -0.12530134 0.42127125 -0.00000075
91
+ C 12.000000 1.26115353 -0.16606288 -0.00000048
92
+ O 15.994915 -1.14548087 -0.23236526 0.00000057
93
+ H 1.007825 -0.16967101 1.52798162 -0.00000329
94
+ H 1.007825 1.21221079 -1.25343619 -0.00017596
95
+ H 1.007825 1.80627829 0.18712934 0.87951489
96
+ H 1.007825 1.80639719 0.18740814 -0.87933011
97
+
98
+ Interatomic Distance Matrix (A)
99
+
100
+ C0 C1 O2 H3 H4 H5 H6
101
+ C0 0.000 1.506 1.212 1.108 2.143 2.135 2.135
102
+ C1 1.506 0.000 2.408 2.217 1.088 1.093 1.093
103
+ O2 1.212 2.408 0.000 2.013 2.569 3.108 3.109
104
+ H3 1.108 2.217 2.013 0.000 3.106 2.545 2.545
105
+ H4 2.143 1.088 2.569 3.106 0.000 1.789 1.789
106
+ H5 2.135 1.093 3.108 2.545 1.789 0.000 1.759
107
+ H6 2.135 1.093 3.109 2.545 1.789 1.759 0.000
95
108
96
109
Principal Axis Rotational Constants
97
- A 56847.1872 MHz
98
- B 10126.3203 MHz
99
- C 9076.5140 MHz
110
+ A 56847.1872 MHz
111
+ B 10126.3203 MHz
112
+ C 9076.5140 MHz
100
113
------------------------
101
- A 1.896218057 cm-1
102
- B 0.337777686 cm-1
103
- C 0.302759918 cm-1
114
+ A 1.896218057 cm-1
115
+ B 0.337777686 cm-1
116
+ C 0.302759918 cm-1
104
117
105
- Inertial Defect: -3.117742846 amu A^2
118
+ Second moments and Inertial Defect
119
+ Paa 48.348596977 amu A^2
120
+ Pbb 7.331260768 amu A^2
121
+ Pcc 1.558871423 amu A^2
122
+ Delta -3.117742846 amu A^2
106
123
107
- CH3 atoms: [1 4 5 6]
124
+ Rotor atoms: [1 4 5 6]
108
125
109
- CH3 Rotational Constants
126
+ Rotor Rotational Constants
110
127
A 267664.4874 MHz
111
128
B 257627.4898 MHz
112
129
C 158361.3753 MHz
@@ -117,98 +134,120 @@ C 5.282366888 cm-1
117
134
118
135
I_alpha = 3.191302
119
136
120
- CH3 Axis
121
- lambda_a -0.9302968
122
- lambda_b -0.3668076
123
- lambda_c -0.0000008
137
+ Rotor Axis
138
+ lambda_a -0.9205062
139
+ lambda_b 0.3907280
140
+ lambda_c -0.0000002
141
+
142
+ Rotor Axis angle with respect to principal axes
143
+ theta_a 0.3907280 rad
144
+ theta_b 0.9205062 rad
145
+ theta_c 1.0000000 rad
146
+ ------------------------
147
+ theta_a 22.38706 deg
148
+ theta_b 52.74112 deg
149
+ theta_c 57.29578 deg
124
150
125
151
rho Axis
126
- rho_a -0.3339498
127
- rho_b -0.0234553
152
+ rho_a -0.3304353
153
+ rho_b 0.0249849
128
154
rho_c -0.0000000
129
- r 0.6807239
155
+ r 0.6860700
130
156
131
157
RAM Rotation Vector
132
- Ra 0.0000000 rad
133
- Rb 0.0000001 rad
134
- Rc -0.0700634 rad
158
+ Ra - 0.0000000 rad
159
+ Rb 0.0000000 rad
160
+ Rc 0.0753967 rad
135
161
------------------------
136
- Ra 0.00000 deg
137
- Rb 0.00001 deg
138
- Rc -4.01433 deg
162
+ Ra - 0.00000 deg
163
+ Rb 0.00000 deg
164
+ Rc 4.31991 deg
139
165
140
166
Rho Axis System Parameters
141
- rho 0.334772538
142
- F 232636.7064 MHz
143
- A_ram 56707.7165 MHz
144
- B_ram 10101.4760 MHz
167
+ rho 0.331378528
168
+ F 230823.9398 MHz
169
+ A_ram 56685.6851 MHz
170
+ B_ram 10097.5515 MHz
145
171
C_ram 9076.5140 MHz
146
- D_ab -3979.6467 MHz
147
- D_bc - 0.0000 MHz
148
- D_ac -0.0074 MHz
172
+ D_ab 4282.0325 MHz
173
+ D_bc 0.0000 MHz
174
+ D_ac -0.0024 MHz
149
175
------------------------
150
- F 7.759925249 cm-1
151
- A_ram 1.891565814 cm-1
152
- B_ram 0.336948971 cm-1
176
+ F 7.699457864 cm-1
177
+ A_ram 1.890830926 cm-1
178
+ B_ram 0.336818064 cm-1
153
179
C_ram 0.302759918 cm-1
154
- D_ab -0.132746727 cm-1
155
- D_bc -0.000000002 cm-1
156
- D_ac -0.000000247 cm-1
180
+ D_ab 0.142833228 cm-1
181
+ D_bc 0.000000001 cm-1
182
+ D_ac -0.000000081 cm-1
157
183
```
158
- Along with the image:
159
- ![ acetaldehyde xyz-coords] ( https://github.com/kncrabtree/moments/assets/20146313/dbcdabd1-8e6f-4125-b81e-a13e95c7192b )
184
+ Along with the images:
185
+ ![ acetaldehyde-ab] ( https://github.com/kncrabtree/moments/assets/20146313/e56e6e17-7ec7-47a0-9b27-fb1585d970bc )
186
+ ![ acetaldehyde-ac] ( https://github.com/kncrabtree/moments/assets/20146313/cb9a4b71-0f48-4a71-8d71-806f74f434e0 )
187
+ ![ acetaldehyde-bc] ( https://github.com/kncrabtree/moments/assets/20146313/26c1115d-d6c2-4734-9ba8-0445a1d4bbe4 )
188
+
160
189
161
190
and the following csv data:
162
191
```
163
- param,value,unit
164
- ,examples/acetaldehyde.xyz,
165
- A,56847.187226472546,MHz
166
- B,10126.320275093807,MHz
167
- C,9076.514014305507,MHz
168
- A,1.896218057175826,cm-1
169
- B,0.33777768602483677,cm-1
170
- C,0.3027599184735163,cm-1
171
- ID,-3.11774284610439,amu A^2
172
- A (CH3),267664.48741650145,MHz
173
- B (CH3),257627.4897580687,MHz
174
- C (CH3),158361.3753446761,MHz
175
- A (CH3),8.928326256176247,cm-1
176
- B (CH3),8.593528051932136,cm-1
177
- C (CH3),5.282366888118183,cm-1
178
- I_alpha,3.1913022227893046,amu A^2
179
- lambda_a,-0.9302968186550009,
180
- lambda_b,-0.3668076187864764,
181
- lambda_c,-7.614760184693406e-07,
182
- rho_a,-0.3339498492682833,
183
- rho_b,-0.023455286486947332,
184
- rho_c,-4.364415084266244e-08,
185
- r,0.680723939851134,
186
- Ra,0.0,rad
187
- Rb,1.3036956700683567e-07,rad
188
- Rc,-0.0700633529186581,rad
189
- Ra,0.0,deg
190
- Rb,7.469625966439669e-06,deg
191
- Rc,-4.014334420774707,deg
192
- rho,0.3347725381367113,
193
- F,232636.70641480276,MHz
194
- A_ram,56707.71647091714,MHz
195
- B_ram,10101.47602846236,MHz
196
- C_ram,9076.51401430543,MHz
197
- D_ab,-3979.6467450821065,MHz
198
- D_bc,-4.6228642236308716e-05,MHz
199
- D_ac,-0.0074050812783519,MHz
200
- F,7.7599252485131816,cm-1
201
- A_ram,1.891565813537482,cm-1
202
- B_ram,0.33694897115998695,cm-1
203
- C_ram,0.3027599184735138,cm-1
204
- D_ab,-0.13274672657315836,cm-1
205
- D_bc,-1.5420215219793394e-09,cm-1
206
- D_ac,-2.4700692364822266e-07,cm-1
207
- C0,12.0,amu
208
- C1,12.0,amu
209
- O2,15.99491461926,amu
210
- H3,1.007825031898,amu
211
- H4,1.007825031898,amu
212
- H5,1.007825031898,amu
213
- H6,1.007825031898,amu
192
+ param,value,unit,comment
193
+ ,acetaldehyde.xyz,,
194
+ A,56847.187226472546,MHz,PAM Rotational Constant
195
+ B,10126.320275093807,MHz,PAM Rotational Constant
196
+ C,9076.514014305507,MHz,PAM Rotational Constant
197
+ A,1.896218057175826,cm-1,PAM Rotational Constant
198
+ B,0.33777768602483677,cm-1,PAM Rotational Constant
199
+ C,0.3027599184735163,cm-1,PAM Rotational Constant
200
+ Paa,48.348596977334196,amu A^2,PAM Second Moment
201
+ Pbb,7.33126076815131,amu A^2,PAM Second Moment
202
+ Pcc,1.5588714230521958,amu A^2,PAM Second Moment
203
+ Delta,-3.11774284610439,amu A^2,PAM Intertial Defect
204
+ Rotor,[1 4 5 6],,Atoms in rotor
205
+ A (rotor),267664.4874165015,MHz,Rotational Constant of Rotor Atoms
206
+ B (rotor),257627.48975806867,MHz,Rotational Constant of Rotor Atoms
207
+ C (rotor),158361.37534467614,MHz,Rotational Constant of Rotor Atoms
208
+ A (rotor),8.928326256176248,cm-1,Rotational Constant of Rotor Atoms
209
+ B (rotor),8.593528051932136,cm-1,Rotational Constant of Rotor Atoms
210
+ C (rotor),5.282366888118184,cm-1,Rotational Constant of Rotor Atoms
211
+ I_alpha,3.191302222789304,amu A^2,Rotor Moment of Inertia
212
+ lambda_a,-0.9205061977077206,,Direction Cosine of Rotor
213
+ lambda_b,0.39072796160706763,,Direction Cosine of Rotor
214
+ lambda_c,-2.4654801908661045e-07,,Direction Cosine of Rotor
215
+ rho_a,-0.3304352974349079,,Component of rho Axis
216
+ rho_b,0.024984858025235254,,Component of rho Axis
217
+ rho_c,-1.4130949201270074e-08,,Component of rho Axis
218
+ r,0.6860699781225276,,r Parameter for F Calculation
219
+ rho_Ra,-0.0,rad,Rotation Angle for PAM-RAM Transformation
220
+ rho_Rb,4.264292342655292e-08,rad,Rotation Angle for PAM-RAM Transformation
221
+ rho_Rc,0.07539673184145645,rad,Rotation Angle for PAM-RAM Transformation
222
+ rho_Ra,-0.0,deg,Rotation Angle for PAM-RAM Transformation
223
+ rho_Rb,2.4432595384410292e-06,deg,Rotation Angle for PAM-RAM Transformation
224
+ rho_Rc,4.319914523595083,deg,Rotation Angle for PAM-RAM Transformation
225
+ theta_a,0.3907279616071454,rad,Total Rotaton Angle between Rotor and Principal Axis
226
+ theta_b,0.9205061977077537,rad,Total Rotaton Angle between Rotor and Principal Axis
227
+ theta_c,0.9999999999999697,rad,Total Rotaton Angle between Rotor and Principal Axis
228
+ theta_a,22.387063137839096,deg,Total Rotaton Angle between Rotor and Principal Axis
229
+ theta_b,52.74112014428922,deg,Total Rotaton Angle between Rotor and Principal Axis
230
+ theta_c,57.29577951308059,deg,Total Rotaton Angle between Rotor and Principal Axis
231
+ rho,0.3313785281538884,,Magnitude of rho Vector
232
+ F,230823.93982322578,MHz,Torsion-Rotational Constant
233
+ A_ram,56685.68508584902,MHz,RAM Rotational Constant
234
+ B_ram,10097.55152714237,MHz,RAM Rotational Constant
235
+ C_ram,9076.5140143055,MHz,RAM Rotational Constant
236
+ D_ab,4282.032450784462,MHz,RAM Off-Diagonal Rotational Constant
237
+ D_bc,1.6271043664738374e-05,MHz,RAM Off-Diagonal Rotational Constant
238
+ D_ac,-0.002421834175687916,MHz,RAM Off-Diagonal Rotational Constant
239
+ F,7.6994578637207,cm-1,Torsion-Rotational Constant
240
+ A_ram,1.890830925634861,cm-1,RAM Rotational Constant
241
+ B_ram,0.3368180638867963,cm-1,RAM Rotational Constant
242
+ C_ram,0.3027599184735161,cm-1,RAM Rotational Constant
243
+ D_ab,0.14283322800550444,cm-1,RAM Off-Diagonal Rotational Constant
244
+ D_bc,5.427435957958079e-10,cm-1,RAM Off-Diagonal Rotational Constant
245
+ D_ac,-8.07836925533302e-08,cm-1,RAM Off-Diagonal Rotational Constant
246
+ C0,12.0,amu,"-0.12530134,0.42127125,-0.00000075"
247
+ C1,12.0,amu,"1.26115353,-0.16606288,-0.00000048"
248
+ O2,15.99491461926,amu,"-1.14548087,-0.23236526,0.00000057"
249
+ H3,1.007825031898,amu,"-0.16967101,1.52798162,-0.00000329"
250
+ H4,1.007825031898,amu,"1.21221079,-1.25343619,-0.00017596"
251
+ H5,1.007825031898,amu,"1.80627829,0.18712934,0.87951489"
252
+ H6,1.007825031898,amu,"1.80639719,0.18740814,-0.87933011"
214
253
```
0 commit comments