Commit bc3a9b91 authored by Malthe Kjær Bisbo's avatar Malthe Kjær Bisbo
Browse files

Added further documentation - autodoc still does not work

parent e9f52417
import numpy as np
from ase.calculators.dftb import Dftb
from surrogate.gpr import GPR
from ase.io import read, write
from candidate_operations.candidate_generation import CandidateGenerator, StartGenerator, OperationConstraint
from candidate_operations.basic_mutations import RattleMutation, RattleMutation2, PermutationMutation
import sys
from gofee import GOFEE
### Set up StartGenerator and mutations ###
# read slab
slab = read('slab.traj', index='0')
# Stoichiometry of atoms to be placed
stoichiometry = 5*[22]+10*[8]
# Box in which to place atoms
c = slab.get_cell()
c[2,2] = 25
slab.set_cell(c)
v = np.copy(c)
v[2,2] = 2.3
p0 = np.array((0.0,0.,8.))
box = [p0, v]
# initialize startgenerator
sg = StartGenerator(slab, stoichiometry, box)
# initialize rattle mutation
n_to_optimize = len(stoichiometry)
# Add position constraint to mutations
z_constraint = OperationConstraint(zlim=[6.5, 15])
candidate_generator = CandidateGenerator([0.2, 0.2, 0.6],
[sg,
PermutationMutation(n_to_optimize, Npermute=2),
RattleMutation(n_to_optimize, Nrattle=3, rattle_range=4)])
### Define calculator ###
calc = Dftb(label='TiO2_surface',
Hamiltonian_SCC='No',
Hamiltonian_MaxAngularMomentum_='',
Hamiltonian_MaxAngularMomentum_Ti='"d"',
Hamiltonian_MaxAngularMomentum_O='"p"',
Hamiltonian_Charge='0.000000',
Hamiltonian_Filling ='Fermi {',
Hamiltonian_Filling_empty= 'Temperature [Kelvin] = 0.000000',
kpts=(2,1,1))
### Initialize and run search ###
search = GOFEE(structures=None,
calc=calc,
gpr=None,
startgenerator=sg,
candidate_generator=candidate_generator,
max_steps=200,
dmax_cov=1.5,
population_size=5,
kappa=1,
dualpoint=True,
restart='restart')
search.run()
#!/bin/bash
#SBATCH --job-name=TiO_1L_3
#SBATCH --partition=q28,q36,q40,qgpu
#SBATCH --mem=10G
#SBATCH --nodes=1
#SBATCH --time=3:00:00
#SBATCH --ntasks-per-node=5
#SBATCH --cpus-per-task=1
#SBATCH --no-requeue
#SBATCH --array=0-29%30
echo "========= Job started at `date` =========="
# Go to the directory where this job was submitted
cd $SLURM_SUBMIT_DIR
source /home/mkb/.gpaw_py3
source /home/mkb/.GOFEE
source /home/mkb/.dftb
path0=$SLURM_SUBMIT_DIR/runs3
base_path=$path0/run$SLURM_ARRAY_TASK_ID
mkdir $base_path
# Copy files
cp run_search.py $base_path
cp slab.traj $base_path
cp init.traj $base_path
cd $base_path
mpiexec --mca mpi_warn_on_fork 0 gpaw-python run_search.py > search.log
echo "========= Job finished at `date` =========="
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment