ChemicalSystem Complete API¶
Tip
For copy-pasteable ChemicalSystem scripts, start with Python Examples.
Note
Thread safety. You can create, parse, read and modify separate ChemicalSystems in different threads at the same time. Several threads can read one ChemicalSystem at once, but a thread that modifies it must be the only one using it at that time.
- class ChemicalSystem¶
A class representing a chemical system in the Amsterdam Modeling Suite
- __init__(*args, **kwargs)¶
Overloaded function.
__init__(self: scm.base._internal.ChemicalSystem) -> None
Creates a new, empty ChemicalSystem.
__init__(self: scm.base._internal.ChemicalSystem, system_block: str) -> None
Creates a new ChemicalSystem from a System block string.
__init__(self: scm.base._internal.ChemicalSystem, symbols: list[str], coords: numpy.ndarray[numpy.float64[m, 3]], eol_strings: Optional[list[str]] = None, charge: float = 0.0, lattice: scm.base._internal.Lattice = <scm.base._internal.Lattice object at 0x7a0382881ef0>, bonds: Optional[scm.base._internal.Bonds] = None, electrostatic_embedding: Optional[scm.base._internal.ElectrostaticEmbedding] = None) -> None
Creates a new ChemicalSystem from atom symbols, coordinates and (optionally) other data.
__init__(self: scm.base._internal.ChemicalSystem, atomic_numbers: list[int], coords: numpy.ndarray[numpy.float64[m, 3]], eol_strings: Optional[list[str]] = None, charge: float = 0.0, lattice: scm.base._internal.Lattice = <scm.base._internal.Lattice object at 0x7a0389feceb0>, bonds: Optional[scm.base._internal.Bonds] = None, electrostatic_embedding: Optional[scm.base._internal.ElectrostaticEmbedding] = None) -> None
Creates a new ChemicalSystem from atomic numbers, coordinates and (optionally) other data.
- __len__(self: ChemicalSystem) int¶
- __str__(self: ChemicalSystem) str¶
Formats a ChemicalSystem into an AMS System block.
- add_all_atoms_to_region(self: ChemicalSystem, region: str) None¶
Adds all of the system’s atoms to a region.
- add_atom(*args, **kwargs)¶
Overloaded function.
add_atom(self: scm.base._internal.ChemicalSystem, atom: scm.base._internal.Atom) -> None
Adds a copy of an Atom to a ChemicalSystem.
add_atom(self: scm.base._internal.ChemicalSystem, atom: scm.base._internal.Atom, coords: numpy.ndarray[numpy.float64[3, 1]], unit: str = ‘angstrom’) -> None
Adds a copy of an Atom to a ChemicalSystem.
add_atom(self: scm.base._internal.ChemicalSystem, Z: int, coords: numpy.ndarray[numpy.float64[3, 1]], unit: str = ‘angstrom’) -> None
Adds a new Atom of a given atomic number to the ChemicalSystem.
add_atom(self: scm.base._internal.ChemicalSystem, element: scm.base._internal.Element, coords: numpy.ndarray[numpy.float64[3, 1]], unit: str = ‘angstrom’) -> None
Adds a new Atom of a given Element to the ChemicalSystem.
add_atom(self: scm.base._internal.ChemicalSystem, symbol: str, coords: numpy.ndarray[numpy.float64[3, 1]], unit: str = ‘angstrom’) -> None
Adds a new Atom to the ChemicalSystem given its symbol.
- add_atom_to_region(*args, **kwargs)¶
Overloaded function.
add_atom_to_region(self: scm.base._internal.ChemicalSystem, atom: int, region: str) -> None
Adds an atom to a region.
add_atom_to_region(self: scm.base._internal.ChemicalSystem, atom: scm.base._internal.Atom, region: str) -> None
Adds an atom to a region.
- add_atoms_to_region(self: ChemicalSystem, atom_indices: numpy.ndarray[numpy.int32[m, 1]], region: str) None¶
Adds multiple atoms to a region, given their atom indices.
- add_bond(*args, **kwargs)¶
Overloaded function.
add_bond(self: scm.base._internal.ChemicalSystem, from_atom: int, to_atom: int, order: float) -> None
Adds a bond to the system using the shortest still-unused lattice displacement for the atom pair.
add_bond(self: scm.base._internal.ChemicalSystem, from_atom: int, to_atom: int, bond: scm.base._internal.Bond) -> None
Adds a bond to the system using the user-provided lattice displacement stored in the Bond.
- add_bonds(*args, **kwargs)¶
Overloaded function.
add_bonds(self: scm.base._internal.ChemicalSystem, from_atoms: numpy.ndarray[numpy.int32[m, 1]], to_atoms: numpy.ndarray[numpy.int32[m, 1]], orders: numpy.ndarray[numpy.float64[m, 1]]) -> None
Adds bonds to the system using the shortest still-unused lattice displacement for each atom pair.
add_bonds(self: scm.base._internal.ChemicalSystem, from_atoms: numpy.ndarray[numpy.int32[m, 1]], to_atoms: numpy.ndarray[numpy.int32[m, 1]], bonds: Sequence) -> None
Adds bonds to the system using the user-provided lattice displacements stored in the Bond instances.
- add_hydrogen_atoms(*args, **kwargs)¶
Overloaded function.
add_hydrogen_atoms(self: scm.base._internal.ChemicalSystem, atom_indices: list[int]) -> None
Add missing hydrogen atoms to organic compounds.
add_hydrogen_atoms(self: scm.base._internal.ChemicalSystem) -> None
Add missing hydrogen atoms to organic compounds.
- add_other(self: ChemicalSystem, other: ChemicalSystem) None¶
Merges another ChemicalSystem into this one.
- align_to(self: ChemicalSystem, other: ChemicalSystem) None¶
Translate and rotate the system to maximally align it with ‘other’.
- static all_from_in(contents: str) dict[str, ChemicalSystem]¶
Constructs and returns ChemicalSystems from text containing System and LoadSystem blocks.
- static all_from_input(input_file: scm.base._internal.InputFile) dict[str, ChemicalSystem]¶
Constructs and returns ChemicalSystems for all System (and LoadSystem) blocks in an InputFile.
- apply_strain(self: ChemicalSystem, strain_matrix: numpy.ndarray[numpy.float64[m, n]]) None¶
Apply a strain deformation to a periodic system.
- apply_strain_voigt(self: ChemicalSystem, strain_voigt: list[float]) None¶
Apply a strain deformation to a periodic system.
- atom_EOL_string(self: ChemicalSystem, atidx: int, skip: list[str] = []) str¶
Returns the end-of-line string of an atom in the System%Atoms block given its index.
- atom_attributes_enabled(self: ChemicalSystem, group_prefix: str) bool¶
Checks if a group of atomic properties is enabled or not.
- atom_index(self: ChemicalSystem, atom: Atom) int¶
Given an Atom instance, returns its index in ChemicalSystem.atoms.
- atom_is_in_ring(*args, **kwargs)¶
Overloaded function.
atom_is_in_ring(self: scm.base._internal.ChemicalSystem, atom: int) -> bool
Checks if an atom is part of any ring.
atom_is_in_ring(self: scm.base._internal.ChemicalSystem, atom: scm.base._internal.Atom) -> bool
Checks if an atom is part of any ring.
- atom_order_to_match(self: ChemicalSystem, other: ChemicalSystem, depth: int = -1, coordination: bool = True, bond_orders: bool = False, ez_stereo: bool = False, rs_stereo: bool = False, ring: bool = False, implicit_h: bool = False) list[int]¶
Return map of atom indices matching other, based on hash-based atomic structure identifiers.
- atomic_hashes(self: ChemicalSystem, depth: int = -1, coordination: bool = True, bond_orders: bool = False, ez_stereo: bool = False, rs_stereo: bool = False, ring: bool = False, implicit_h: bool = False) list[int]¶
Compute hash-based atomic structure identifiers for all atoms.
- atoms_num_rings_membership(self: ChemicalSystem) list[int]¶
For each atom, the number of ‘smallest rings’ that atom is part of.E.g.: for Naphthalene it would be 2 for the two shared carbon atoms, 1 for the remaining carbons, and 0 for the hydrogens.
Ring detection is not implemented for periodic systems.
- bond_cuts_molecule(*args, **kwargs)¶
Overloaded function.
bond_cuts_molecule(self: scm.base._internal.ChemicalSystem, from_atom: int, to_atom: int) -> bool
Checks if removing the bonds between two atoms would cut the graph into two disjoint subgraphs.
bond_cuts_molecule(self: scm.base._internal.ChemicalSystem, from_atom: scm.base._internal.Atom, to_atom: scm.base._internal.Atom) -> bool
Checks if removing the bonds between two atoms would cut the graph into two disjoint subgraphs.
- bounding_box_volume(self: ChemicalSystem, unit: str = 'angstrom3') float¶
Volume of the bounding box.
- center_of_mass(self: ChemicalSystem, unit: str = 'angstrom') numpy.ndarray[numpy.float64[3, 1]]¶
Position of the center of mass.
- check_molecule_symmetry(self: ChemicalSystem, label: str, tolerance: float = 1e-06) bool¶
Checks if a molecule has a particular symmetry given by a Schoenflies symbol.
- clear_bonds(self: ChemicalSystem) None¶
Removes all bonds from the system.
- contains_atom(self: ChemicalSystem, atom: Atom) bool¶
Checks if an Atom instance is part of a ChemicalSystem.
- copy(self: ChemicalSystem) ChemicalSystem¶
Creates a deep copy of the ChemicalSystem.
- density(self: ChemicalSystem, unit: str = 'dalton/angstrom3') float¶
Returns the density of the system in the specified unit. Only valid for 3D periodic systems.
- deselect_all(self: ChemicalSystem) None¶
Deselects all atoms, or in other words: clears the current selection.
- deselect_atom(*args, **kwargs)¶
Overloaded function.
deselect_atom(self: scm.base._internal.ChemicalSystem, arg0: int) -> None
Selects an atom given its index.
deselect_atom(self: scm.base._internal.ChemicalSystem, arg0: scm.base._internal.Atom) -> None
Selects an instance of an atom.
- deselect_atoms(self: ChemicalSystem, atom_indices: numpy.ndarray[numpy.int32[m, 1]]) None¶
Deselects multiple atoms at once, given their atom indices.
- deselect_atoms_if(self: ChemicalSystem, pred: Callable[[Atom], bool]) None¶
Deselects atoms based on a predicate function.
- determine_species(self: ChemicalSystem, comp: Callable[[Atom, Atom], bool]) tuple[int, list[int], list[int]]¶
Determines the present atomic species, based on a user defined comparator function.
- disable_atom_attributes(self: ChemicalSystem, group_prefix: str) None¶
Disables the use of a group of atomic properties. Any set properties within the group will be discarded.
- distance_matrix(*args, **kwargs)¶
Overloaded function.
distance_matrix(self: scm.base._internal.ChemicalSystem, unit: str = ‘angstrom’) -> numpy.ndarray[numpy.float64[m, n]]
Returns the distance matrix between all atoms in the system.
distance_matrix(self: scm.base._internal.ChemicalSystem, atom_indices: numpy.ndarray[numpy.int32[m, 1]], unit: str = ‘angstrom’) -> numpy.ndarray[numpy.float64[m, n]]
Returns the distance matrix between a subset of atoms in the system.
distance_matrix(self: scm.base._internal.ChemicalSystem, from_indices: numpy.ndarray[numpy.int32[m, 1]], to_indices: numpy.ndarray[numpy.int32[m, 1]], unit: str = ‘angstrom’) -> numpy.ndarray[numpy.float64[m, n]]
Returns the distance matrix between two subsets of atoms in the system.
- do_regions_intersect(self: ChemicalSystem, regionA: str, regionB: str) bool¶
Checks if two regions or region expressions intersect, i.e. have at least one atom in common.
- enable_atom_attributes(self: ChemicalSystem, group_prefix: str) None¶
Enables the use of a group of atomic properties.
- extract_atoms(self: ChemicalSystem, atom_indices: list[int]) ChemicalSystem¶
Returns a new system build from a subset of atoms.
- formula(self: ChemicalSystem) str¶
Chemical formula in Hill notation, e.g. H2O or CH4.
- static from_bytes(data: bytes) ChemicalSystem¶
Constructs and returns a new ChemicalSystem from its binary representation, see to_bytes.
- static from_cif(filename: str) ChemicalSystem¶
Constructs and returns a new ChemicalSystem from a CIF (Crystallographic Information File).
- static from_dmol(filename: str) ChemicalSystem¶
Constructs and returns a new ChemicalSystem from a DMol3 .dmol file.
- static from_file(filename: str, format: str = '') ChemicalSystem¶
Constructs and returns a new ChemicalSystem from a file, deducing the format from the filename unless given explicitly.
- static from_in(filename: str, name: str = '') ChemicalSystem¶
Constructs and returns a new ChemicalSystem from a (possibly named) System block in an AMS input file.
- static from_input(input_file: scm.base._internal.InputFile, prefix: str) ChemicalSystem¶
Constructs and returns a new ChemicalSystem from an InputFile instance, given a prefix, e.g. ‘System[1]%’.
- static from_kf(*args, **kwargs)¶
Overloaded function.
from_kf(filename: str, section: str = ‘Molecule’) -> scm.base._internal.ChemicalSystem
Constructs and returns a new ChemicalSystem from a section on a KF file.
from_kf(kf: scm.base._internal.KFFile, section: str = ‘Molecule’) -> scm.base._internal.ChemicalSystem
Constructs and returns a new ChemicalSystem from a section on a KF file.
- static from_mol(filename: str) ChemicalSystem¶
Constructs and returns a new ChemicalSystem from an MDL MOL file, using RDKit as backend.
- static from_mol2(filename: str) ChemicalSystem¶
Constructs and returns a new ChemicalSystem from an extended MOL2 file.
- static from_pdb(filename: str) ChemicalSystem¶
Constructs and returns a new ChemicalSystem from a PDB file, using RDKit as backend.
- static from_poscar(filename: str) ChemicalSystem¶
Constructs and returns a new ChemicalSystem from a VASP POSCAR / CONTCAR file.
- static from_sdf(filename: str, include_data: bool = False) object¶
Constructs and returns ChemicalSystems from an MDL SDF file.
- static from_smiles(smiles: str, optimize_with_uff: bool = True, num_trial_conformers: int = 10) ChemicalSystem¶
Constructs and returns a new ChemicalSystem from a SMILES string.
- static from_string(content: str, format: str) ChemicalSystem¶
Constructs and returns a new ChemicalSystem from an in-memory string. The format is required (there is no filename to deduce it from). The binary ‘kf’/’rkf’ format is not supported.
- static from_xyz(filename: str) ChemicalSystem¶
Constructs and returns a new ChemicalSystem from an extended XYZ file.
- geometric_center(self: ChemicalSystem, unit: str = 'angstrom') numpy.ndarray[numpy.float64[3, 1]]¶
Position of the geometric center.
- get_address(self: ChemicalSystem) int¶
- get_all_rings(self: ChemicalSystem) list[list[int]]¶
Return all unique rings as lists of atom indices.
Note: only rings of up to 10 atoms are considered, so macro-cycles will not be included. Ring detection is not implemented for periodic systems.
- get_angle(*args, **kwargs)¶
Overloaded function.
get_angle(self: scm.base._internal.ChemicalSystem, a: int, b: int, c: int, unit: str = ‘radians’) -> float
Measures the angle A-B-C between three atoms, given their indices.
get_angle(self: scm.base._internal.ChemicalSystem, a: scm.base._internal.Atom, b: scm.base._internal.Atom, c: scm.base._internal.Atom, unit: str = ‘radians’) -> float
Measures the angle A-B-C between three Atom instances.
- get_atoms_in_region(self: ChemicalSystem, region: str) numpy.ndarray[numpy.int32[m, 1]]¶
Returns a sorted array of atom indices of all atoms in a region or region expression.
- get_atoms_outside_region(self: ChemicalSystem, region: str) numpy.ndarray[numpy.int32[m, 1]]¶
Returns a sorted array of atom indices of all atoms outside of a region or region expression.
- get_chemical_descriptors(self: ChemicalSystem) dict[str, float]¶
Returns a dict of common cheminformatics descriptors (MolLogP, TPSA, molecular weight, …), computed by RDKit.
- get_connected_atoms(self: ChemicalSystem, atidx: int, depth: int) list[int]¶
Returns all atoms connected to the starting atom within the specified bond-graph depth (excluding the starting atom itself). Negative depth means infinite depth (i.e. entire connected component excluding the starting atom itself).
- get_coordination_shells(self: ChemicalSystem, atidx: int, depth: int, ignore_hydrogens: bool = False) list[list[int]]¶
Returns atoms organized by bond-graph distance from the starting atom. shells[0] contains the starting atom, shells[1] contains directly bonded atoms, shells[2] contains second neighbors, etc. Negative depth means infinite depth (traverse entire connected component).
- get_dihedral(*args, **kwargs)¶
Overloaded function.
get_dihedral(self: scm.base._internal.ChemicalSystem, a: int, b: int, c: int, d: int, unit: str = ‘radians’) -> float
Measures the dihedral angle A-B-C-D between four atoms, given their indices.
get_dihedral(self: scm.base._internal.ChemicalSystem, a: scm.base._internal.Atom, b: scm.base._internal.Atom, c: scm.base._internal.Atom, d: scm.base._internal.Atom, unit: str = ‘radians’) -> float
Measures the dihedral angle A-B-C-D between four Atom instances.
- get_distance(*args, **kwargs)¶
Overloaded function.
get_distance(self: scm.base._internal.ChemicalSystem, a: int, b: int, unit: str = ‘angstrom’) -> float
Measures the distance between two atoms, given their indices.
get_distance(self: scm.base._internal.ChemicalSystem, a: scm.base._internal.Atom, b: scm.base._internal.Atom, unit: str = ‘angstrom’) -> float
Measures the distance between two Atom instances.
- get_distances_to_point(self: ChemicalSystem, point: numpy.ndarray[numpy.float64[3, 1]], unit: str = 'angstrom') numpy.ndarray[numpy.float64[m, 1]]¶
Returns the distance of each atom from a given point.
- get_formal_charges(self: ChemicalSystem) numpy.ndarray[numpy.int32[m, 1]]¶
Guess a per-atom formal charge from the elements and bond orders.
- get_fractional_coordinate(self: ChemicalSystem, atom: Atom, unit: str = 'angstrom') numpy.ndarray[numpy.float64[3, 1]]¶
Returns the fractional coordinate of a single atom with respect to the cell. In non-periodic directions the plain coordinates are returned in the specified unit.
- get_fractional_coordinates(self: ChemicalSystem, unit: str = 'angstrom') numpy.ndarray[numpy.float64[m, 3]]¶
Returns the fractional coordinates of all atoms with respect to the cell. In non-periodic directions the plain coordinates are returned in the specified unit.
- static get_operands_in_region_expression(region_expression: str) list[str]¶
Returns a sorted list of all unique operands used in a region expression.
- get_regions_of_atom(*args, **kwargs)¶
Overloaded function.
get_regions_of_atom(self: scm.base._internal.ChemicalSystem, atom: int) -> list[str]
Returns an alphabetically sorted list of the names of all regions an atom is part of.
get_regions_of_atom(self: scm.base._internal.ChemicalSystem, atom: scm.base._internal.Atom) -> list[str]
Returns an alphabetically sorted list of the names of all regions an atom is part of.
- get_selected_atoms(self: ChemicalSystem) numpy.ndarray[numpy.int32[m, 1]]¶
Returns an array of indices of all selected atoms.
- get_species(self: ChemicalSystem, comp: Callable[[Atom, Atom], bool]) list[list[int]]¶
Determines the present atomic species, based on a user defined comparator function.
- get_tree(self: ChemicalSystem, start: int = 0) list[tuple[int | None, int]]¶
Return tree representation of self (e.g. [(None, 0), (0, 2), (2, 3), (1, 4)]).
- guess_bonds(self: ChemicalSystem, connectors_override: object = None, dmax: float = 1.28, atom_indices: object = None) None¶
Guesses bonds based on the atomic elements and the geometry.
- has_bonds(self: ChemicalSystem) bool¶
Checks if the system has any bonding information.
- has_ghost_atoms(self: ChemicalSystem) bool¶
Checks whether the ChemicalSystem contains any Ghost atoms.
- has_lattice(self: ChemicalSystem) bool¶
Checks if the system has a lattice.
- has_periodically_equivalent_geometry(self: ChemicalSystem, other: ChemicalSystem, tol: float = 0.001, unit: str = 'angstrom') bool¶
Checks if two systems have the same lattice and atomic coordinates that are equal modulo lattice translations (minimum-image convention).
- has_region(self: ChemicalSystem, region: str) bool¶
Checks if a region exists in the system, given its region name.
- has_same_atoms(*args, **kwargs)¶
Overloaded function.
has_same_atoms(self: scm.base._internal.ChemicalSystem, other: scm.base._internal.ChemicalSystem, properties: list[str] = []) -> bool
Checks if two systems have identical atoms in the same order.
has_same_atoms(self: scm.base._internal.ChemicalSystem, other: scm.base._internal.ChemicalSystem, comp: Callable[[scm.base._internal.Atom, scm.base._internal.Atom], bool]) -> bool
Checks if two systems have identical atoms in the same order given a user defined comparator.
- has_same_coords(self: ChemicalSystem, other: ChemicalSystem, tol: float = 0.001, unit: str = 'angstrom') bool¶
Checks if the atomic coordinates of two systems are within a threshold of each other.
- has_same_geometry(self: ChemicalSystem, other: ChemicalSystem, tol: float = 0.001, unit: str = 'angstrom') bool¶
Checks if the atomic coordinates and lattice vectors of two systems are within a threshold of each other.
- has_same_regions(self: ChemicalSystem, other: ChemicalSystem) bool¶
Checks if two systems have identical regions, meaning region names and included atom indices.
- has_same_selection(self: ChemicalSystem, other: ChemicalSystem, consider_selection_order: bool = False) bool¶
Checks if two systems have the same atom selection.
- hash(self: ChemicalSystem, depth: int = -1, coordination: bool = True, bond_orders: bool = False, ez_stereo: bool = False, rs_stereo: bool = False, ring: bool = False, implicit_h: bool = False) int¶
Compute a hash-based identifier for the molecule.
- inertia_tensor(self: ChemicalSystem) numpy.ndarray[numpy.float64[3, 3]]¶
Returns the system’s inertia tensor as a 3x3 matrix (units amu*angstrom^2).
- invert_selection(self: ChemicalSystem) None¶
Inverts the set of selected atoms.
- is_atom_in_region(*args, **kwargs)¶
Overloaded function.
is_atom_in_region(self: scm.base._internal.ChemicalSystem, atom: int, region: str) -> bool
Checks if an atom is in a region or region expression.
is_atom_in_region(self: scm.base._internal.ChemicalSystem, atom: scm.base._internal.Atom, region: str) -> bool
Checks if an atom is in a region or region expression.
- is_atom_outside_region(*args, **kwargs)¶
Overloaded function.
is_atom_outside_region(self: scm.base._internal.ChemicalSystem, atom: int, region: str) -> bool
Checks if an atom is outside of a region or region expression.
is_atom_outside_region(self: scm.base._internal.ChemicalSystem, atom: scm.base._internal.Atom, region: str) -> bool
Checks if an atom is outside of a region or region expression.
- is_atom_selected(*args, **kwargs)¶
Overloaded function.
is_atom_selected(self: scm.base._internal.ChemicalSystem, arg0: int) -> bool
Checks if an atom is currently selected, given its index.
is_atom_selected(self: scm.base._internal.ChemicalSystem, arg0: scm.base._internal.Atom) -> None
Checks if an instance of an atom is currently selected.
- is_linear(self: ChemicalSystem) bool¶
Checks is a ChemicalSystem is linear.
- make_conventional_cell(self: ChemicalSystem, precision: float = 0.1) ChemicalSystem¶
Create a conventional cell while retaining charge, regions, and bonds.
- make_primitive_cell(self: ChemicalSystem, precision: float = 0.1) ChemicalSystem¶
Create a primitive cell while retaining charge, regions, and bonds.
- make_selection_cappable(self: ChemicalSystem) None¶
Extends the current selection but does not cross single bonds, unless they are to hydrogen atoms.
- make_slab_layers(self: ChemicalSystem, miller: numpy.ndarray[numpy.int32[m, 1]], num_layers: int, translate: float = 0.0, unit: str = 'angstrom', ref_atom: int | None = None) ChemicalSystem¶
Create a new system which is a 2D slab, by slicing a 3D system, specifying the number of layers in the resulting slab.
- make_slab_thickness(self: ChemicalSystem, miller: numpy.ndarray[numpy.int32[m, 1]], top: float, bottom: float, translate: float = 0.0, unit: str = 'angstrom', ref_atom: int | None = None) ChemicalSystem¶
Create a new system which is a 2D slab, by slicing a 3D system, specifying the upper and lower bound of the resulting slab.
- make_supercell(self: ChemicalSystem, supercell: numpy.ndarray[numpy.int32[m, 1]]) ChemicalSystem¶
Create a supercell by scaling the lattice vectors.
- make_supercell_trafo(self: ChemicalSystem, supercell: numpy.ndarray[numpy.int32[m, n]]) ChemicalSystem¶
Create a supercell by creating the matrix product of the lattice vectors and the supercell matrix.
- map_atoms(*args, **kwargs)¶
Overloaded function.
map_atoms(self: scm.base._internal.ChemicalSystem, start_range: float) -> tuple[bool, numpy.ndarray[numpy.int32[m, 3]]]
Maps all atoms into a unit cell from [start_range:start_range+1] in fractional coordinates.
map_atoms(self: scm.base._internal.ChemicalSystem, start_range: numpy.ndarray[numpy.float64[m, 1]]) -> tuple[bool, numpy.ndarray[numpy.int32[m, 3]]]
Maps all atoms into a unit cell from [start_range:start_range+1] in fractional coordinates.
- map_atoms_around_atom(*args, **kwargs)¶
Overloaded function.
map_atoms_around_atom(self: scm.base._internal.ChemicalSystem, atom: scm.base._internal.Atom) -> tuple[bool, numpy.ndarray[numpy.int32[m, 3]]]
Map all atoms around the chosen atom that will be in the center of the new unit cell.
map_atoms_around_atom(self: scm.base._internal.ChemicalSystem, atom: int) -> tuple[bool, numpy.ndarray[numpy.int32[m, 3]]]
Map all atoms around the chosen atom that will be in the center of the new unit cell.
- map_atoms_continuous(*args, **kwargs)¶
Overloaded function.
map_atoms_continuous(self: scm.base._internal.ChemicalSystem) -> bool
Map all atoms that are bonded across the periodic boundary back.
map_atoms_continuous(self: scm.base._internal.ChemicalSystem, atom_indices: numpy.ndarray[numpy.int32[m, 1]]) -> bool
Map the connected components reached from the chosen atoms continuous across the periodic boundary.
- molecule_indices(self: ChemicalSystem) numpy.ndarray[numpy.int32[m, 1]]¶
Returns a
num_atomssized array mapping the atoms to connected molecules of the system.
- molgraph_dijkstra(self: ChemicalSystem, from_atidx: int, dist_func: Callable[[int, int, Bond], float], to_atidx: int = -1) tuple[list[float], list[int], list[bool]]¶
General method implementing the Dijkstra algorithm on the molecular graph.
- moments_of_inertia(self: ChemicalSystem) tuple[numpy.ndarray[numpy.float64[3, 1]], numpy.ndarray[numpy.float64[3, 3]]]¶
Calculates the system’s moments of inertia and the corresponding principal axes (units amu*angstrom^2).
- moving_atoms_for_angle_change(self: scm.base._internal.ChemicalSystem, a: int, b: int, c: int, policy: scm.base._internal.ChemicalSystem.InternalCoordinateManipulationPolicy = <InternalCoordinateManipulationPolicy.SecondPartMoves: 1>) numpy.ndarray[numpy.int32[m, 1]]¶
Determines which atoms will move when changing the angle between three atoms.
- moving_atoms_for_dihedral_change(self: scm.base._internal.ChemicalSystem, a: int, b: int, c: int, d: int, policy: scm.base._internal.ChemicalSystem.InternalCoordinateManipulationPolicy = <InternalCoordinateManipulationPolicy.SecondPartMoves: 1>) numpy.ndarray[numpy.int32[m, 1]]¶
Determines which atoms will move when changing the dihedral between four atoms.
- moving_atoms_for_distance_change(self: scm.base._internal.ChemicalSystem, a: int, b: int, policy: scm.base._internal.ChemicalSystem.InternalCoordinateManipulationPolicy = <InternalCoordinateManipulationPolicy.SecondPartMoves: 1>) numpy.ndarray[numpy.int32[m, 1]]¶
Determines which atoms will move when changing the distance between two atoms.
- num_atoms_in_region(self: ChemicalSystem, region: str) int¶
Returns the number of atoms in a region or region expression.
- num_atoms_outside_region(self: ChemicalSystem, region: str) int¶
Returns the number of atoms outside of a region or region expression.
- num_molecules(self: ChemicalSystem) int¶
Counts the number of connected molecules that are part of this system.
- num_selected_atoms(self: ChemicalSystem) int¶
The number of currently selected atoms.
- perturb_coordinates(self: ChemicalSystem, noise_level: float, unit: str = 'angstrom') None¶
Perturb the atomic coordinates by adding random numbers between to each Cartesian component.
- perturb_lattice(self: ChemicalSystem, noise_level: float) None¶
Perturb the lattice vectors by applying a random strain.
- remove_all_regions(self: ChemicalSystem) None¶
Removes all regions. All atoms will keep existing, but will not longer be part of any region.
- remove_atom(self: ChemicalSystem, atom_index: int) None¶
Removes a single atom from the system, given its index.
- remove_atom_from_all_regions(*args, **kwargs)¶
Overloaded function.
remove_atom_from_all_regions(self: scm.base._internal.ChemicalSystem, atom: int) -> None
Removes an atom from all regions.
remove_atom_from_all_regions(self: scm.base._internal.ChemicalSystem, atom: scm.base._internal.Atom) -> None
Removes an atom from all regions.
- remove_atom_from_region(*args, **kwargs)¶
Overloaded function.
remove_atom_from_region(self: scm.base._internal.ChemicalSystem, atom: int, region: str) -> None
Removes an atom from a region.
remove_atom_from_region(self: scm.base._internal.ChemicalSystem, atom: scm.base._internal.Atom, region: str) -> None
Removes an atom from a region.
- remove_atoms(self: ChemicalSystem, atom_indices: numpy.ndarray[numpy.int32[m, 1]]) None¶
Removes multiple atoms from the system, given their atom indices.
- remove_atoms_from_region(self: ChemicalSystem, atom_indices: numpy.ndarray[numpy.int32[m, 1]], region: str) None¶
Adds multiple atoms to a region, given their atom indices.
- remove_region(self: ChemicalSystem, region: str) None¶
Removes a region. Atoms in that region will keep existing, but will not longer be part of that region.
- reorder_atoms(self: ChemicalSystem, atom_order: list[int]) None¶
Reorders the system’s atoms given a list of atom indices in the desired order.
- reorder_to_match(self: ChemicalSystem, other: ChemicalSystem, depth: int = -1, coordination: bool = True, bond_orders: bool = False, ez_stereo: bool = False, rs_stereo: bool = False, ring: bool = False, implicit_h: bool = False) None¶
Reorder self to match other, based on hash-based atomic structure identifiers.
- static rmsd(a: ChemicalSystem, b: ChemicalSystem, align: bool, unit: str = 'angstrom') float¶
Computes the RMSD between two systems. ‘align’: whether or not the systems should be roto-translated as to maximize the RMSD.
- rotate(self: ChemicalSystem, rot_mat: numpy.ndarray[numpy.float64[3, 3]]) None¶
Rotate the system according to the rotation matrix.
- rotation_axis_for_angle_change(self: ChemicalSystem, arg0: int, arg1: int, arg2: int) numpy.ndarray[numpy.float64[3, 1]]¶
Determines the rotation axis for changing the angle between three atoms.
- static rotation_matrix_minimizing_rmsd(a: ChemicalSystem, b: ChemicalSystem) numpy.ndarray[numpy.float64[3, 3]]¶
Given two chemical systems, returns the rotation matrix that minimizes the RMSD.
- select_all(self: ChemicalSystem) None¶
Selects all atoms.
- select_atom(*args, **kwargs)¶
Overloaded function.
select_atom(self: scm.base._internal.ChemicalSystem, arg0: int) -> None
Selects an atom given its index.
select_atom(self: scm.base._internal.ChemicalSystem, arg0: scm.base._internal.Atom) -> None
Selects an instance of an atom.
- select_atom_close_to_origin(self: ChemicalSystem) None¶
Selects the atom that is closest to the origin of the coordinate system.
- select_atoms(self: ChemicalSystem, atom_indices: numpy.ndarray[numpy.int32[m, 1]]) None¶
Selects multiple atoms at once, given their atom indices.
- select_atoms_if(self: ChemicalSystem, pred: Callable[[Atom], bool]) None¶
Selects atoms based on a predicate function.
- select_atoms_of_same_type(self: ChemicalSystem) None¶
Selects all atoms whose element is the same as of a currently selected atom.
- select_connected(self: ChemicalSystem) None¶
Selects all atoms bonded to the currently selected atoms.
- select_connected_if(self: ChemicalSystem, pred: Callable[[Atom, Atom, Bond], bool]) None¶
Selects atoms bonded to the currently selected atoms based on a predicate function.
- select_molecule(self: ChemicalSystem) None¶
Using the bonds, selects entire molecules that include any currently selected atom.
- select_molecule_if(self: ChemicalSystem, pred: Callable[[Atom, Atom, Bond], bool]) None¶
Using the bonds and a predicate function, selects all molecules that include a currently selected atom.
- select_region(self: ChemicalSystem, region: str) None¶
Selects atoms in a region or region expression.
- select_within_radius(self: ChemicalSystem, radius: float, unit: str = 'angstrom') None¶
Selects all atoms within a given radius of any of the currently selected atoms.
- set_angle(*args, **kwargs)¶
Overloaded function.
set_angle(self: scm.base._internal.ChemicalSystem, a: int, b: int, c: int, angle: float, policy: scm.base._internal.ChemicalSystem.InternalCoordinateManipulationPolicy = <InternalCoordinateManipulationPolicy.SecondPartMoves: 1>) -> None
Sets the angle between three atoms by moving atoms according to a policy.
set_angle(self: scm.base._internal.ChemicalSystem, a: int, b: int, c: int, angle: float, unit: str, policy: scm.base._internal.ChemicalSystem.InternalCoordinateManipulationPolicy = <InternalCoordinateManipulationPolicy.SecondPartMoves: 1>) -> None
Sets the angle between three atoms by moving atoms according to a policy.
set_angle(self: scm.base._internal.ChemicalSystem, a: int, b: int, c: int, angle: float, rotation_axis: numpy.ndarray[numpy.float64[3, 1]], moving_atoms: numpy.ndarray[numpy.int32[m, 1]]) -> None
Sets the angle between three atoms by moving a specified set of atoms.
set_angle(self: scm.base._internal.ChemicalSystem, a: int, b: int, c: int, angle: float, unit: str, rotation_axis: numpy.ndarray[numpy.float64[3, 1]], moving_atoms: numpy.ndarray[numpy.int32[m, 1]]) -> None
Sets the angle between three atoms by moving a specified set of atoms.
- set_atom(self: ChemicalSystem, atom_index: int, atom: Atom) None¶
Safe assignment of an Atom instance to atoms[atom_index].
- set_atoms_in_region(self: ChemicalSystem, atom_indices: numpy.ndarray[numpy.int32[m, 1]], region: str) None¶
Creates or sets an entire region given the indices of the atoms to be part of the region.
- set_density(self: ChemicalSystem, target_density: float, unit: str = 'dalton/angstrom3') None¶
Applies a uniform strain to match the specified target density. Only valid for 3D periodic systems.
- set_dihedral(*args, **kwargs)¶
Overloaded function.
set_dihedral(self: scm.base._internal.ChemicalSystem, a: int, b: int, c: int, d: int, angle: float, policy: scm.base._internal.ChemicalSystem.InternalCoordinateManipulationPolicy = <InternalCoordinateManipulationPolicy.SecondPartMoves: 1>) -> None
Sets the dihedral between four atoms by moving atoms according to a policy.
set_dihedral(self: scm.base._internal.ChemicalSystem, a: int, b: int, c: int, d: int, angle: float, unit: str, policy: scm.base._internal.ChemicalSystem.InternalCoordinateManipulationPolicy = <InternalCoordinateManipulationPolicy.SecondPartMoves: 1>) -> None
Sets the dihedral between four atoms by moving atoms according to a policy.
set_dihedral(self: scm.base._internal.ChemicalSystem, a: int, b: int, c: int, d: int, angle: float, moving_atoms: numpy.ndarray[numpy.int32[m, 1]]) -> None
Sets the dihedral between four atoms by moving a specified set of atoms.
set_dihedral(self: scm.base._internal.ChemicalSystem, a: int, b: int, c: int, d: int, angle: float, unit: str, moving_atoms: numpy.ndarray[numpy.int32[m, 1]]) -> None
Sets the dihedral between four atoms by moving a specified set of atoms.
- set_distance(*args, **kwargs)¶
Overloaded function.
set_distance(self: scm.base._internal.ChemicalSystem, a: int, b: int, dist: float, policy: scm.base._internal.ChemicalSystem.InternalCoordinateManipulationPolicy = <InternalCoordinateManipulationPolicy.SecondPartMoves: 1>) -> None
Sets the distance between two atoms by moving atoms according to a policy.
set_distance(self: scm.base._internal.ChemicalSystem, a: int, b: int, dist: float, unit: str, policy: scm.base._internal.ChemicalSystem.InternalCoordinateManipulationPolicy = <InternalCoordinateManipulationPolicy.SecondPartMoves: 1>) -> None
Sets the distance between two atoms by moving atoms according to a policy.
set_distance(self: scm.base._internal.ChemicalSystem, a: int, b: int, dist: float, moving_atoms: numpy.ndarray[numpy.int32[m, 1]]) -> None
Sets the distance between two atoms by moving a specified set of atoms.
set_distance(self: scm.base._internal.ChemicalSystem, a: int, b: int, dist: float, unit: str, moving_atoms: numpy.ndarray[numpy.int32[m, 1]]) -> None
Sets the distance between two atoms by moving a specified set of atoms.
- set_fractional_coordinates(self: ChemicalSystem, frac_coords: numpy.ndarray[numpy.float64[m, 3]], unit: str = 'angstrom') None¶
Sets the fractional coordinates of all atoms. In non-periodic directions the plain coordinates should be passed in the specified unit.
- set_lattice_displacements_from_minimum_image_convention(self: ChemicalSystem) None¶
Applies the minimum image convention which sets the lattice_displacements for all bonds to be the shortest possible.
- set_num_lattice_vectors(self: ChemicalSystem, nvec: int) None¶
Sets the number of lattice vectors.
- set_selected_atoms(self: ChemicalSystem, atom_indices: numpy.ndarray[numpy.int32[m, 1]]) None¶
Sets the selection to the given atom indices. Any previous selection is cleared.
- sg1_hashes(self: ChemicalSystem, depth: int = -1) list[int]¶
Compute sg1 hashes for the fast sigma.
- shortest_path_between(*args, **kwargs)¶
Overloaded function.
shortest_path_between(self: scm.base._internal.ChemicalSystem, from_atom: int, to_atom: int, dist_func: Callable[[int, int, scm.base._internal.Bond], float]) -> Optional[list[int]]
Returns the shortest path between two atoms (using a custom distance function).
shortest_path_between(self: scm.base._internal.ChemicalSystem, from_atom: int, to_atom: int) -> Optional[list[int]]
Returns the shortest path between two atoms (measured in number of hops).
shortest_path_between(self: scm.base._internal.ChemicalSystem, from_atom: scm.base._internal.Atom, to_atom: scm.base._internal.Atom, dist_func: Callable[[int, int, scm.base._internal.Bond], float]) -> Optional[list[int]]
Returns the shortest path between two atoms (using a custom distance function).
shortest_path_between(self: scm.base._internal.ChemicalSystem, from_atom: scm.base._internal.Atom, to_atom: scm.base._internal.Atom) -> Optional[list[int]]
Returns the shortest path between two atoms (measured in number of hops).
- shortest_path_length_between(*args, **kwargs)¶
Overloaded function.
shortest_path_length_between(self: scm.base._internal.ChemicalSystem, from_atom: int, to_atom: int, dist_func: Callable[[int, int, scm.base._internal.Bond], float]) -> float
Returns the lengths of the shortest path between two atoms (measured using a custom distance function).
shortest_path_length_between(self: scm.base._internal.ChemicalSystem, from_atom: int, to_atom: int) -> float
Returns the length of the shortest path between two atoms (measured in number of hops).
shortest_path_length_between(self: scm.base._internal.ChemicalSystem, from_atom: scm.base._internal.Atom, to_atom: scm.base._internal.Atom, dist_func: Callable[[int, int, scm.base._internal.Bond], float]) -> float
Returns the lengths of the shortest path between two atoms (measured using a custom distance function).
shortest_path_length_between(self: scm.base._internal.ChemicalSystem, from_atom: scm.base._internal.Atom, to_atom: scm.base._internal.Atom) -> float
Returns the length of the shortest path between two atoms (measured in number of hops).
- shortest_path_lengths_from(*args, **kwargs)¶
Overloaded function.
shortest_path_lengths_from(self: scm.base._internal.ChemicalSystem, from_atom: int, dist_func: Callable[[int, int, scm.base._internal.Bond], float]) -> list[float]
Returns the lengths of all shortest paths from a source atom using a custom distance function.
shortest_path_lengths_from(self: scm.base._internal.ChemicalSystem, from_atom: int) -> list[float]
Returns the lengths (in number of hops) of all shortest paths from a source atom.
shortest_path_lengths_from(self: scm.base._internal.ChemicalSystem, from_atom: scm.base._internal.Atom, dist_func: Callable[[int, int, scm.base._internal.Bond], float]) -> list[float]
Returns the lengths of all shortest paths from a source atom using a custom distance function.
shortest_path_lengths_from(self: scm.base._internal.ChemicalSystem, from_atom: scm.base._internal.Atom) -> list[float]
Returns the lengths (in number of hops) of all shortest paths from a source atom.
- smallest_ring_containing_atom(self: ChemicalSystem, atom_index: int) list[int]¶
Returns the smallest ring containing the atom.
- sort_atoms(self: ChemicalSystem, comp: Callable[[Atom, Atom], bool]) None¶
Sorts the system’s atoms according to a user defined comparator function.
- sorted_atom_order(self: ChemicalSystem, comp: Callable[[Atom, Atom], bool]) list[int]¶
Returns the atom order based on a user defined comparator function as a list of atom indices.
- split(self: ChemicalSystem, part_indices: numpy.ndarray[numpy.int32[m, 1]]) list[ChemicalSystem]¶
Splits the system into parts and returns a list of these parts as separate systems.
- split_into_molecules(self: ChemicalSystem) list[ChemicalSystem]¶
Splits the system into individual molecules based on the connectivity between atoms.
- squared_distance_matrix(*args, **kwargs)¶
Overloaded function.
squared_distance_matrix(self: scm.base._internal.ChemicalSystem, unit: str = ‘angstrom2’) -> numpy.ndarray[numpy.float64[m, n]]
Returns the matrix of squared distances between all atoms in the system.
squared_distance_matrix(self: scm.base._internal.ChemicalSystem, atom_indices: numpy.ndarray[numpy.int32[m, 1]], unit: str = ‘angstrom2’) -> numpy.ndarray[numpy.float64[m, n]]
Returns the matrix of squared distances between a subset of atoms in the system.
squared_distance_matrix(self: scm.base._internal.ChemicalSystem, from_indices: numpy.ndarray[numpy.int32[m, 1]], to_indices: numpy.ndarray[numpy.int32[m, 1]], unit: str = ‘angstrom2’) -> numpy.ndarray[numpy.float64[m, n]]
Returns the matrix of squared distances between two subsets of atoms in the system.
- symmetrize(self: ChemicalSystem) str¶
Symmetrizes a system, using either
symmetrize_moleculeorsymmetrize_cell, depending on periodicity.
- symmetrize_cell(self: ChemicalSystem, precision: float = 0.1) tuple[int, str, str]¶
Symmetrize a 3D cell and return the symmetry symbols (number, international symbol, schoenflies symbol).
- symmetrize_molecule(self: ChemicalSystem, tolerance: float = 0.05) str¶
Symmetrizes and reorients a molecule.
- symmetrize_molecule_to(self: ChemicalSystem, label: str, tolerance: float = 0.05) None¶
Symmetrizes a molecule to a particular symmetry given by a Schoenflies symbol.
- to_bytes(self: ChemicalSystem) bytes¶
Returns an exact binary representation of the ChemicalSystem.
- to_smiles(self: ChemicalSystem) str¶
Returns a canonical SMILES string for the ChemicalSystem, derived from its bonds and geometry.
- total_mass(self: ChemicalSystem) float¶
Total mass in atomic mass units (dalton).
- translate(self: ChemicalSystem, shift: numpy.ndarray[numpy.float64[3, 1]], unit: str = 'angstrom') None¶
Translates all atoms in the ChemicalSystem by a vector.
- write_ase_xyz(self: ChemicalSystem, filename: str) None¶
Writes a ChemicalSystem to an ASE-style extended XYZ file (lattice on the comment line).
- write_cif(self: ChemicalSystem, filename: str) None¶
Writes a ChemicalSystem to a CIF file (P1, no symmetry reduction; requires a 3D lattice).
- write_dmol(self: ChemicalSystem, filename: str) None¶
Writes a ChemicalSystem to a DMol3 .dmol file.
- write_file(self: ChemicalSystem, filename: str, format: str = '') None¶
Writes the ChemicalSystem to a file, deducing the format from the filename unless given explicitly.
- write_in(self: ChemicalSystem, filename: str) None¶
Writes a ChemicalSystem to file as an AMS System block.
- write_kf(*args, **kwargs)¶
Overloaded function.
write_kf(self: scm.base._internal.ChemicalSystem, filename: str, section: str = ‘Molecule’, omode: scm.base._internal.KFFile.OpenMode = <OpenMode.Any: 0>) -> None
Writes a ChemicalSystem to a section on a KF file.
write_kf(self: scm.base._internal.ChemicalSystem, kf: scm.base._internal.KFFile, section: str = ‘Molecule’) -> None
Writes a ChemicalSystem to a section on a KF file.
- write_mol(self: ChemicalSystem, filename: str) None¶
Writes a ChemicalSystem to an MDL MOL file, using RDKit as backend.
- write_mol2(self: ChemicalSystem, filename: str) None¶
Writes a ChemicalSystem to a MOL2 file.
- write_pdb(self: ChemicalSystem, filename: str) None¶
Writes a ChemicalSystem to a PDB file, using RDKit as backend.
- write_poscar(self: ChemicalSystem, filename: str) None¶
Writes a ChemicalSystem to a VASP POSCAR file (requires a 3D lattice).
- static write_sdf(filename: str, systems: list[ChemicalSystem], data: object = None, write_lattice_as_data: bool = True) None¶
Writes ChemicalSystems to an MDL SDF file.
- write_skeletal_image(self: ChemicalSystem, filename: str, width: int = 500, height: int = 400, transparent_background: bool = False) None¶
Writes a 2D skeletal-formula picture of the molecule to an SVG or PNG file (chosen by the extension).
- write_xyz(self: ChemicalSystem, filename: str, extended_xyz_format: bool = True) None¶
Writes a ChemicalSystem to an extended XYZ file.
- property adf_attribs¶
An optional list of all AtomAttributesADF for all atoms.
- property atoms¶
A list of all Atom instances that are part of this ChemicalSystem.
- property band_attribs¶
An optional list of all AtomAttributesBAND for all atoms.
- property bonds¶
The bonds of the system.
- property charge¶
The total charge of the system in in atomic units.
- property coords: AngstromCoordsArray¶
The coordinates of the atoms in Angstrom
- property dftb_attribs¶
An optional list of all AtomAttributesDFTB for all atoms.
- property electrostatic_embedding¶
The electrostatic embedding of the system.
- property forcefield_attribs¶
An optional list of all AtomAttributesForcefield for all atoms.
- property gui_attribs¶
An optional list of all AtomAttributesGUI for all atoms.
- property lattice¶
The lattice of the system.
- property mlpot_attribs¶
An optional list of all AtomAttributesMLPot for all atoms.
- property num_atoms¶
The number of Atoms in the ChemicalSystem.
- property num_regions¶
Returns the number of regions used in the system.
- property qe_attribs¶
An optional list of all AtomAttributesQE for all atoms.
- property reaxff_attribs¶
An optional list of all AtomAttributesReaxFF for all atoms.
- property region_names¶
Returns a list of the names of all regions in the system.
- property vasp_attribs¶
An optional list of all AtomAttributesVASP for all atoms.
- class InternalCoordinateManipulationPolicy¶
Members:
FirstPartMoves
SecondPartMoves
LighterPartMoves
HeavierPartMoves
SmallestPartMoves
LargestPartMoves
- __init__(self: InternalCoordinateManipulationPolicy, value: int) None¶
- property name¶
- class Element
- property Z
The atomic number of the element.
- property bond_guess_connectors
Number of connectors of an atom as used by the AMS bond guessing algorithm.
- property bond_guess_electro_negative
Whether or not an element is considered electronegative by the AMS bond guessing algorithm.
- property bond_guess_metallic
Whether or not an element is considered metallic by the AMS bond guessing algorithm.
- property color
The color of the element used in the AMS graphical user interface.
- property lone_pairs
The element’s number of lone pairs as used by the AMS bond guessing algorithm.
- property mass
The atomic mass (in Dalton) of the most abundant naturally occurring isotope of the element.
- property radius
The covalent radius of the element in angstrom.
- property symbol
The symbol of the element, e.g
Cfor carbon.
- class Elements
- class Atom¶
-
- has_identical_attributes(self: Atom, other: Atom, properties: list[str] = []) bool¶
Checks if two atoms have identical atomic properties.
- transmute(*args, **kwargs)¶
Overloaded function.
transmute(self: scm.base._internal.Atom, Z: int) -> None
Change the element of an atom given an atomic number.
transmute(self: scm.base._internal.Atom, element: scm.base._internal.Element) -> None
Change the element of an Atom of given an Element instance.
transmute(self: scm.base._internal.Atom, symbol: str) -> None
Change the element of an Atom given an element symbol.
- property Z¶
The atomic number of the atom.
- property adf¶
Atomic properties used by the ADF engine.
- property band¶
Atomic properties used by the BAND engine.
- property coords: AngstromCoordsArray¶
The coordinates of the atoms in Angstrom
- property dftb¶
Atomic properties used by the AMS DFTB engine.
- property element¶
Returns the atom’s element.
- property forcefield¶
Atomic properties used by the AMS Forcefield engine.
- property gui¶
Atomic properties used for visualization in the GUI.
- property is_ghost¶
Whether the atom is a Ghost atom.
- property mass¶
The mass of the atom in dalton.
- property mlpot¶
Atomic attributes used by the AMS MLPotential engine.
- property qe¶
Atomic properties used by the AMS QuantumESPRESSO engine.
- property reaxff¶
Atomic properties used by the AMS ReaxFF engine.
- property symbol¶
The atom’s symbol (e.g. ‘C’ or ‘Au’). May be ‘Gh.C’ for ghost atoms.
- property vasp¶
Atomic properties used by the AMS VASP engine.
- class Lattice¶
- cartesian_to_fractional(*args, **kwargs)¶
Overloaded function.
cartesian_to_fractional(self: scm.base._internal.Lattice, cartesian_coords: numpy.ndarray[numpy.float64[m, 1]], unit: str = ‘angstrom’) -> numpy.ndarray[numpy.float64[m, 1]]
Convert Cartesian coordinates to fractional coordinates for a single point. No conversion will take place in non-periodic directions.
cartesian_to_fractional(self: scm.base._internal.Lattice, cartesian_coords: numpy.ndarray[numpy.float64[m, n]], unit: str = ‘angstrom’) -> numpy.ndarray[numpy.float64[m, n]]
Convert Cartesian coordinates to fractional coordinates for a set of points. No conversion will take place in non-periodic directions.
- fractional_to_cartesian(*args, **kwargs)¶
Overloaded function.
fractional_to_cartesian(self: scm.base._internal.Lattice, cartesian_coords: numpy.ndarray[numpy.float64[m, 1]], unit: str = ‘angstrom’) -> numpy.ndarray[numpy.float64[m, 1]]
Convert fractional coordinates to Cartesian coordinates for a single point. No conversion will take place in non-periodic directions.
fractional_to_cartesian(self: scm.base._internal.Lattice, fractional_coords: numpy.ndarray[numpy.float64[m, n]], unit: str = ‘angstrom’) -> numpy.ndarray[numpy.float64[m, n]]
Convert fractional coordinates to Cartesian coordinates for a set of points. No conversion will take place in non-periodic directions.
- static from_kf(kf: scm.base._internal.KFFile, section: str) Lattice¶
Constructs and returns a new Lattice from a section on a KF file.
- static from_lattice_parameters(a: float, b: float = 0.0, c: float = 0.0, alpha: float = 90.0, beta: float = 90.0, gamma: float = 90.0, length_unit: str = 'angstrom', angle_unit: str = 'degree') Lattice¶
Construct a Lattice from cell lengths (a, b, c) and angles (alpha, beta, gamma). The periodicity follows from which lengths are positive: only a is 1D, a and b is 2D, and a, b and c is 3D.
- get_3x3_lattice_vectors(self: Lattice, unit: str = 'angstrom') numpy.ndarray[numpy.float64[m, 3]]¶
Get the lattice vectors as a 3x3 matrix padded out with zeros.
- get_angles(self: Lattice, unit: str = 'rad') numpy.ndarray[numpy.float64[3, 1]]¶
Get the angles between the lattice vectors (note: always returns 3 numbers).
- get_cell_depth(self: Lattice, unit: str = 'angstrom') numpy.ndarray[numpy.float64[3, 1]]¶
Return unit cell depth, or thickness, in each dimension.
- get_lattice_translation(self: Lattice, d: numpy.ndarray[numpy.int32[m, 1]], unit: str = 'angstrom') numpy.ndarray[numpy.float64[3, 1]]¶
Returns the overall translation given a multiple of the lattice vectors.
- get_lengths(self: Lattice, unit: str = 'angstrom') numpy.ndarray[numpy.float64[3, 1]]¶
Get the length of the lattice vectors (note: always returns 3 numbers).
- get_reciprocal_lattice_vectors(self: Lattice, unit: str = 'angstrom-1') numpy.ndarray[numpy.float64[m, 3]]¶
Get the reciprocal lattice vectors as a numpy array.
- get_volume(self: Lattice, unit: str = 'angstrom') float¶
Get the volume of the unit cell (for 2D: area, for 1D length)
- is_close(*args, **kwargs)¶
Overloaded function.
is_close(self: scm.base._internal.Lattice, other: scm.base._internal.Lattice, tol: float = 0.001, unit: str = ‘angstrom’) -> bool
Checks if two sets of lattice vectors are close to each other. (Threshold on norm of vector difference.)
is_close(self: scm.base._internal.Lattice, other: scm.base._internal.Lattice, length_tol: float, angle_tol: float, length_unit: str = ‘angstrom’, angle_unit: str = ‘rad’) -> bool
Checks if two sets of lattice vectors are close to each other. (Thresholds on lengths and angles.)
- map_vector_to_central_cell(self: Lattice, vec: numpy.ndarray[numpy.float64[3, 1]], unit: str = 'angstrom') numpy.ndarray[numpy.float64[3, 1]]¶
Maps a vector into the central cell, such that its fractional coordinates are in range [-0.5,+0.5). No mapping will take place in non-periodic directions.
- map_vectors_to_central_cell(self: Lattice, vecs: numpy.ndarray[numpy.float64[m, 3]], unit: str = 'angstrom') numpy.ndarray[numpy.float64[m, 3]]¶
Maps a set of vectors into the central cell, such that their fractional coordinates are in range [-0.5,+0.5). No mapping will take place in non-periodic directions.
- write_kf(self: Lattice, kf: scm.base._internal.KFFile, section: str) None¶
Writes a Lattice to a section on a KF file.
- property num_vectors¶
Returns the number of lattice vectors (i.e. the number of PBC).
- property vectors: AngstromCoordsArray¶
The lattice vectors in Angstrom
- class Bond¶
-
- property lattice_displacements¶
Lattice displacements for the second atom that is part of the bond.
- property order¶
The order of the bond: 1 = single bond, 1.5 = aromatic bond, 2 = double bond, 3 = triple bond.
- class Bonds¶
- add_bond(self: Bonds, from_atom: int, to_atom: int, bond: Bond) None¶
Adds a bond between two atoms, given their indices.
- add_bonds(*args, **kwargs)¶
Overloaded function.
add_bonds(self: scm.base._internal.Bonds, from_atom: numpy.ndarray[numpy.int32[m, 1]], to_atom: numpy.ndarray[numpy.int32[m, 1]], bonds: Sequence) -> None
Adds bonds between multiple atom pairs at the same time. All arguments should have the same length.
add_bonds(self: scm.base._internal.Bonds, from_atom: numpy.ndarray[numpy.int32[m, 1]], to_atom: numpy.ndarray[numpy.int32[m, 1]], orders: numpy.ndarray[numpy.float64[m, 1]]) -> None
Adds bonds between multiple atom pairs at the same time. All arguments should have the same length.
- any_bond_between(self: Bonds, from_atoms: list[int], to_atoms: list[int]) bool¶
Checks if there is any direct bond between two groups of atoms.
- atoms_are_bonded(self: Bonds, from_atom: int, to_atom: int) bool¶
Checks whether two atoms are bonded or not.
- static from_kf(kf: scm.base._internal.KFFile, section: str) Bonds¶
Constructs and returns new Bonds from a section on a KF file.
- static from_list(num_atoms: int, num_lattice_vectors: int, from_atoms: numpy.ndarray[numpy.int32[m, 1]], to_atoms: numpy.ndarray[numpy.int32[m, 1]], bond_orders: numpy.ndarray[numpy.float64[m, 1]], lattice_displacements: numpy.ndarray[numpy.int32[m, n]] = array([], shape=(0, 0), dtype=int32), indexing: int = 0) Bonds¶
Creates a set of bonds from lists of atom indices, bond orders and optional lattice displacements.
- static from_sparse(num_lattice_vectors: int, row_offset: numpy.ndarray[numpy.int32[m, 1]], column_index: numpy.ndarray[numpy.int32[m, 1]], bond_orders: numpy.ndarray[numpy.float64[m, 1]], lattice_displacements: numpy.ndarray[numpy.int32[m, n]] = array([], shape=(0, 0), dtype=int32), indexing: int = 0) Bonds¶
Low level construction of a set of bonds directly from the (modified) CRS storage.
- get_atomic_valencies(self: Bonds) numpy.ndarray[numpy.float64[m, 1]]¶
Returns the atomic valencies, i.e. the sum of all bond orders, for each atom.
- get_bonded_atoms(self: Bonds, atom: int) list[int]¶
Returns a list of atom indices that are bonded to the given atom index.
- get_bonds_between_atoms(self: Bonds, from_atom: int, to_atom: int) Iterator[tuple[int, int, Bond]]¶
Returns an iterator over the bonds between the given atoms.
- get_bonds_for_atom(self: Bonds, from_atom: int) Iterator[tuple[int, int, Bond]]¶
Returns an iterator over all bonds from a particular atom given by its index.
- num_bonds(*args, **kwargs)¶
Overloaded function.
num_bonds(self: scm.base._internal.Bonds) -> int
Returns the total number of bonds between all atoms.
num_bonds(self: scm.base._internal.Bonds, atom: int) -> int
Returns the total number of bonds of an atom, given its index.
num_bonds(self: scm.base._internal.Bonds, from_atom: int, to_atom: int) -> int
Returns the total number of bonds between two atoms, given their indices.
- remove_bond(*args, **kwargs)¶
Overloaded function.
remove_bond(self: scm.base._internal.Bonds, bond: int) -> None
Removes a bond, given its index in the .bonds attribute.
remove_bond(self: scm.base._internal.Bonds, bond: scm.base._internal.Bond) -> None
Removes a bond from the set.
- remove_bonds(self: Bonds, bidx: list[int]) None¶
Removes multiple bonds at once, given their indices in the .bonds attribute.
- remove_bonds_between_atoms(self: Bonds, from_atom: int, to_atom: int) None¶
Removes the bonds between two atoms, gived their indices.
- remove_bonds_to_atom(self: Bonds, atom: int) None¶
Removes all bonds to a particular atom, given its index.
- remove_bonds_to_atoms(self: Bonds, remove_atoms: numpy.ndarray[numpy.int32[m, 1]]) None¶
Removes all bonds for a list of atoms given by their indices.
- round_bond_orders(self: Bonds) None¶
Snaps each bond order to the nearest integer or aromatic 1.5, and removes bonds whose order rounds to zero.
- write_kf(self: Bonds, kf: scm.base._internal.KFFile, section: str, write_list_format: bool = True) None¶
Writes Bonds to a section on a KF file.
- property bond_index¶
Bonds are stored as sparse matrix in a modified Compressed Sparse Row format: The index in row_offset represents from_atom, and the value is an offset in column_index and bonds. The values in column_index represent to_atom. Because there can be duplicate indices (periodic bonds), it is not strictly a CSR matrix.
- property bonds¶
Bonds are stored as sparse matrix in a modified Compressed Sparse Row format: The index in row_offset represents from_atom, and the value is an offset in column_index and bonds. The values in column_index represent to_atom. Because there can be duplicate indices (periodic bonds), it is not strictly a CSR matrix.
- property column_index¶
Bonds are stored as sparse matrix in a modified Compressed Sparse Row format: The index in row_offset represents from_atom, and the value is an offset in column_index and bonds. The values in column_index represent to_atom. Because there can be duplicate indices (periodic bonds), it is not strictly a CSR matrix.
- property num_atoms¶
The total number of atoms in the system.
- property num_lattice_vectors¶
The number of lattice vectors of the system.
- property row_offset¶
Bonds are stored as sparse matrix in a modified Compressed Sparse Row format: The index in row_offset represents from_atom, and the value is an offset in column_index and bonds. The values in column_index represent to_atom. Because there can be duplicate indices (periodic bonds), it is not strictly a CSR matrix.