-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMolecule.html
371 lines (346 loc) · 25.9 KB
/
Molecule.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<html><head><title>Python: module Molecule</title>
</head><body bgcolor="#f0f0f8">
<table width="100%" cellspacing=0 cellpadding=2 border=0 summary="heading">
<tr bgcolor="#7799ee">
<td valign=bottom> <br>
<font color="#ffffff" face="helvetica, arial"> <br><big><big><strong>Molecule</strong></big></big></font></td
><td align=right valign=bottom
><font color="#ffffff" face="helvetica, arial"><a href=".">index</a><br><a href="file:/home/benedico/Dropbox/master/The Program/Molecule.py">/home/benedico/Dropbox/master/The Program/Molecule.py</a></font></td></tr></table>
<p></p>
<p>
<table width="100%" cellspacing=0 cellpadding=2 border=0 summary="section">
<tr bgcolor="#aa55cc">
<td colspan=3 valign=bottom> <br>
<font color="#ffffff" face="helvetica, arial"><big><strong>Modules</strong></big></font></td></tr>
<tr><td bgcolor="#aa55cc"><tt> </tt></td><td> </td>
<td width="100%"><table width="100%" summary="list"><tr><td width="25%" valign=top><a href="scipy.linalg.html">scipy.linalg</a><br>
<a href="numpy.html">numpy</a><br>
</td><td width="25%" valign=top><a href="os.html">os</a><br>
<a href="pdb.html">pdb</a><br>
</td><td width="25%" valign=top><a href="pydoc.html">pydoc</a><br>
<a href="re.html">re</a><br>
</td><td width="25%" valign=top><a href="read_input.html">read_input</a><br>
</td></tr></table></td></tr></table><p>
<table width="100%" cellspacing=0 cellpadding=2 border=0 summary="section">
<tr bgcolor="#ee77aa">
<td colspan=3 valign=bottom> <br>
<font color="#ffffff" face="helvetica, arial"><big><strong>Classes</strong></big></font></td></tr>
<tr><td bgcolor="#ee77aa"><tt> </tt></td><td> </td>
<td width="100%"><dl>
<dt><font face="helvetica, arial"><a href="Molecule.html#Molecule">Molecule</a>
</font></dt></dl>
<p>
<table width="100%" cellspacing=0 cellpadding=2 border=0 summary="section">
<tr bgcolor="#ffc8d8">
<td colspan=3 valign=bottom> <br>
<font color="#000000" face="helvetica, arial"><a name="Molecule">class <strong>Molecule</strong></a></font></td></tr>
<tr><td bgcolor="#ffc8d8"><tt> </tt></td><td> </td>
<td width="100%">Methods defined here:<br>
<dl><dt><a name="Molecule-__init__"><strong>__init__</strong></a>(self, name)</dt></dl>
<dl><dt><a name="Molecule-diagonalize"><strong>diagonalize</strong></a>(self, hessian)</dt><dd><tt>Computes the normal coordinates, eigenvalues and fundamental <br>
frequencies of the molecule. <br>
hessian: The hessian of the molecule as an np.array<br>
num_atoms_list: A list of the how many of each atoms type there are<br>
charge list: A list over the charges of the atoms in the molecle<br>
coordinates: The cartessian coordinates of the molecule as an np.array<br>
n_atoms: The number of atoms composing the molecule as an int<br>
masses: The masses of the atoms in a molecule along the diagonal of<br>
an np.array<br>
returns: The non-zero eigenvalues of the molecule as an np.array<br>
The normal coordinates of the molecule, ie. the eigenvectors<br>
corresponding the non-zero eigevalues as an np.array<br>
The fundalmental frequencies of the molecule as an np.array<br>
All the eigenvectos of the molecules, both the ones <br>
corresponding the zero and non-zero eigenvalues as an np.array</tt></dd></dl>
<dl><dt><a name="Molecule-effective_geometry_norm"><strong>effective_geometry_norm</strong></a>(self, cff_norm)</dt><dd><tt>Computes the effective geometry of a molecule.<br>
<br>
cff_norm: The cubic force field of the molecule in normal coordinates<br>
as an np.array<br>
frequencies: The fundamental frequencies of the molecule as an np.array<br>
n_atoms: The number of atoms constituting the molecule as an int<br>
return: The effective geometry in normal coordinates as an np.arrays</tt></dd></dl>
<dl><dt><a name="Molecule-get_coordinates"><strong>get_coordinates</strong></a>(self)</dt><dd><tt>Returns the number of coordinates of the molecule</tt></dd></dl>
<dl><dt><a name="Molecule-get_cubic_force_field_name"><strong>get_cubic_force_field_name</strong></a>(self)</dt><dd><tt>Returns the name of the file containing the cubic force field<br>
of the molecule</tt></dd></dl>
<dl><dt><a name="Molecule-get_effective_geometry"><strong>get_effective_geometry</strong></a>(self)</dt><dd><tt>Converts normal coordinates into cartessian coordinates.<br>
<br>
normal coordinates: The normal coordinates of which are to be converted<br>
n_atoms: The number of atoms constituting the molecule as an int<br>
eigvec: The eigenvectors of the molecule corresponging to the non<br>
zero eigenvalues, can be attained for fundamental_freq() (np.array)<br>
returns: cartessian coordinates as an np.array.</tt></dd></dl>
<dl><dt><a name="Molecule-get_hessian"><strong>get_hessian</strong></a>(self)</dt><dd><tt>Returns the hessian of the molecule</tt></dd></dl>
<dl><dt><a name="Molecule-get_input_name"><strong>get_input_name</strong></a>(self)</dt><dd><tt>Returns the name of the directory the input files are to be <br>
read are found.</tt></dd></dl>
<dl><dt><a name="Molecule-get_molecule_input_name"><strong>get_molecule_input_name</strong></a>(self)</dt><dd><tt>Returns the name of the file containing the geometry of the<br>
molecule in cartessian coordinates</tt></dd></dl>
<dl><dt><a name="Molecule-get_number_of_normal_modes"><strong>get_number_of_normal_modes</strong></a>(self)</dt><dd><tt>Returns the number of normal modes of the molecule</tt></dd></dl>
<dl><dt><a name="Molecule-get_output_name"><strong>get_output_name</strong></a>(self)</dt><dd><tt>Returns the name of the directory the output information is to<br>
be saved in.</tt></dd></dl>
<dl><dt><a name="Molecule-hessian_trans_rot"><strong>hessian_trans_rot</strong></a>(self, hessian, cart_coord, nr_normal_modes, n_atoms)</dt><dd><tt>Projects the hessian of the molecule so that it can be used to <br>
determine the normal coordinates of the molecule. This projected<br>
hessian is referred to as the analystical hessian in DALTON<br>
<br>
hessian: The hessian of the molecule as an np.array<br>
nr_normal_modes: The number of normal modes of the molecule as an <br>
int<br>
n_atoms: The number of atoms the molecule consists of<br>
return: The projected hessian as a 2 dimensional matrix</tt></dd></dl>
<dl><dt><a name="Molecule-mass_hessian"><strong>mass_hessian</strong></a>(self, masses)</dt><dd><tt>Creates an np.array where the masses of the different atoms in<br>
the molecule are placed at the diagonal. This is a help function<br>
used to make a mass weighted hessian. <br>
masses: The masses of the atoms in the molecule, can be recieved<br>
from the read_molecule() function.<br>
returns: The masses alond the diagonal of a 2 dimensional np.array</tt></dd></dl>
<dl><dt><a name="Molecule-masswt_hessian"><strong>masswt_hessian</strong></a>(self, num_atoms_list, charge_list)</dt><dd><tt>Converts the hessian into the mass weighted hessian<br>
num_atoms_list: A list of the number of atoms of each type<br>
charge list: A list of the charges of each atom <br>
returns the mass weighted hessian (np.array)</tt></dd></dl>
<dl><dt><a name="Molecule-to_normal_coordinates_1D"><strong>to_normal_coordinates_1D</strong></a>(self)</dt><dd><tt>Converts 1D np.arrays from cartessian to normal coordinates, an <br>
example of this is the dipole moment gradients<br>
<br>
gradient = A 1 dimensional np.array <br>
returns: the 1 dimensional np.array in normal coordinates</tt></dd></dl>
<dl><dt><a name="Molecule-to_normal_coordinates_2D"><strong>to_normal_coordinates_2D</strong></a>(self)</dt></dl>
<dl><dt><a name="Molecule-to_normal_coordinates_3D"><strong>to_normal_coordinates_3D</strong></a>(self, cubic_force_field)</dt><dd><tt>Converts a cubic force field represented by cartessian coordinates<br>
into a cubic force field represented by normal coordinates<br>
<br>
cubic_force_field: A 3 dimenesional np.array of the cubic force field<br>
represented in cartessian coordinates<br>
self.<strong>eigenvectors_full</strong>: The eigenvectors of the molecule corresponding to the non-<br>
zero eigenvalues, can be attained for fundamental_freq() (np.array)<br>
n_atoms: The number of atoms constituting the molecule as an int<br>
returns: The cubic force field in normal coordinates (3D np.array)</tt></dd></dl>
<dl><dt><a name="Molecule-to_normal_coordinates_4D"><strong>to_normal_coordinates_4D</strong></a>(self, quartic_force_field)</dt><dd><tt>Converts a quartic force field represented by cartessina coordinates<br>
into a quartic force field represented by normal coordinates<br>
<br>
quartic_force_field: A 4 dimenesional np.array of the quartic force field<br>
represented in cartessian coordinates<br>
self.<strong>eigenvectors_full</strong>: The eigenvectors of the molecule corresponding to the non-<br>
zero eigenvalues, can be attained from fundamental_freq() (np.array)<br>
n_atoms: The number of atoms constituting the molecule as an int<br>
returns: The quartic force field in normal coordinates ( 4d np.array)</tt></dd></dl>
</td></tr></table></td></tr></table><p>
<table width="100%" cellspacing=0 cellpadding=2 border=0 summary="section">
<tr bgcolor="#eeaa77">
<td colspan=3 valign=bottom> <br>
<font color="#ffffff" face="helvetica, arial"><big><strong>Functions</strong></big></font></td></tr>
<tr><td bgcolor="#eeaa77"><tt> </tt></td><td> </td>
<td width="100%"><dl><dt><a name="-array"><strong>array</strong></a>(...)</dt><dd><tt><a href="#-array">array</a>(object, dtype=None, copy=True, order=None, subok=False, ndmin=0)<br>
<br>
Create an array.<br>
<br>
Parameters<br>
----------<br>
object : array_like<br>
An array, any object exposing the array interface, an<br>
object whose __array__ method returns an array, or any<br>
(nested) sequence.<br>
dtype : data-type, optional<br>
The desired data-type for the array. If not given, then<br>
the type will be determined as the minimum type required<br>
to hold the objects in the sequence. This argument can only<br>
be used to 'upcast' the array. For downcasting, use the<br>
.astype(t) method.<br>
copy : bool, optional<br>
If true (default), then the object is copied. Otherwise, a copy<br>
will only be made if __array__ returns a copy, if obj is a<br>
nested sequence, or if a copy is needed to satisfy any of the other<br>
requirements (`dtype`, `order`, etc.).<br>
order : {'C', 'F', 'A'}, optional<br>
Specify the order of the array. If order is 'C' (default), then the<br>
array will be in C-contiguous order (last-index varies the<br>
fastest). If order is 'F', then the returned array<br>
will be in Fortran-contiguous order (first-index varies the<br>
fastest). If order is 'A', then the returned array may<br>
be in any order (either C-, Fortran-contiguous, or even<br>
discontiguous).<br>
subok : bool, optional<br>
If True, then sub-classes will be passed-through, otherwise<br>
the returned array will be forced to be a base-class array (default).<br>
ndmin : int, optional<br>
Specifies the minimum number of dimensions that the resulting<br>
array should have. Ones will be pre-pended to the shape as<br>
needed to meet this requirement.<br>
<br>
Returns<br>
-------<br>
out : ndarray<br>
An array object satisfying the specified requirements.<br>
<br>
See Also<br>
--------<br>
empty, empty_like, zeros, zeros_like, ones, ones_like, fill<br>
<br>
Examples<br>
--------<br>
>>> np.<a href="#-array">array</a>([1, 2, 3])<br>
<a href="#-array">array</a>([1, 2, 3])<br>
<br>
Upcasting:<br>
<br>
>>> np.<a href="#-array">array</a>([1, 2, 3.0])<br>
<a href="#-array">array</a>([ 1., 2., 3.])<br>
<br>
More than one dimension:<br>
<br>
>>> np.<a href="#-array">array</a>([[1, 2], [3, 4]])<br>
<a href="#-array">array</a>([[1, 2],<br>
[3, 4]])<br>
<br>
Minimum dimensions 2:<br>
<br>
>>> np.<a href="#-array">array</a>([1, 2, 3], ndmin=2)<br>
<a href="#-array">array</a>([[1, 2, 3]])<br>
<br>
Type provided:<br>
<br>
>>> np.<a href="#-array">array</a>([1, 2, 3], dtype=complex)<br>
<a href="#-array">array</a>([ 1.+0.j, 2.+0.j, 3.+0.j])<br>
<br>
Data-type consisting of more than one element:<br>
<br>
>>> x = np.<a href="#-array">array</a>([(1,2),(3,4)],dtype=[('a','<i4'),('b','<i4')])<br>
>>> x['a']<br>
<a href="#-array">array</a>([1, 3])<br>
<br>
Creating an array from sub-classes:<br>
<br>
>>> np.<a href="#-array">array</a>(np.mat('1 2; 3 4'))<br>
<a href="#-array">array</a>([[1, 2],<br>
[3, 4]])<br>
<br>
>>> np.<a href="#-array">array</a>(np.mat('1 2; 3 4'), subok=True)<br>
matrix([[1, 2],<br>
[3, 4]])</tt></dd></dl>
<dl><dt><a name="-dot"><strong>dot</strong></a>(...)</dt><dd><tt><a href="#-dot">dot</a>(a, b, out=None)<br>
<br>
Dot product of two arrays.<br>
<br>
For 2-D arrays it is equivalent to matrix multiplication, and for 1-D<br>
arrays to inner product of vectors (without complex conjugation). For<br>
N dimensions it is a sum product over the last axis of `a` and<br>
the second-to-last of `b`::<br>
<br>
<a href="#-dot">dot</a>(a, b)[i,j,k,m] = sum(a[i,j,:] * b[k,:,m])<br>
<br>
Parameters<br>
----------<br>
a : array_like<br>
First argument.<br>
b : array_like<br>
Second argument.<br>
out : ndarray, optional<br>
Output argument. This must have the exact kind that would be returned<br>
if it was not used. In particular, it must have the right type, must be<br>
C-contiguous, and its dtype must be the dtype that would be returned<br>
for `<a href="#-dot">dot</a>(a,b)`. This is a performance feature. Therefore, if these<br>
conditions are not met, an exception is raised, instead of attempting<br>
to be flexible.<br>
<br>
Returns<br>
-------<br>
output : ndarray<br>
Returns the dot product of `a` and `b`. If `a` and `b` are both<br>
scalars or both 1-D arrays then a scalar is returned; otherwise<br>
an array is returned.<br>
If `out` is given, then it is returned.<br>
<br>
Raises<br>
------<br>
ValueError<br>
If the last dimension of `a` is not the same size as<br>
the second-to-last dimension of `b`.<br>
<br>
See Also<br>
--------<br>
vdot : Complex-conjugating dot product.<br>
tensordot : Sum products over arbitrary axes.<br>
einsum : Einstein summation convention.<br>
<br>
Examples<br>
--------<br>
>>> np.<a href="#-dot">dot</a>(3, 4)<br>
12<br>
<br>
Neither argument is complex-conjugated:<br>
<br>
>>> np.<a href="#-dot">dot</a>([2j, 3j], [2j, 3j])<br>
(-13+0j)<br>
<br>
For 2-D arrays it's the matrix product:<br>
<br>
>>> a = [[1, 0], [0, 1]]<br>
>>> b = [[4, 1], [2, 2]]<br>
>>> np.<a href="#-dot">dot</a>(a, b)<br>
<a href="#-array">array</a>([[4, 1],<br>
[2, 2]])<br>
<br>
>>> a = np.arange(3*4*5*6).reshape((3,4,5,6))<br>
>>> b = np.arange(3*4*5*6)[::-1].reshape((5,4,6,3))<br>
>>> np.<a href="#-dot">dot</a>(a, b)[2,3,2,1,2,2]<br>
499128<br>
>>> sum(a[2,3,2,:] * b[1,2,:,2])<br>
499128</tt></dd></dl>
<dl><dt><a name="-zeros"><strong>zeros</strong></a>(...)</dt><dd><tt><a href="#-zeros">zeros</a>(shape, dtype=float, order='C')<br>
<br>
Return a new array of given shape and type, filled with zeros.<br>
<br>
Parameters<br>
----------<br>
shape : int or sequence of ints<br>
Shape of the new array, e.g., ``(2, 3)`` or ``2``.<br>
dtype : data-type, optional<br>
The desired data-type for the array, e.g., `numpy.int8`. Default is<br>
`numpy.float64`.<br>
order : {'C', 'F'}, optional<br>
Whether to store multidimensional data in C- or Fortran-contiguous<br>
(row- or column-wise) order in memory.<br>
<br>
Returns<br>
-------<br>
out : ndarray<br>
Array of zeros with the given shape, dtype, and order.<br>
<br>
See Also<br>
--------<br>
zeros_like : Return an array of zeros with shape and type of input.<br>
ones_like : Return an array of ones with shape and type of input.<br>
empty_like : Return an empty array with shape and type of input.<br>
ones : Return a new array setting values to one.<br>
empty : Return a new uninitialized array.<br>
<br>
Examples<br>
--------<br>
>>> np.<a href="#-zeros">zeros</a>(5)<br>
<a href="#-array">array</a>([ 0., 0., 0., 0., 0.])<br>
<br>
>>> np.<a href="#-zeros">zeros</a>((5,), dtype=numpy.int)<br>
<a href="#-array">array</a>([0, 0, 0, 0, 0])<br>
<br>
>>> np.<a href="#-zeros">zeros</a>((2, 1))<br>
<a href="#-array">array</a>([[ 0.],<br>
[ 0.]])<br>
<br>
>>> s = (2,2)<br>
>>> np.<a href="#-zeros">zeros</a>(s)<br>
<a href="#-array">array</a>([[ 0., 0.],<br>
[ 0., 0.]])<br>
<br>
>>> np.<a href="#-zeros">zeros</a>((2,), dtype=[('x', 'i4'), ('y', 'i4')]) # custom dtype<br>
<a href="#-array">array</a>([(0, 0), (0, 0)],<br>
dtype=[('x', '<i4'), ('y', '<i4')])</tt></dd></dl>
</td></tr></table><p>
<table width="100%" cellspacing=0 cellpadding=2 border=0 summary="section">
<tr bgcolor="#55aa55">
<td colspan=3 valign=bottom> <br>
<font color="#ffffff" face="helvetica, arial"><big><strong>Data</strong></big></font></td></tr>
<tr><td bgcolor="#55aa55"><tt> </tt></td><td> </td>
<td width="100%"><strong>absolute</strong> = <ufunc 'absolute'><br>
<strong>add</strong> = <ufunc 'add'><br>
<strong>divide</strong> = <ufunc 'divide'><br>
<strong>multiply</strong> = <ufunc 'multiply'><br>
<strong>sqrt</strong> = <ufunc 'sqrt'><br>
<strong>subtract</strong> = <ufunc 'subtract'></td></tr></table>
</body></html>