pele.utils.optim_compatibility#

Module source

tools for reading and writing OPTIM input and output files

pele.utils.optim_compatibility.read_points_min_ts()

Source

def read_points_min_ts(fname, ndof=None, endianness="="):

read coords from a points.min or a points.ts file

Parameters:
fnamestr

filenname to read from

ndofint, optional

for testing to make sure the number of floats read is a multiple of ndof

endiannessstr

define the endianness of the data. can be “=”, “<”, “>”

Notes

the files were written with fortran code that looks something like this:

NOPT = 3 * NATOMS
INQUIRE(IOLENGTH=NDUMMY) COORDS(1:NOPT)
OPEN(13,FILE='points.min,ACCESS='DIRECT',FORM='UNFORMATTED',STATUS='UNKNOWN',RECL=NDUMMY)
DO J1=1,NMIN
    WRITE(13,REC=J1) COORDS(1:NOPT)
ENDDO
CLOSE(13)

This means the data is stored without any header information. It is just a long list of double precision floating point numbers.

Note that some fortran compilers use different endiness for the data. If the coordinates comes out garbage this is probably the problem. The solution is to pass a different data type

dtype=np.dtype(“<d”) # for little-endian double precision dtype=np.dtype(“>d”) # for big-endian double precision

pele.utils.optim_compatibility.write_points_min_ts()

Source

def write_points_min_ts(fout, x, endianness="="):

write coords to a points.min or a points.ts file

class pele.utils.optim_compatibility.OptimDBConverter

Source

class OptimDBConverter:

converts PATHSAMPLE to pele database

Parameters:
databasepele Database

the minima and transition states will be place in here

ndofint, optional

for testing to make sure the number of floats read is a multiple of ndof

mindata, tsdata, pointsmin, pointstsstr

the files to read from. The files contain

points.min : the coordinates of the minima in binary format min.data : additional information about the minima (like the energy) points.ts : the coordinates of the transition states min.ts : additional information about transition states (like which minima they connect)

endiannessstr

define the endianness of the binary data. can be “=”, “<”, “>”

assert_coordsbool

If this is True the conversion will abort if the coordinate conversion doesn’t work. Set this to false if you only care about the minima and ts metadata.

Notes

the files were written with fortran code that looks something like this:

NOPT = 3 * NATOMS
INQUIRE(IOLENGTH=NDUMMY) COORDS(1:NOPT)
OPEN(13,FILE='points.min,ACCESS='DIRECT',FORM='UNFORMATTED',STATUS='UNKNOWN',RECL=NDUMMY)
DO J1=1,NMIN
    WRITE(13,REC=J1) COORDS(1:NOPT)
ENDDO
CLOSE(13)

This means the data is stored without any header information. It is just a long list of double precision floating point numbers.

Note that some fortran compilers use different endiness for the data. If the coordinates comes out garbage this is probably the problem. The solution is to pass a different data type

dtype=np.dtype(“<d”) # for little-endian double precision dtype=np.dtype(“>d”) # for big-endian double precision

OptimDBConverter.ReadMinDataFast()

Source

def ReadMinDataFast(self):

read min.data file

this method uses bulk database inserts. It is MUCH faster this way, but you have to be careful that this and the Minimum object stays in sync. e.g. minimum.invalid must be set to false manually here.

OptimDBConverter.ReadTSdataFast()

Source

def ReadTSdataFast(self):

read ts.data file

this method uses bulk database inserts. It is MUCH faster this way, but you have to be careful that this and the TransitionState object stays in sync. e.g. ts.invalid must be set to false manually here.

OptimDBConverter.convert()

Source

def convert(self):

convert pathsample database to pele database

OptimDBConverter.convert_no_coords()

Source

def convert_no_coords(self):

convert pathsample database to pele database without loading coordinates

class pele.utils.optim_compatibility.WritePathsampleDB

Source

class WritePathsampleDB:

converts PATHSAMPLE to pele database

Parameters:
databasepele Database

the minima and transition states will be read from here

mindata, tsdata, pointsmin, pointstsstr

the files to writen to. The files contain

points.min : the coordinates of the minima in binary format min.data : additional information about the minima (like the energy) points.ts : the coordinates of the transition states min.ts : additional information about transition states (like which minima they connect)

endiannessstr

define the endianness of the binary data. can be “=”, “<”, “>”

Notes

the files were written with fortran code that looks something like this:

NOPT = 3 * NATOMS
INQUIRE(IOLENGTH=NDUMMY) COORDS(1:NOPT)
OPEN(13,FILE='points.min,ACCESS='DIRECT',FORM='UNFORMATTED',STATUS='UNKNOWN',RECL=NDUMMY)
DO J1=1,NMIN
    WRITE(13,REC=J1) COORDS(1:NOPT)
ENDDO
CLOSE(13)

This means the data is stored without any header information. It is just a long list of double precision floating point numbers.

Note that some fortran compilers use different endiness for the data. If the coordinates comes out garbage this is probably the problem. The solution is to pass a different data type

dtype=np.dtype(“<d”) # for little-endian double precision dtype=np.dtype(“>d”) # for big-endian double precision