示例#1
0
def trajectory():
    # 1.  Parse a series of FMS90 trajectories that Hayley has run for ethylene
    trajs = [
        ap.parse_fms90(Path(__file__).parent / "test_data" / f"000{x}")
        for x in [2, 3]
    ]
    # 2. Merge the trajectories into one super-big Trajectory with uniform weights
    traj = ap.Trajectory.merge(trajs,
                               ws=[1.0 / len(trajs)] * len(trajs),
                               labels=[2, 3])

    # 3. Interpolate trajectory with ~1 fs intervals, removing adaptive timesteps from AIMS
    ts = np.arange(0.0, max(traj.ts), 40.0)
    traj = traj.interpolate_nearest(ts)
    yield traj
示例#2
0
def test():

    # => Make a trajectory object <= #

    ICs = [3]
    trajs = [
        ai.parse_fms90("/home/monikaw/chem/o-np/6-aims/%04d/1-run" % x)
        for x in ICs
    ]

    # Merge the trajectories into one super-big Bundle with uniform weights
    traj = ai.Bundle.merge(trajs, [1.0 / len(trajs)] * len(trajs), labels=ICs)

    # Compute properties at ~1 fs intervals, removing nonsense due to adaptive timesteps
    ts = np.arange(np.min(traj.ts), np.max(traj.ts), 800.0)
    traj = traj.interpolate_linear(ts)
    print(f"nframes: {len(traj.ts)}")

    vis_aims(traj, )
示例#3
0
import get_dyson
import get_molpro
import numpy as np

import aimsprop as ai

# => Parse/Align/Weight/Clean <= #

# Parse a series of FMS90 trajectories that Hayley has run for Stilbene
# Troubles: 11, 12 (not finished), 15
# trajs = [ai.parse_fms90('/home/hweir/stilbene/5-aims/s0_extension/aims_%04d/job1' % x) for x in range(1,16+1) if x not in [11, 12, 15]]
trajs = [
    ai.parse_fms90("/home/hweir/stilbene/5-aims/s0_extension/aims_%04d/job1" %
                   x) for x in [1]
]
# TODO: Align trajectories to IC transition dipole moment (on z) and weight by oscillator strength at IC
# Merge the trajectories into one super-big Bundle with uniform weights
traj = ai.Bundle.merge(trajs, [1.0 / len(trajs)] * len(trajs))
# Compute properties at ~10 fs intervals, removing nonsense due to adaptive timesteps
ts = np.arange(0.0, max(traj.ts), 400.0)  # TODO: Cleaner edges
traj = traj.interpolate_nearest(ts)

# => Obtain Ionization Potential with Molpro (user defined process) <= #

# divide molpro calculations into reasonable number of jobs
njobs = 25

# molpro reference input files
neutral_input = "/home/monikaw/examples/pes_stilbene/ref/neutral.dat"
cation_input = "/home/monikaw/examples/pes_stilbene/ref/cation.dat"
示例#4
0
import numpy as np

import aimsprop as ai

# => Parse/Align/Weight/Clean <= #

# Parse a series of FMS90 trajectories that Hayley has run for Stilbene
# Troubles: 11, 12 (not finished), 15
# trajs = [ai.parse_fms90('/home/hweir/stilbene/5-aims/s0_extension/aims_%04d/job1' % x) for x in range(1,16+1) if x not in [11, 12, 15]]
trajs = [
    ai.parse_fms90("/home/parrish/chem/stil/6-aims/%04d" % x) for x in [1, 2]
]
# TODO: Align trajectories to IC transition dipole moment (on z) and weight by oscillator strength at IC
# Merge the trajectories into one super-big Bundle with uniform weights
traj = ai.Bundle.merge(trajs,
                       ws=[1.0 / len(trajs)] * len(trajs),
                       labels=[1, 2])
# Compute properties at ~1 fs intervals, removing nonsense due to adaptive timesteps
ts = np.arange(0.0, max(traj.ts), 400.0)  # TODO: Cleaner edges
traj = traj.interpolate_nearest(ts)

# => Tag with X-Ray Scattering Signal <= #

# Grab form factors for all atoms in this trajectory
factors = ai.iam.AtomicFormFactor.build_factors(traj.frames[0], mode="xray")
# The q values to compute scattering cross section at (in A^-1)
q = np.linspace(0.5, 3.0, 100)
# Compute the diffraction pattern moments (l=0,2,4)
ai.iam.compute_diffraction_moments(
    traj=traj,
    key="xray",
示例#5
0
import numpy as np

import aimsprop as ai

# Parse a series of FMS90 trajectories that Hayley has run for Stilbene
trajs = [ai.parse_fms90("/u/hweir/138253", cutoff_time=18000.0)]
# Merge the trajectories into one super-big Trajectory with uniform weights
traj = ai.Trajectory.merge(trajs, [1.0 / len(trajs)] * len(trajs))
# Compute properties at ~1 fs intervals, removing nonsense due to adaptive timesteps
ts = np.arange(0.0, 18000.1, 40.0)  # TODO: Cleaner edges
traj = traj.interpolate_nearest(ts)

# => Showoff Plot of Bond Distances (Spaghetti + Blur) <= #

# Compute the a bond distance property for all Frames in traj
# This particular bond is the one that leads to a three-ring complex
ai.compute_bond(traj, "R01", 7, 8)

# Blur the bond distance
R = np.linspace(1.0, 6.0, 50)
ai.blur_property(traj, "R01", "Rblur", R, alpha=8.0)

# Plot the heat map of blurred bond distance
# ai.plot_vector('R2.pdf', traj, 'Rblur', y=R, ylabel=r'$R [\AA{}]$', time_units='fs', twosided=False, cmap=plt.get_cmap('viridis'))
ai.plot_vector("R.pdf",
               traj,
               "Rblur",
               y=R,
               ylabel=r"$R [\AA{}]$",
               time_units="fs",
               nlevel=64)