Net

The main entry point for decorating nets with chic is the Net class:

class chic.Net(*args, filename: str, supercells: int = 0, **kwargs)[source]

Bases: Structure

The Net class is a subclass of the Pymatgen Structure class. It is used to specifically for decorating networks with e.g. ZIF nodes and linkers.

classmethod from_structure(structure: Structure, bonding: Bonding, **kwargs) Net[source]

Create a new Net object from an existing Pymatgen Structure.

Parameters:
  • structure – Pymatgen Structure object.

  • bonding – Bonding object.

Returns:

Net object.

classmethod from_topocif(filename: str, **kwargs) Net[source]

Read structure and bonding form TopoCIF.

Parameters:

filename – Filename of TopoCIF.

Returns:

Net object.

rescale(scale_value: float = 3.5, target: str = 'min_a_b') None[source]

Rescale the unit cell.

The provided network may not be a suitable length-scale for the chemistry that is being modelled. This function allows the user to rescale the unit cell to a more suitable length-scale. The rescaling is performed by scaling the unit cell by a factor that is the ratio of the target value to the current value. The target value can be either the minimum A-B bond length or the volume of the unit cell.

Parameters:
  • scale_value – Value to scale the unit cell by.

  • target – Target value to scale the unit cell by. Can be either ‘min_a_b’ or ‘volume’.

reset_decoration() None[source]

Reset the decorating procedures.

add_zif_atoms(template: str = 'H', fallbacks: List[str] | None = None, closest_approach: float = 1.0) None[source]

Decorate the net with zinc nodes and imidazolate linkers with the imidazolate molecules with the provided template.

Parameters:

template – Template ligand for decorating the net. Currently supported templates are ‘H’, and ‘CH3’, with MOF-FF support.

add_zif_atoms_legacy(template: str = 'H') None[source]

Decorate the net with zinc nodes and imidazolate linkers with the imidazolate molecules with the provided template.

Parameters:

template – Template ligand for decorating the net. Currently supported templates are ‘H’, and ‘CH3’, with MOF-FF support.

assign_mofff_topology() None[source]

Assign the topology based on the MOF-FF template.

to_lammps_data(filename: str, skip_topology: bool = False) None[source]

Write full LAMMPS data file.

Parameters:
  • filename – Filename of LAMMPS data file.

  • skip_topology – Whether to skip the topology section.

to_ase_atoms() Atoms[source]

Gather the decorated atoms into an ASE Atoms object.

Returns:

ASE Atoms object.

to_ase_to(filename: str, fmt: str | None = None, **kwargs) None[source]

Use ASE’s writer to write the structure to a file.

Parameters:
  • filename – filename of output file.

  • fmt – format of output file.

replicate(factors: ndarray | None = None) Net[source]

Make a supercell of the net.

Parameters:

factors – Factors by which to replicate the unit cell. Default is [2,2,2].

Returns:

Net object.

check_closest_approach(min_allowed_dist: float = 1.0, min_allowed_dist_h: float = 0.5) bool[source]

Check the closest approach between pairs of atoms.

We divide the minimum allowed distances into those involving hydrogen atoms and those not involving hydrogen atoms. This is because hydrogen will likely have much closer approaches.

Parameters:
  • min_allowed_dist – Minimum allowed distance between two atoms (Å).

  • min_allowed_dist_h – Minimum allowed distance between a hydrogen atom and any other atom (Å).

Returns:

True or False if the closest approach is less than the minimum allowed distance.

check_need_for_supercell(min_number_of_atoms: int = 0) bool[source]

Check if the unit cell needs to be expanded. This is required if the longest bond length is greater than half the shortest cell length.

While we can handle the distances properly by considering the specific periodic image of each bond, in programs such as LAMMPS, for efficiency the minimum image convention (MIC) is assumed, and will therefore misinterpret the bonds.

Parameters:

min_number_of_atoms – Minimum number of atoms in the unit cell.

Returns:

True or False if a supercell is needed.