ocelot.task package

Submodules

ocelot.task.bzcal module

class ocelot.task.bzcal.DispersionRelationLine(scheme: str, reci_mat: numpy.ndarray, kcoords: numpy.ndarray, eigens_up: numpy.ndarray, eigens_down: numpy.ndarray, ivb: int, icb: int, linekdata=None, efermi=None)[source]

Bases: object

__init__(scheme: str, reci_mat: numpy.ndarray, kcoords: numpy.ndarray, eigens_up: numpy.ndarray, eigens_down: numpy.ndarray, ivb: int, icb: int, linekdata=None, efermi=None)[source]

Initialize self. See help(type(self)) for accurate signature.

fit_linedata(fitdensity=50, nexbands=3, channel='up')[source]
classmethod from_klines_files(vasprunfile, kpointsfile)[source]
classmethod from_vasprun_file(vasprunfile)[source]
get_line_ems(bandtype='vb', channel='up')[source]
static parse2linsegs(kdata, iband, eigens, kcoords, reci_mat)[source]
plotlinebs(fname='bands.eps', fitdensity=50, nexbands=2, zerofermi=True, channel='up', yrange=- 2.0, 2.0)[source]
static read_kpoints_line(kpointsfile, reci_mat)[source]

kpoints must be a file generated by aflow

return:

d[‘kline_density’] = kline_density d[‘segs_label’] = segs_label d[‘xticks’] = kpath_kcoord d[‘xtickslabel’] = kpath_labels d[‘x’] = kpt_cumulative

static read_vasprun(vasprunfile)[source]
static strip_occu_in_eigens(eigens_with_occu: numpy.ndarray)[source]
class ocelot.task.bzcal.LineSegment(begin_label: str, end_label: str, kcoords: numpy.ndarray, eigens: numpy.ndarray, iband: int, reci_mat: numpy.ndarray, pltstart: float = 0.0)[source]

Bases: object

__init__(begin_label: str, end_label: str, kcoords: numpy.ndarray, eigens: numpy.ndarray, iband: int, reci_mat: numpy.ndarray, pltstart: float = 0.0)[source]

Initialize self. See help(type(self)) for accurate signature.

fit(fitdensity=100)[source]

fit band structure with spline at a predefined fit density using scipy.interpolate.splev

Parameters

fitdensity (int) – number of data points along one SEGMENT

Returns

property frac_direction
static get_em(kcumultive, eigens, ipt: int, step=1)[source]
get_ems(bandtype='cb')[source]
static get_points_of_interest(eigens, global_ex, bandtype: str, fluctuation=0.05)[source]
property length

length in k space

property max_wi
property min_wi
property pltend

ocelot.task.calec module

class ocelot.task.calec.ElectronicCoupling(sysname, mono_a, mono_b, caltype='gauss')[source]

Bases: object

class to calculate electronic couplings from Gaussian w. fmo formalism

micro wf:

  1. get 2 monomer structure in cart coords, label them mono_a and mono_b

  2. concatenate 2 input structure to give dimer structure, fmo requires site sequence remains intact

  3. run calculations to give mono_a_fchk, mono_b_fchk, dimer_fchk, dimer_log.

suggested keywords nosymm pop=full iop(3/33=1,3/59=8) int(acc2e=12)

  1. four files in 3. will be used to give ec, the results is a list of lists,

