Exemplo n.º 1
0
def NaWat3_linear_geom(x):
    # hf/aug-cc-pvdz optimized (H2O)_3Na+ cluster (higher-E stationary pt)
    # excursion of leftmost water in the O -- Na - OH - O configuration
    origin = [['Na', np.array([0.21087905, -1.07845876, -0.00384438])],
              ['O', np.array([-0.70376204, 3.26354462, -0.00020967])],
              ['H', np.array([-0.97394692, 3.75994642, -0.75799166])],
              ['H', np.array([-0.97895278, 3.76348016, 0.75329091])],
              ['O', np.array([-0.44282906, -3.23885333, 0.00243490])],
              ['H', np.array([-0.60917435, -3.78448428, 0.75766465])],
              ['H', np.array([-0.59937587, -3.79222625, -0.74928940])],
              ['O', np.array([0.97598687, 0.99264382, 0.00069382])],
              ['H', np.array([0.42857199, 1.77680728, 0.00287819])],
              ['H', np.array([1.87069029, 1.29765224, 0.00193479])]]

    r_na = origin[0][1]
    r_o = origin[4][1]
    line = r_o - r_na
    line = line / np.linalg.norm(line)

    origin[4][1] += x * line
    origin[5][1] += x * line
    origin[6][1] += x * line
    g = []
    for atom in origin:
        g.append([atom[0]])
        g[-1].extend(list(atom[1]))
    # recommend scanning np.linspace(-0.2, 1.0, 11)
    geom.load_geometry(g)
Exemplo n.º 2
0
def NaWat3_triangle_geom(x):
    # hf/aug-cc-pvdz optimized (H2O)_3Na+ cluster (lower-E stationary pt)
    # excursion of Na atom normal to the O-O-O plane
    origin = '''Na     -0.00000166     0.00006962     0.00049518
     O      -1.51025934     1.71557888     0.00059985
     H      -1.44772201     2.53265513     0.47371767
     H      -2.32859634     1.75777493    -0.47258270
     O       2.24074836     0.45075145     0.00029807
     H       2.68652258     1.13571663    -0.47663878
     H       2.91681988    -0.00819915     0.47744007
     O      -0.72998035    -2.16575869     0.00084616
     H      -1.47070339    -2.51998088     0.47117176
     H      -0.35442799    -2.89606213    -0.46923496'''.split('\n')
    assert len(origin) == 10
    for i in range(10):
        at = origin[i].split()
        name = at[0]
        pos = np.array(map(float, at[1:4]))
        origin[i] = [name, pos]
    vec1 = origin[1][1] - origin[4][1]
    vec2 = origin[1][1] - origin[7][1]
    scan_vec = np.cross(vec1, vec2)
    scan_vec /= np.linalg.norm(scan_vec)
    origin[0][1] += x * scan_vec
    g = []
    for atom in origin:
        g.append([atom[0]])
        g[-1].extend(list(atom[1]))
    # scan np.linspace(-1.5, 1.5, 13)
    geom.load_geometry(g)
Exemplo n.º 3
0
def He3_dimerize_geom(x):
    # x sweeps from 0 to 1
    # coordinate scans from one uhf/avdz local min to another
    # spin density goes (.25|.5|.25) --> (.5|.5|0)
    g = [['He', -1.24 + x * (-1.07825455 + 1.24), 0.0, 0.0],
         ['He', 0.0, 0.0, 0.0],
         ['He', 1.24 + x * (1.96169068 - 1.24), 0.0, 0.0]]
    geom.load_geometry(g)
Exemplo n.º 4
0
def He8_geom(ring_pos, radius=2.385, nsolvent=5):
    g = [['He', -1.074, 0.0, 0.0], ['He', 0.0, 0.0, 0.0],
         ['He', 1.986, 0.0, 0.0]]
    dangle = 2 * np.pi / nsolvent
    angles = [n * dangle for n in range(nsolvent)]
    for angle in angles:
        g.append([
            'He', ring_pos,
            round(radius * np.cos(angle), 3),
            round(radius * np.sin(angle), 3)
        ])
    geom.load_geometry(g)
