-
Notifications
You must be signed in to change notification settings - Fork 0
TrjScreen
This is a bundle of tests: first test on Mulliken charges to detect very sudden fluctuations (mostly unphysical) during laser pulse; second test on total energy to detect very sudden jumps during and after laser pulse, such occurrence usually signifies an abrupt change of electronic state, which should be excluded from future calculations.
-
TrjScreen.mlk_test(mlk, mlk_trunc=True, n_cutoff=374, charge_threshold=0.9, n_threshold=94)
This tests Mulliken charges to detect very sudden fluctuations (mostly unphysical) during laser pulse. If the Mulliken charge of a certain atom goes from -charge_threshold to +charge_threshold (or +charge_threshold to -charge_threshold) within n_threshold time steps, the entire trajectory fails the test and its file number will be recorded.- Parameters:
- mlk: numpy array
first argument. The input Mulliken Charge array upon which this test is applied. - mlk_trunc: bool
optional, default=True. Flag for turning on truncating mlk array. This is required for mlk array that is either a python list or numpy npz package file. - n_cutoff: positive integer
optional, default=374. The number of points, i.e. time steps, of the laser pulse duration. - n_threshold: positive integer
optional, default=94. The number of points, i.e. time steps, of the threshold fluctuation window. Usually this is set to the duration of one laser cycle. - charge_threshold: positive float
optional, default=0.9. The charge threshold to determine if the charge value is "too extreme", i.e. the window of charge fluctuation is defined as < -charge_threshold to > +charge_threshold.
- mlk: numpy array
- Returns: a numpy array with bool values. True value means the trajectory failed this test, False means it passed.
- CAUTION: This method involves two n*n matrices, where n = n_atoms * n_trj * n_time_steps. Therefore it is potentially extremely memory demanding. This is a drawback of implementing this function in a completely vectorized fashion.
- Parameters:
-
TrjScreen.ejump_whitelist(etot, mlk_test_result=None, n_cutoff=374, threshold=0.01, pre_thresh=100)
This detects unphysically large (defined by parameter threshold=0.01 in the same unit as input total energy array) energy jump AFTER the laser pulse duration, and DURING the laser pulse duration (threshold defined by threshold * pre_thresh). Any points, i.e. time steps, that passed such test will be recorded into a white list.- Parameters:
- etot: numpy npz package, numpy array, python list
first argument. The array that contains the energy data, usually the total energy. - mlk_test_result: numpy array.
optional, default=None, which signifies all trajectories are to be considered as being passed such test. This is the result from the previous test. Any trajectory that did not pass this test is entirely excluded from the white list, i.e. an array with all elements being False will be representing this trajectory. - n_cutoff: positive integer
optional, default=374. The number of points, i.e. time steps, of the laser pulse duration. The distinction between during and after the laser pulse is important since the energy jump threshold is set differently according to the next two parameters, threshold=0.01 and pre_thresh=100. - threshold: positive float
optional, default=0.01. The threshold that determines an unphysically large energy jump occurs, in the same unit as input energy array, after the laser pulse. - pre_thresh: positive integer, positive float
optional, default=100. The ratio by which the threshold that determines an unphysically large energy jump occurs during the laser pulse. The actual threshold is threshold * pre_thresh.
- etot: numpy npz package, numpy array, python list
- Returns: a list of numpy arrays, each of which is a bool white list that signifies the points that behaved properly, value=True, or improperly, value=False.
- Note: if laser pulse is not present, specify n_cutoff to 1 instead of 0. Since n_cutoff=0 means no screening will be done to the data.
- Parameters:
-
TrjScreen.screen_bundle(etot, mlk=None, mlk_test_results=None, mlk_trunc=True, n_cutoff=374, charge_threshold=0.9, n_threshold=94, threshold=0.01, pre_thresh=100)
This method combines the previous two tests. All the parameters are kept the same as in the previous two methods.