fields are [‘#mo_a’, ‘#mo_b’, ‘e_mo_a’, ‘e_mo_b’, ‘J_12’, ‘S_12’, ‘e^eff_1’, ‘e^eff_2’, ‘J^eff_12’, ‘dE_12’]

all in eV

__init__(sysname, mono_a, mono_b, caltype='gauss')[source]

setup ec calculations :param sysname: :param mono_a: pmg mol obj :param mono_b: pmg mol obj :param caltype: ‘gauss’ or ‘zindo’

static block_fill(matrix, istrt, nbf, jstrt, jend, count, element)[source]
static calculate_coupling_gauss(mono_a_fchk_string, mono_b_fchk_string, dimer_fchk_string, dimer_log_string, homo1=0, lumo1=0, homo2=0, lumo2=0)[source]
static create_matrix(matrix, elements, nbf)[source]

create lower triangular matrix from list of matrix elements indexed like so:

[[0,0,0,…,0], [1,2,0,…,0], [3,4,5,…,0]]

nbf is number of basis functions

elements is a list of matrix elements indexed like above, e.g. [0,1,2,3,…]

Gaussian prints every 5 columns, so the mod5 accounts for this

static g09_build_cfrag(nbf_d, nbf_mon1, nbf_mon2, c_mon1, c_mon2)[source]
static g09_calculate_coupling(homo_monomer_a, lumo_monomer_a, homo_monomer_b, lumo_monomer_b, nbf_monomer_a, f_d, s_d, cfrag)[source]
Parameters
  • homo_monomer_a

  • lumo_monomer_a

  • homo_monomer_b

  • lumo_monomer_b

  • nbf_monomer_a

  • f_d

  • s_d

  • cfrag

Returns

“MO 1”, “MO 2”, “e 1, eV”, “e 2, eV”, “J_12, eV”, “S_12”, “e^eff_1, eV”, “e^eff_2, eV”, “J^eff_12, eV”, “dE_12, eV”

static g09_calculate_fock(c, s, nbf, e)[source]
static g09_get_alpha_orbital_energies(fchk_lines, nbf)[source]
static g09_get_basis_functions(fchk_lines)[source]
static g09_get_homo_lumo(fchk_lines)[source]
static g09_get_mo_coefficients(fchk_lines, nbf)[source]
static get_overlap(g09logstring, nbf)[source]

Extracts the overlap matrix from a Gaussian logfile string. Returns a numpy matrix.

input_gen_gauss(charge=None, spin_multiplicity=None, title=None, functional='HF', basis_set='6-31G(d)', route_parameters={'int': {'acc2e': '12'}, 'iop': {'3/33': '1', '3/59': '8'}, 'nosymm': '', 'pop': 'full'}, input_parameters=None, link0_parameters=None, dieze_tag='#P', gen_basis=None)[source]
static make_symmetric(matrix)[source]
static triangle_fill(matrix, istrt, iend, jstrt, count, element)[source]

ocelot.task.confgen module

given a molecular specification (smiles) get distinct conformers via rdkit

the molecule should already have hydrogen explicitly added, i.e. from hsmiles or addhs

workflow:

rdkit conf gen [prune_in_gen] –> [ff minimize] –> prune_by_energy –> prune_by_rmsd

ref http://rdkit.blogspot.com/2014/08/optimizing-diversity-picking-in-rdkit.html https://squonk.it/docs/cells/RDKit%20Diverse%20Subset%20Picker/ https://github.com/skearnes/rdkit-utils/blob/master/rdkit_utils/conformers.py https://new.pharmacelera.com/scripts/rdkit-conformation-generation-script/ https://www.rdkit.org/UGM/2012/Ebejer_20110926_RDKit_1stUGM.pdf http://rdkit.org/docs_temp/Cookbook.html#parallel-conformation-generation

class ocelot.task.confgen.ConfGen(m: rdkit.Chem.rdchem.Mol, mol_name='rdmol', nconf=None, mingen=50, maxgen=300, nthread=0, rngseed=- 1, prune_in_gen=None, minimize=True, ff='MMFF94s', prune_by_energy=100)[source]

Bases: object

static GetBestRMSConf(mol, i, j)[source]
static GetBestRMSMatrix(mol)[source]

the problem of AllChem.GetConformerRMSMatrix(m) is that it uses AlignMolConformers this assumes atom order is the same, which may not be the case if the molecule has symmetry

__init__(m: rdkit.Chem.rdchem.Mol, mol_name='rdmol', nconf=None, mingen=50, maxgen=300, nthread=0, rngseed=- 1, prune_in_gen=None, minimize=True, ff='MMFF94s', prune_by_energy=100)[source]

Initialize self. See help(type(self)) for accurate signature.

static cal_energy(m: rdkit.Chem.rdchem.Mol, cid: int = 0, ff='MMFF94s')[source]
static cluster_by_rmsd(m: rdkit.Chem.rdchem.Mol, energies, rmsd_threshold: float)[source]

conformer in m should be assigned consecutive ids with delta=1

Parameters
  • energies

  • m

  • rmsd_threshold

Returns

classmethod from_smiles(smiles: str, mingen=50, maxgen=300)[source]
genconfs(flavor='prune', write_confs=False, prune_max_conformer=20, rmsd_threshold=0.5)[source]
static genconfs_ETKDG(m: rdkit.Chem.rdchem.Mol, nconf, nthreads, rmsprune, rngseed)[source]
genconfs_prune_by_energy()[source]
static ideal_conf_num(some_molecule: rdkit.Chem.rdchem.Mol, min=50, max=300)[source]

return the number of conformers that need to be generated to sample the conf space of a molecule

static is_hydrogen_explicit(m: rdkit.Chem.rdchem.Mol)[source]
static prune_by_rmsd(m, energies, max_conformers=None, rmsd_threshold=0.5)[source]

conformer in m should be assigned consecutive ids with delta=1

Parameters
  • energies

  • m

  • max_conformers

  • rmsd_threshold

Returns

static show_confs_diversity(m: rdkit.Chem.rdchem.Mol, energies: [<class 'float'>])[source]
exception ocelot.task.confgen.ConfGenError[source]

Bases: Exception

ocelot.task.dbwrite module

class ocelot.task.dbwrite.DBChromophore(hsmiles: str = None, smiles: str = None, ChromophoreConfs: [<class 'str'>] = None)[source]

Bases: monty.json.MSONable

__init__(hsmiles: str = None, smiles: str = None, ChromophoreConfs: [<class 'str'>] = None)[source]

Initialize self. See help(type(self)) for accurate signature.

getid()[source]
class ocelot.task.dbwrite.DBChromophoreConformer(geo: dict = None, index: int = None, anion_geo: int = None, cation_geo: int = None, AIP: float = None, AEA: float = None, reorg: float = None, tddft: dict = None, vs0s1: float = None, vs0t1: float = None, as0t1: float = None, Chromophore: str = None)[source]

Bases: ocelot.task.dbwrite.DBschema

__init__(geo: dict = None, index: int = None, anion_geo: int = None, cation_geo: int = None, AIP: float = None, AEA: float = None, reorg: float = None, tddft: dict = None, vs0s1: float = None, vs0t1: float = None, as0t1: float = None, Chromophore: str = None)[source]

Initialize self. See help(type(self)) for accurate signature.

getid()[source]
class ocelot.task.dbwrite.DBConfiguration(calculation_stage: str = None, unwrap_structure: pymatgen.core.structure.Structure = None, molconformers: [<class 'str'>] = None, z: int = None, occupancy: float = None, backbone_structure: pymatgen.core.structure.Structure = None, crystal: str = None, config_index: int = None, is_major: bool = None, packing_data: dict = None, hop_data_geodict: dict = None, hop_data_zindo: dict = None, hop_data_dft: dict = None, fb_opt_structure: pymatgen.core.structure.Structure = None, ar_opt_structure: pymatgen.core.structure.Structure = None, fb_opt_ebs: dict = None, ar_opt_ebs: dict = None, energetics: dict = None)[source]

Bases: ocelot.task.dbwrite.DBschema

__init__(calculation_stage: str = None, unwrap_structure: pymatgen.core.structure.Structure = None, molconformers: [<class 'str'>] = None, z: int = None, occupancy: float = None, backbone_structure: pymatgen.core.structure.Structure = None, crystal: str = None, config_index: int = None, is_major: bool = None, packing_data: dict = None, hop_data_geodict: dict = None, hop_data_zindo: dict = None, hop_data_dft: dict = None, fb_opt_structure: pymatgen.core.structure.Structure = None, ar_opt_structure: pymatgen.core.structure.Structure = None, fb_opt_ebs: dict = None, ar_opt_ebs: dict = None, energetics: dict = None)[source]

Initialize self. See help(type(self)) for accurate signature.

getid()[source]
class ocelot.task.dbwrite.DBCrystal(lattice: pymatgen.core.lattice.Lattice = None, smiles: str = None, hsmiles: str = None, chromophore: str = None, elements: str = None, identifier: str = None, source: str = None, cif_string: str = None, disorder_location: str = None, disorder_class: str = None, configurations: [<class 'str'>] = None, major_configuration: [<class 'str'>] = None, results: dict = None)[source]

Bases: ocelot.task.dbwrite.DBschema

__init__(lattice: pymatgen.core.lattice.Lattice = None, smiles: str = None, hsmiles: str = None, chromophore: str = None, elements: str = None, identifier: str = None, source: str = None, cif_string: str = None, disorder_location: str = None, disorder_class: str = None, configurations: [<class 'str'>] = None, major_configuration: [<class 'str'>] = None, results: dict = None)[source]

Initialize self. See help(type(self)) for accurate signature.

getid()[source]
class ocelot.task.dbwrite.DBMolConformer(mc_index: int = None, molconformer: dict = None, Configuration: str = None, GeoBoneConf: dict = None, GeoBoneConf_descriptors: dict = None, GeoScsConf: dict = None, GeoScsConf_descriptors: dict = None, ChromBoneConf: dict = None, ChromBoneConf_descriptors: dict = None, ChromScsConf: dict = None, ChromScsConf_descriptors: dict = None)[source]

Bases: ocelot.task.dbwrite.DBschema

__init__(mc_index: int = None, molconformer: dict = None, Configuration: str = None, GeoBoneConf: dict = None, GeoBoneConf_descriptors: dict = None, GeoScsConf: dict = None, GeoScsConf_descriptors: dict = None, ChromBoneConf: dict = None, ChromBoneConf_descriptors: dict = None, ChromScsConf: dict = None, ChromScsConf_descriptors: dict = None)[source]

Initialize self. See help(type(self)) for accurate signature.

getid()[source]
class ocelot.task.dbwrite.DBschema[source]

Bases: monty.json.MSONable

abstract getid() → str[source]
property unfilled
ocelot.task.dbwrite.sha1hash(obj)[source]

ocelot.task.dftd3 module

class ocelot.task.dftd3.DFTD3(jobname, structure, func='pbe', damping='bj', dftd2=False, cutoff=94.8683, cnthr=40)[source]

Bases: object

__init__(jobname, structure, func='pbe', damping='bj', dftd2=False, cutoff=94.8683, cnthr=40)[source]

init a dftd3 calculation

Parameters
  • jobname

  • structure

  • func

  • damping

  • dftd2 – DFT-D2 version.10

  • cutoff – a cutoff value for the dispersion interaction. The default value is 95 a.u.

  • cnthr – a cutoff value for the calculation of the CN. The default value is 40 a.u. and should be kept fixed

property cmd_option_string
static parse_results(res)[source]
run(d3cmd, wdir)[source]

ocelot.task.emtensor module

class ocelot.task.emtensor.EmTensor(kcoord, iband: int, stepsize: float, reci_mat: numpy.ndarray, eigens=None, st=3)[source]

Bases: object

__init__(kcoord, iband: int, stepsize: float, reci_mat: numpy.ndarray, eigens=None, st=3)[source]

init a effective tensor calculation

Parameters
  • kcoord – in frac, center of the stencil

  • iband – starts from 0

  • stepsize – in 1/A

  • reci_mat – in 1/A, physics convention (with 2 pi)

  • eigens – in eV

  • st (int) – size of the stencil, 3 or 5

cal_emtensor()[source]
eigens: np.ndarray = None
classmethod from_vasprun(kcoord, iband, stepsize, file, channel='up', st=3)[source]
property kcart
property kmesh
write_kmesh(fn)[source]
ocelot.task.emtensor.fd_effmass_st3(e, h)[source]
ocelot.task.emtensor.fd_effmass_st5(e, h)[source]
ocelot.task.emtensor.get_reci_mat(file, filetype='poscar')[source]
ocelot.task.emtensor.ra2pi2rb(ra2pi: float)[source]
ocelot.task.emtensor.ra2rb(ra: float)[source]
ocelot.task.emtensor.rb2ra(rb: float)[source]
ocelot.task.emtensor.rb2ra2pi(rb: float)[source]

ocelot.task.hop module

class ocelot.task.hop.Hop(config, zindobin=None, zindoctbin=None, zindolib=None, wdir='/home/ai/ocelot_api/doc', gaussbin=None)[source]

Bases: object

__init__(config, zindobin=None, zindoctbin=None, zindolib=None, wdir='/home/ai/ocelot_api/doc', gaussbin=None)[source]

Initialize self. See help(type(self)) for accurate signature.

static applysym_to_coupling_data(data, dimer_array, workdir)[source]
get_hopping_network_s1()[source]
get_hopping_network_s2(symdata, cutoff, supercell=1, 1, 1, motype='hh')[source]
static get_intger_mesh(x, y, z)[source]
static group_dimers(dimers)[source]

subgroup into dimercollection such that all dimers in one collection share the same ref_omol

Parameters

dimers

Returns

dimercolls: a dict of dimer lists, dimercolls[x] are dimers with i==x

static hopping(supercell_data, supercell_mesh, cutoff, workdir, motype)[source]

a molecule is defined by meshpoint in the supercell mesh (mp_i) and mol index (mol_i) in a cell hopdata[x] gives a list of molecules (represented by [mp_i, mol_i]) that are connected to the molecule [mp_i=0, mol_i=x], including the molecule itself

Parameters
  • motype

  • supercell_mesh – 3xn meshpoints

  • supercell_data

  • cutoff – in meV

  • workdir

Returns

run(alldimers, calculator='zindo', njobs=None)[source]

you should screen alldimers based on geodist before this run

Parameters
  • alldimers

  • calculator

  • njobs

Returns

static screen_dimers(dimer_array, close=True, unique=True)[source]
Parameters
  • dimer_array – ijk array as in config.get_dimers_array()

  • close

  • unique – apply symmetry in dimer_array

:return a list of dimers that are unique and close

static supercell_proj(dimer_array, transv_fcs, symdata, super_cell_size, motype, workdir)[source]

we look at a supercell, in which the coupling is represented as augmented_data[mp_i][mp_j][i][j] which is the coupling between supercellmesh[mp_i] ith mol and supercellmesh[mp_j] jth mol

Parameters
  • motype

  • workdir

  • dimer_array

  • transv_fcs

  • symdata

  • super_cell_size – 3x1 int tuple e.g. (6, 6, 6)

Returns

supercellmesh, augmented_data

static unique_ijk(leni, lenj, lenk)[source]

given dimer_array from config.get_dimers_array with symm=False get unique ijk combinations using symmetry dimer_array[i][j][k1] == dimer_array[j][i][k2] where transv_fcs[k1] == -transv_fcs[k2] note there is another symmetry in transv_fcs from cart product, transv_fcs[i] == -transv_fcs[len-i-1] that is k2 == len-k1-1

Parameters
  • leni

  • lenj

  • lenk

Returns

zindo_cal(unitjob)[source]
class ocelot.task.hop.IJK(ijk, klen)[source]

Bases: object

__init__(ijk, klen)[source]

Initialize self. See help(type(self)) for accurate signature.

ocelot.task.idchg module

class ocelot.task.idchg.IdChg(pmgmol, jobname, mopaccmd)[source]

Bases: object

__init__(pmgmol, jobname, mopaccmd)[source]

Initialize self. See help(type(self)) for accurate signature.

static parse_out(outfn)[source]
run(wdir)[source]
write_inp(wdir)[source]

ocelot.task.nics module

class ocelot.task.nics.NICSjob(omol: ocelot.schema.conformer.MolConformer, nmrscheme='GIAO')[source]

Bases: object

__init__(omol: ocelot.schema.conformer.MolConformer, nmrscheme='GIAO')[source]

Initialize self. See help(type(self)) for accurate signature.

static add_bqlines(stringinput, pts)[source]
gen_input(step_size, nrings, maxnbq, height=1.7, normaldirection=0, charge=None, spin_multiplicity=None, title=None, functional='HF', basis_set='6-31G(d)', route_parameters=None, input_parameters=None, link0_parameters=None, dieze_tag='#P', gen_basis=None)[source]

this will return two lists of gauss input string, xticks, xnumbers, pt_idx(ring idx) for plotting

pts are cart coords for bqs

return None if failed

one problem is if the number of ghost atoms cannot be too large, so the param maxnbq is introduced as the max number of ghost atoms that is allowed to show in one input file for other param docs see nics_line_scan_path and pymatgen.io.gassian

static get_zzmstensor(logstring, tensor_kw='GIAO Magnetic shielding tensor')[source]
Parameters
  • logstring – string of gauss log file

  • tensor_kw – default ‘GIAO Magnetic shielding tensor’

Returns

a list of floats, zz components of magnetic shield tensor from log string

lgfr: [RingConformer] = None
nics_line_scan_path(step_size, nrings, height=1.7, normaldirection=0)[source]

pts, n x 3 array, cart coords for path

ring_idx, n x 1 array, ring_idx[i] represents the ring idx of the ring in which pts[i] reside

xnumbers, the path travelled

xticks, seg ends position on path

Parameters
  • step_size – in AA

  • nrings – only look at this # of rings in lfr

  • height – default 1.7 is suggested by Stanger, Chemistry–A European Journal 20.19 (2014): 5673-5688

  • normaldirection – 0 or 1, as it’s possible to have two different paths for bent molecules

Returns

pts, ring_idx, xnumbers, xticks

nics_sigma_structure(normal_idx=0)[source]

add hydrogen to all sites on lfr(largest fused rings), and sites that are connected to lfr with double bonds notice this could be different from backbone, as backbone contains other fr connected to lfr with single bond (eg. BDT 3mer)

param normal_idx

0, 1

Returns

a MSitelist objects

plot_path()[source]

# TODO plot the chemical structure of self.omol and show a path projection there :return:

static plt_pizz_xypath(tensor_zzs_sigma, tensor_zzs_total, xnumbers, xticks, fn)[source]
exception ocelot.task.nics.NicsError[source]

Bases: Exception

ocelot.task.pkid module

class ocelot.task.pkid.PackingIdentifier(boneconfig)[source]

Bases: object

__init__(boneconfig)[source]

identify packing pattern

the input should be a pbc config of terminated backbones

  1. heuristic rules

    10.1039/c7tc02553j, that worked only for small acenes, we want more J. AM. CHEM. SOC. 2004, 126, 4318-4328, this seems quite primitive

  2. finger print Hirshfield 10.1039/c1ce05763d

identify_heuristic()[source]

return a dictionary, keys are

n_close_azm_and_parallel, n_close_azm_and_notparallel, n_close_vertical_and_parallel, n_close_vertical_and_notparallel, n_parallel_and_overlap, n_notparallel_and_overlap, packing

these keys are defined based on: close_vertical: d.oslip within [1.5, 4] parallel: d.oangle < 15 deg close_azm: d.oslip <= 1.5 overlap: overlap > 1e-5

variables used: 1. is_not_identical: slip vector norm >= 1e-5 2. is_close: minbonedist < 5.5 3. overlap: project sites onto the plane defined by ovector of ref_mol and ref_mol.geoc,

then get overlap of concave/convex hulls

  1. mindist2d: min distance between two hulls

  2. d.oslip: vertical slip

  3. d.oangle: angle between o_vector

workflow: 1. from bone config get all bone dimers, maxfold=2 2. for each molecule (a) in the unit cell

  1. get first 27*z dimers, sorted by vslipnorm, whose ref_mol is (a)

  2. if identical or not_close, do nothing

  3. get values for the keys

  4. apply classification based on the keys

Returns

identify_hirshfield()[source]

TODO use multwfn to generate hirshfield finger print, then analysze it based on 10.1039/c1ce05763d

ocelot.task.readcif module

class ocelot.task.readcif.ReadCif(cifstring, source, identifier=None)[source]

Bases: object

__init__(cifstring, source, identifier=None)[source]

Initialize self. See help(type(self)) for accurate signature.

classmethod from_ciffile(ciffile, source, identifier=None)[source]
read()[source]
static where_is_disorder(c: ocelot.schema.configuration.Config)[source]

data[imol] = disorder info in conformer_properties

ocelot.task.reorg module

class ocelot.task.reorg.Reorganization(nopt='nopt.log', copt='copt.log', aopt='aopt.log', ngeo_a='nasp.log', ngeo_c='ncsp.log', ageo_n='ansp.log', cgeo_n='cnsp.log')[source]

Bases: object

class to calculate reorganization energy for holes and electrons from Gaussian output files.

__init__(nopt='nopt.log', copt='copt.log', aopt='aopt.log', ngeo_a='nasp.log', ngeo_c='ncsp.log', ageo_n='ansp.log', cgeo_n='cnsp.log')[source]

Initialize self. See help(type(self)) for accurate signature.

static extract_energy(log)[source]
reorg_energy()[source]

ocelot.task.wtuning module

originally written by Sean M. Ryno, Cheng Zhong, Haitao Sun, see /legacy/aw_tuning.py for a certain mol, get tuned w default keywords for gaussian ‘scf=(xqc,fermi,noincfock,ndamp=35,conver=6,vshift=500,novaracc)’ dev-ing

class ocelot.task.wtuning.WtuningJob(func='uLC-wHPBE', basis='def2tzvp', name='', nproc=16, mem=50, n_charge=0, n_spin=1, wdir='./', rps={'scf': {'conver': '6', 'fermi': '', 'ndamp': '35', 'noincfock': '', 'novaracc': '', 'vshift': '500', 'xqc': ''}}, scheme='Jh', wbmin=0.05, wbmax=0.5, abmin=0.05, abmax=0.5, gauss_cmd='g16')[source]

Bases: object

__init__(func='uLC-wHPBE', basis='def2tzvp', name='', nproc=16, mem=50, n_charge=0, n_spin=1, wdir='./', rps={'scf': {'conver': '6', 'fermi': '', 'ndamp': '35', 'noincfock': '', 'novaracc': '', 'vshift': '500', 'xqc': ''}}, scheme='Jh', wbmin=0.05, wbmax=0.5, abmin=0.05, abmax=0.5, gauss_cmd='g16')[source]

Initialize self. See help(type(self)) for accurate signature.

alpha_atune(alpha_in)[source]
alpha_format()[source]
property alpha_iopstr
alpha_tune(dis=3, tol=0.0001, deltaalpha=0.2)[source]
atuning_cycle(eps=0.01, dis=3, tol=0.001, max_cycles=5)[source]
property beta_iopstr
static extract_abs(fn)[source]
static extract_energy(fn)[source]
static gauss_run(fn, gcmd)[source]
geo_opt(rps={})[source]
property iop_route_params
log_add(s)[source]
omega_FindC()[source]

Calculate scheme value from extracted data Set the optimization criterion (the value to minimize), available options are: J2—((HOMO-IP)^2+(A_HOMO+EA)^2) Jh—(HOMO-IP) Jl—(LUMO+EA) Jn2—((HOMO-IP)^2+(LUMO+EA)^2) O2—((A_HOMO-LUMO)^2+(C_LUMO-HOMO)^2) :return: Jn, Jl, Jh value (depending on scheme)

static omega_extract(fn)[source]

Pull important data from Log Files after run :param fn: Filename of Log File to be read :return: Energies of Molecule, HOMO and LUMO in eV

omega_format()[source]

Format IOp strings based off of omega value, then update route parameters dictionary and input filenames

omega_gauss_do()[source]

Run Gaussian in subprocess and wait for termination. Extract data from output when done

property omega_iopstr
omega_tune(dis=3, tol=0.0001, deltaomega=0.2)[source]
omega_wtune(omega_in)[source]
Parameters

omega_in – Value for ‘fminbound’ function to pass scalars into

Returns

Scheme value from FindC

to_dict()[source]
to_file()[source]
wtuning_cycle(eps=0.01, dis=3, tol=0.001, max_cycles=5)[source]
ocelot.task.wtuning.gauss_in_gen(name, mol, type, func, basis, charge, spin, route_params, link0_params)[source]

ocelot.task.zindo module

class ocelot.task.zindo.ZindoJob(jobname, pmgmol, isdimer=False, mol_A=None, mol_D=None, upconvert=True)[source]

Bases: object

__init__(jobname, pmgmol, isdimer=False, mol_A=None, mol_D=None, upconvert=True)[source]

Initialize self. See help(type(self)) for accurate signature.

static dimer_run(jobname, wdir, zindobin, zindoctbin, zindolib, pmgmola, pmgmolb)[source]

perfrom zindo calculation for a dimer system, return parsed tmo.dat as NAxND array

Parameters
  • jobname

  • wdir – working dir

  • zindobin – binary path

  • zindoctbin – binary path

  • zindolib – dir path

  • pmgmola

  • pmgmolb

Returns

tmo parsed data, # of AMOs, # of DMOs

classmethod dimerjob_from_two_molecules(pmgmol1, pmgmol2, jobname='dimer')[source]
static get_hh_coupling(coupling_data, nmo_a, nmo_d)[source]
Parameters
  • nmo_a

  • nmo_d

  • coupling_data – the return value of self.dimer_run()

Returns

the HOMO-HOMO electronic coupling in meV

static get_ll_coupling(coupling_data, nmo_a, nmo_d)[source]
Parameters
  • nmo_a

  • nmo_d

  • coupling_data – the return value of self.dimer_run()

Returns

the HOMO-HOMO electronic coupling in meV

static get_valence_electrons(pmgmol)[source]

pymatgen has a weird valence property for element, e.g. for carbon valence is 2 this is just for neutral mol

Parameters

pmgmol

Returns

static inpstring(pmgmol, RUNTYP='ENERGY', SCFTYP='RHF', ITMAX=500, SCFTOL=1e-06, CISIZE=0, ACTSPC=0, ONAME='zindoout')[source]

string of input file, charge and mult will be inherited from pmgmol

Parameters
  • pmgmol – pymatgen mol object

  • RUNTYP – can be ‘ENERGY’ or ‘GEO’ or ‘RPA’ or ‘CI’

  • SCFTYP – type of scf

  • ITMAX – max # of iteration

  • SCFTOL – scf tol

  • CISIZE – CI basis size

  • ACTSPC – # of active orbitals in CI

  • ONAME – output name

Returns

property legit
parse_tmo(tmofn='tmo.dat')[source]

parse tmo.dat as NAxND array, NA is number of MOs in A, ND is number of MOs in D NA, ND is decided by the number of valence eletrons, which is auto-gen by zindo # of valence electronis by zindo auto-gen may NOT be identical to the real # of valence electrons!

Parameters

tmofn

Returns

data[i][j] is the ti of i+1th MO of A and j+1th MO of B

write_dimer(fnprefix, RUNTYP='ENERGY', SCFTYP='RHF', ITMAX=500, SCFTOL=1e-06, CISIZE=0, ACTSPC=0, ONAME='zindoout')[source]
write_single(fnprefix, RUNTYP='ENERGY', SCFTYP='RHF', ITMAX=500, SCFTOL=1e-06, CISIZE=0, ACTSPC=0, ONAME='zindoout')[source]
ocelot.task.zindo.conver2zindo(pmgmol)[source]

this will replace elements that are not in Zindo_elements with elements in the same group

ocelot.task.zindo.valence_electron(element)[source]

count valence electrons based on electronic configuration if a subshell has > 10 electrons, this subshell is ignored

Module contents

  • calec: electronic coupling calculation for dimer

  • nics_scan: io for nics_xy_pi scan

  • pkid: packing identification

  • awtuning: tune w/a for lc functional

  • optic: optical response

  • hopper: give electronic coupling of dimers, identify whether there’s a percolation route

  • bands: parse band structure data

  • geodes: geometric descriptors

  • emc: effective mass calculations

  • massage: ec-slip relation

  • nics: nics scan

  • homa: HOMA descriptor for aroma

  • fitbox: get plausible conformation for a pre-defined box (GIXD)

  • ipae: calculate IP and AE, both intrinsic and apparent

  • cales: excited state calculations

  • defgen: generate defects

  • inspector: sanity check for raw data and inputs generation for other tasks