Exemplo n.º 5
0
def parse_input(input_file):
    '''Open input_file, parse it, load geometry, and MPI-broadcast the data'''
    if MPI.rank == 0:
        with open(input_file) as fp:
            params.parse(fp)

        geom.load_geometry(params.options['geometry'])

    params.options  = MPI.bcast(params.options, master=0)
    geom.geometry   = MPI.bcast(geom.geometry, master=0)
    lattice.lattice = MPI.bcast(lattice.lattice, master=0)
    lattice.lat_vecs = MPI.bcast(lattice.lat_vecs, master=0)
    lattice.lat_vecs_inv = MPI.bcast(lattice.lat_vecs_inv, master=0)
    lattice.PBC_flag = MPI.bcast(lattice.PBC_flag, master=0)
Exemplo n.º 6
0
def Ar4_symm_geom(x):
    g = [['Ar', 0.0, 0.0, 0.0], ['Ar', x, 0.0, 0.0], ['Ar', 2 * x, 0.0, 0.0],
         ['Ar', 3 * x, 0.0, 0.0]]
    geom.load_geometry(g)
Exemplo n.º 7
0
def Ar4_geom(x):
    # about minimum at UHF/LANL2DZ ECP
    g = [['Ar', 0.0 + x, 0.0, 0.0], ['Ar', 3.467, 0.0, 0.0],
         ['Ar', 6.061, 0.0, 0.0], ['Ar', 9.528 - x, 0.0, 0.0]]
    geom.load_geometry(g)
Exemplo n.º 8
0
def He4_asymm_geom(x):
    g = [['He', -2.5 + (-2.06 + 2.5) * x, 0.0, 0.0],
         ['He', -0.54 + (-.98 + .54) * x, 0.0, 0.0],
         ['He', 0.54 + (0.98 - 0.54) * x, 0.0, 0.0],
         ['He', 2.5 + (2.06 - 2.5) * x, 0.0, 0.0]]
    geom.load_geometry(g)
Exemplo n.º 9
0
def He4_symm_geom(x):
    g = [['He', 0.0, 0.0, 0.0], ['He', x, 0.0, 0.0], ['He', 2 * x, 0.0, 0.0],
         ['He', 3 * x, 0.0, 0.0]]
    geom.load_geometry(g)
Exemplo n.º 10
0
def He3_excursion_geom(x):
    # x is displacement of weakly bound He from the dimer cation
    # x == 0 is minimum at uhf/avdz
    g = [['He', -1.07825455, 0.0, 0.0], ['He', 0.0, 0.0, 0.0],
         ['He', 1.96169068 + x, 0.0, 0.0]]
    geom.load_geometry(g)
Exemplo n.º 11
0
def He2_geom(x):
    g = [['He', 0.0, 0.0, 0.0], ['He', x, 0.0, 0.0]]
    geom.load_geometry(g)
Exemplo n.º 12
0
        help='points per dimension in rectangular k-grid before truncation')
    parser.add_argument('--smooth',
                        action='store_true',
                        help='force acoustic branches to zero at gamma point')
    parser.add_argument('--binary_file',
                        type=str,
                        help='save freqs as binary numpy array')
    args = parser.parse_args()
    return args


if __name__ == "__main__":

    args = parseargs()
    #geom.load_geometry(open(args.structure).read().replace('H','D'))
    geom.load_geometry(args.structure)

    if args.bz_file:
        bz = np.loadtxt(args.bz_file)
        assert bz.shape[1] == 3 and len(bz.shape) == 2
        print "# Loaded %d kpoints from file" % len(bz)
    else:
        bz = make_brillouin_zone3D(args.kmesh_density)
        print "# Generated %d kpoints in 1st BZ" % len(bz)

    if args.bz_only:
        for kvec in bz:
            print kvec[0], kvec[1], kvec[2]
        sys.exit(0)

    if args.hessian is None: