Conversation
calcPath is the a directory containing rotor calculations named: scangeom_{name}_{phi1}_{phi2}.out and input files scangeom_{name}_{phi1}_{phi2}.gjf
automatically constructs a directory based on self.name to run Q2DTor in
…n the energy levels of the 2D-NS partition function
…rotors so that statmech properties can be calculated
Codecov Report
@@ Coverage Diff @@
## master #1585 +/- ##
==========================================
+ Coverage 41.58% 41.59% +0.01%
==========================================
Files 176 176
Lines 29147 29147
Branches 5995 5995
==========================================
+ Hits 12120 12125 +5
+ Misses 16187 16183 -4
+ Partials 840 839 -1
Continue to review full report at Codecov.
|
alongd
left a comment
There was a problem hiding this comment.
I haven't reviewed all commits yet, but wanted these comments to be uploaded for now. Perhaps take them into account when you modify the PR as you suggested offline?
| cdef class Conformer(RMGObject): | ||
| """ | ||
| A representation of an individual molecular conformation. The attributes | ||
| A representation of an individual molecular conformation. The attributes |
There was a problem hiding this comment.
Would you like to make a separate commit for all the white space fixes?
There was a problem hiding this comment.
white space changes removed
| pass | ||
|
|
||
|
|
||
| def readScan(self): |
There was a problem hiding this comment.
This is implemented for a 2D rotor (specifically from Q2DTor). Should the function name reflect that it's a 2D rotor?
There was a problem hiding this comment.
Sorry, I'll clean up the order...not sure how it got this out of order
| for f in os.listdir(self.calcPath): | ||
| if len(f.split('_')) != 4: | ||
| continue | ||
| s,name,phi1,phi2 = f.split('_') |
There was a problem hiding this comment.
Could you add a comment with an example of such a file name for easier future readability and debugging?
We're checking above for four _, but I see three in scangeom_{name}_{phi1}_{phi2}.out
There was a problem hiding this comment.
Splitting on three '_' will give you a four-tuple => (scangeom, name, phi1, phi2.out)
| Es.append(lg.software_log.loadEnergy()) | ||
| xyz,atnum,_ = lg.software_log.loadGeometry() | ||
| xyzs.append(xyz) | ||
| atnums.append(atnum) |
There was a problem hiding this comment.
atom numbers shouldn't change. Do you think we can just parse it once?
There was a problem hiding this comment.
I don't think you can really avoid parsing it, but I can just store it once.
| ' based on the {3}.'.format(symmetry, label, pivots, reason)) | ||
| return symmetry | ||
|
|
||
| class HinderedRotor2D(Mode): |
There was a problem hiding this comment.
Should this go to rmgpy.statmech.mode?
There was a problem hiding this comment.
It would make most sense to place it in rmgpy.statmech.torsion.pyx, but it creates a cyclic import I could resolve related to loading qm files, I think statmech.py is the best alternative, statmech.mode isn't in the first list of places I'd look for this in.
| write a .pes file for Q2DTor based on the | ||
| read in scans | ||
| """ | ||
| atdict = {x.number:x.symbol for x in elementList} |
There was a problem hiding this comment.
You can use common.symbol_by_number instead
| # Calculations # | ||
| #----------------------------------# | ||
| start_calcs | ||
| level hf 3-21g # the calculation level |
There was a problem hiding this comment.
Level doesn't actually do anything in our implementation, right?
There was a problem hiding this comment.
Nope, just a required part of the Q2DTor input file
| # Torsional PES # | ||
| #----------------------------------# | ||
| start_pes | ||
| t1step 10.0 # step in phi1 for scan calculation [degrees] |
There was a problem hiding this comment.
What if the user used a different step size?
There was a problem hiding this comment.
It's related to Q2DTor launching jobs, I automatically write the pes file so it doesn't matter.
| # Working temperatures # | ||
| #----------------------------------# | ||
| start_temperatures # | ||
| 100.0 150.0 200.0 # |
There was a problem hiding this comment.
What if the user cares about a different T range?
There was a problem hiding this comment.
The temperature range is unimportant because it's only used by Q2DTor after you get the eigenvalues, I just take the eigenvalues and calculate everything ourselves once we have them.
| reads an available .evals file to get the QM energy levels | ||
| for the 2D-NS rotors | ||
| """ | ||
| f = open(os.path.join(self.q2dtor_path,'IOfiles',self.name+'.evals'),'rU') |
|
replaced by Multidimensional rotors |
This PR enables 2D dimensional coupled rotor calculations using the 2D-NS approximation within Arkane using the external software Q2DTor written by David Ferro Costas and Antonio Fernandez Ramos. It adds a wrapper class in Arkane for computing the statistical mechanical properties of 2D coupled rotors using Q2DTor and adds rotor processing for 2D coupled rotors.
Installing my fork of Q2DTor:
add to your .bashrc or .bash_profile (as appropriate):
export Q2DTor=/.../Q2DTor/src/Q2DTor.py(replacing ... with appropriate absolute path)I've added an example for calculating the thermo of CH2CHOOH. However the full example takes ~5-8 hours of time to run. The wrapper (HinderedRotor2D) automatically checks for the presence of the .evals output file from Q2DTor that contains the eigenvalues of the Hamiltonian. If it finds this file it automatically skips the calculations and uses the eigenvalues to compute statistical mechanical properties. To shorten the example I've added all of the Q2DTor output files to the example allowing it to find the .evals file and finish rapidly.
I haven't added the documentation yet, primarily because I haven't decided on answers to the following questions yet: