Fragment Builder

Fragments for molecular systems

class molbe.fragment.fragpart(frag_type='autogen', closed=False, valence_basis=None, valence_only=False, print_frags=True, write_geom=False, be_type='be2', mol=None, frozen_core=False)

Bases: object

Fragment/partitioning definition

Interfaces two main fragmentation functions (autogen & chain) in MolBE. It defines edge & center for density matching and energy estimation. It also forms the base for IAO/PAO partitioning for a large basis set bootstrap calculation.

Parameters:
  • frag_type (str) – Name of fragmentation function. ‘autogen’, ‘hchain_simple’, and ‘chain’ are supported. Defaults to ‘autogen’ For systems with only hydrogen, use ‘chain’; everything else should use ‘autogen’

  • be_type (str) – Specifies order of bootsrap calculation in the atom-based fragmentation. ‘be1’, ‘be2’, ‘be3’, & ‘be4’ are supported. Defaults to ‘be2’ For a simple linear system A-B-C-D, be1 only has fragments [A], [B], [C], [D] be2 has [A, B, C], [B, C, D] ben …

  • mol (pyscf.gto.Molecule) – pyscf.gto.Molecule object. This is required for the options, ‘autogen’ and ‘chain’ as frag_type.

  • valence_basis (str) – Name of minimal basis set for IAO scheme. ‘sto-3g’ suffice for most cases.

  • valence_only (bool) – If this option is set to True, all calculation will be performed in the valence basis in the IAO partitioning. This is an experimental feature.

  • frozen_core (bool) – Whether to invoke frozen core approximation. This is set to False by default

  • print_frags (bool) – Whether to print out list of resulting fragments. True by default

  • write_geom (bool) – Whether to write ‘fragment.xyz’ file which contains all the fragments in cartesian coordinates.

chain(mol, frozen_core=False, closed=False)

Hard coded linear chain fragment constructor

hchain_simple()

Hard coded fragmentation feature

molbe.autofrag.autogen(mol, frozen_core=True, be_type='be2', write_geom=False, valence_basis=None, valence_only=False, print_frags=True)

Automatic molecular partitioning

Partitions a molecule into overlapping fragments as defined in BE atom-based fragmentations. It automatically detects branched chemical chains and ring systems and partitions accordingly. For efficiency, it only checks two atoms for connectivity (chemical bond) if they are within 3.5 Angstrom. This value is hardcoded as normdist. Two atoms are defined as bonded if they are within 1.8 Angstrom (1.2 for Hydrogen atom). This is also hardcoded as bond & hbond.

Parameters:
  • mol (pyscf.gto.Molecule) – pyscf.gto.Molecule object. This is required for the options, ‘autogen’ and ‘chain’ as frag_type.

  • frozen_core (bool, optional) – Whether to invoke frozen core approximation. Defaults to True.

  • be_type (str, optional) – Specifies the order of bootstrap calculation in the atom-based fragmentation. Supported values are ‘be1’, ‘be2’, ‘be3’, and ‘be4’. Defaults to ‘be2’.

  • write_geom (bool, optional) – Whether to write a ‘fragment.xyz’ file which contains all the fragments in Cartesian coordinates. Defaults to False.

  • valence_basis (str, optional) – Name of minimal basis set for IAO scheme. ‘sto-3g’ is sufficient for most cases. Defaults to None.

  • valence_only (bool, optional) – If True, all calculations will be performed in the valence basis in the IAO partitioning. This is an experimental feature. Defaults to False.

  • print_frags (bool, optional) – Whether to print out the list of resulting fragments. Defaults to True.

Returns:

  • fsites (list of list of int) – List of fragment sites where each fragment is a list of LO indices.

  • edgsites (list of list of list of int) – List of edge sites for each fragment where each edge is a list of LO indices.

  • center (list of list of int) – List of center indices for each edge.

  • edge_idx (list of list of list of int) – List of edge indices for each fragment where each edge index is a list of LO indices.

  • center_idx (list of list of list of int) – List of center indices for each fragment where each center index is a list of LO indices.

  • centerf_idx (list of list of int) – List of center fragment indices.

  • ebe_weight (list of list) – Weights for each fragment. Each entry contains a weight and a list of LO indices.

  • Frag (list of lists) – Heavy atom indices for each fragment, per fragment

  • cen (list) – Atom indices of all centers

  • hlist (list of lists) – All hydrogen atom indices for each fragment, per fragment

  • add_centers (list of lists) – “additional centers” for all fragments, per fragment: contains heavy atoms which are not centers in any other fragments

Fragments for perioric systems

class kbe.fragment.fragpart(natom=0, dim=1, frag_type='autogen', unitcell=1, gamma_2d=False, gamma_1d=False, interlayer=False, long_bond=False, perpend_dist=4.0, perpend_dist_tol=0.001, nx=False, ny=False, nz=False, closed=False, kpt=None, valence_basis=None, be_type='be2', mol=None, frozen_core=False, self_match=False, allcen=True)

Bases: object

__init__(natom=0, dim=1, frag_type='autogen', unitcell=1, gamma_2d=False, gamma_1d=False, interlayer=False, long_bond=False, perpend_dist=4.0, perpend_dist_tol=0.001, nx=False, ny=False, nz=False, closed=False, kpt=None, valence_basis=None, be_type='be2', mol=None, frozen_core=False, self_match=False, allcen=True)

Fragment/partitioning definition

Interfaces two main fragmentation functions (autogen & polychain) in MolBE. It defines edge & center for density matching and energy estimation. It also forms the base for IAO/PAO partitioning for a large basis set bootstrap calculation. Fragments are constructed based on atoms within a unitcell.

Parameters:
  • frag_type (str) – Name of fragmentation function. ‘autogen’, ‘hchain_simple’, and ‘chain’ are supported. Defaults to ‘autogen’ For systems with only hydrogen, use ‘chain’; everything else should use ‘autogen’

  • be_type (str) – Specifies order of bootsrap calculation in the atom-based fragmentation. ‘be1’, ‘be2’, ‘be3’, & ‘be4’ are supported. Defaults to ‘be2’ For a simple linear system A-B-C-D, be1 only has fragments [A], [B], [C], [D] be2 has [A, B, C], [B, C, D] ben …

  • mol (pyscf.pbc.gto.Cell) – pyscf.pbc.gto.Cell object. This is required for the options, ‘autogen’ and ‘chain’ as frag_type.

  • valence_basis (str) – Name of minimal basis set for IAO scheme. ‘sto-3g’ suffice for most cases.

  • valence_only (bool) – If this option is set to True, all calculation will be performed in the valence basis in the IAO partitioning. This is an experimental feature.

  • frozen_core (bool) – Whether to invoke frozen core approximation. This is set to False by default

  • print_frags (bool) – Whether to print out list of resulting fragments. True by default

  • write_geom (bool) – Whether to write ‘fragment.xyz’ file which contains all the fragments in cartesian coordinates.

  • kpt (list of int) – No. of k-points in each lattice vector direction. This is the same as kmesh.

  • interlayer (bool) – Whether the periodic system has two stacked monolayers.

  • long_bond (bool) – For systems with longer than 1.8 Angstrom covalent bond, set this to True otherwise the fragmentation might fail.

polychain(mol, frozen_core=False, unitcell=1)

Hard coded fragmentation for polymer chains. This is not recommended for any production level calculations.

kbe.autofrag.autogen(mol, kpt, frozen_core=True, be_type='be2', write_geom=False, unitcell=1, gamma_2d=False, gamma_1d=False, long_bond=False, perpend_dist=4.0, perpend_dist_tol=0.001, nx=False, ny=False, nz=False, valence_basis=None, interlayer=False, print_frags=True)

Automatic cell partitioning

Partitions a unitcell into overlapping fragments as defined in BE atom-based fragmentations. It automatically detects branched chemical chains and ring systems and partitions accordingly. For efficiency, it only checks two atoms for connectivity (chemical bond) if they are within 3.5 Angstrom. This value is hardcoded as normdist. Two atoms are defined as bonded if they are within 1.8 Angstrom (1.2 for Hydrogen atom). This is also hardcoded as bond & hbond. Neighboring unitcells are used in the fragmentation, exploiting translational symmetry.

Parameters:
  • mol (pyscf.pbc.gto.Cell) – pyscf.pbc.gto.Cell object. This is required for the options, ‘autogen’ and ‘chain’ as frag_type.

  • kpt (list of int) – Number of k-points in each lattice vector dimension.

  • frozen_core (bool, optional) – Whether to invoke frozen core approximation. Defaults to True.

  • be_type (str, optional) – Specifies the order of bootstrap calculation in the atom-based fragmentation. Supported values are ‘be1’, ‘be2’, ‘be3’, and ‘be4’. Defaults to ‘be2’.

  • write_geom (bool, optional) – Whether to write a ‘fragment.xyz’ file which contains all the fragments in Cartesian coordinates. Defaults to False.

  • valence_basis (str, optional) – Name of minimal basis set for IAO scheme. ‘sto-3g’ is sufficient for most cases. Defaults to None.

  • valence_only (bool, optional) – If True, all calculations will be performed in the valence basis in the IAO partitioning. This is an experimental feature. Defaults to False.

  • print_frags (bool, optional) – Whether to print out the list of resulting fragments. Defaults to True.

  • interlayer (bool) – Whether the periodic system has two stacked monolayers.

  • long_bond (bool) – For systems with longer than 1.8 Angstrom covalent bond, set this to True otherwise the fragmentation might fail.

Returns:

  • fsites (list of list of int) – List of fragment sites where each fragment is a list of LO indices.

  • edgsites (list of list of list of int) – List of edge sites for each fragment where each edge is a list of LO indices.

  • center (list of list of int) – List of center indices for each edge.

  • edge_idx (list of list of list of int) – List of edge indices for each fragment where each edge index is a list of LO indices.

  • center_idx (list of list of list of int) – List of center indices for each fragment where each center index is a list of LO indices.

  • centerf_idx (list of list of int) – List of center fragment indices.

  • ebe_weight (list of list) – Weights for each fragment. Each entry contains a weight and a list of LO indices.