Table of Contents
- Summary
- How to Install
- Introduction of major functions
Summary
pfcc-extras is a library package that gathers convenient tools for tasks such as modeling and result visualization.
Please note that since this is provided as an experimental library package, compatibility with new features is not guaranteed and may be changed or removed without prior notice.
Introduction to pfcc-ase-extras features here
2024.9 note:
ASE 3.23 was released in May 2024. pfcc-extras version 0.9.0 and later are compatible only with ASE 3.23. If you are using ASE 3.22, please use pfcc-extras version 0.8.0 or earlier.
The functions in pfcc and the path to sample scripts were summarized as below.
| Category | Functions | Scripts | Ver |
| Modeling | collision detector |
|
>0.10.0 |
| Modeling |
Extraction from MaterialsProject (data) |
|
>0.5.0 |
| Modeling | liquid generator |
|
>0.8.0 |
| Modeling | make_mol_surface |
|
>0.5.0 |
| Modeling | partial_occupancy |
|
>0.9.0 |
| Modeling |
modeling related modules
|
|
>0.8.0 |
| Modeling |
|
>0.5.0 | |
| Modeling |
|
>=0.11.0 | |
| Modeling |
Select alloy structure (select_subset) |
|
>=0.12.0 |
| Modeling |
|
>=0.12.0 | |
| Modeling |
|
>=0.12.0 | |
| Calculation | adsorption_structure_search |
|
>0.6.0 |
| Calculation | chemical_window |
|
>0.7.0 |
| Calculation |
|
>0.5.0 | |
| Calculation |
|
>=0.11.0 | |
Calculation |
|
>=0.12.0 | |
Calculation |
|
>=0.12.0 | |
| Visualization | isosurface |
|
>0.5.0 |
| Visualization | povray animation |
|
>0.5.0 |
| Visualization |
|
>0.5.0 | |
Visualization |
|
>=0.12.0 | |
| Visualization | wrap_molecule |
|
>0.5.0 |
| Others | isotropic_filter |
|
>0.5.0 |
| Others | jupyter_run |
|
>0.10.0 |
| Others |
|
|
>0.10.0 |
| Others |
|
>0.5.0 | |
Others |
|
>=0.12.0 |
* The all script paths only represents the relative path after "/pfcc-extras-v0.x.0/examples/". tests are also informative if the ipynb file nots exist.
How to install
- Open Package Launcher and move to the bottom to find pfcc-extras package.
- Copy to the directry as zip format
- Right click the file and select “Extract Archive”
-
Open /pfcc-extras-v0.x.0/examples/install.ipynb, and run the cell below
!pip install ..
If you add -e option, the package will be installed in editable mode.
- After install command, please restart the kernel.
Please confirm the completion of the installation as below.- How to restart kernel
- Kernel > Restart Kernel...
- Click "Restart the kernel" button
- Kernel > Restart Kernel...
-
Output example in v0.6.0
import pfcc_extras
print("pfcc_extras version: ", pfcc_extras.__version__)pfcc_extras version: 0.6.0
- How to restart kernel
Introduction of major functions
■ adsorption_structure_search
By using OptunaTM , the black box optimization OSS, the optimization of adsorption structure will be conducted.
There are 4 examples in pfcc-extras.
| file name | adsorbent | adsorbate |
| adsorption_structure_search_for_slab | Ru(111) slab | acrolein |
| adsorption_structure_search_for_porous | SiO2 zeolite | H2O |
| adsorption_structure_search_for_cluster | AuCu cluster | 2-Propen-1-thiol |
| cluster_on_slab | CeO2 slab | Co half cluster |
- Adsorption of acrolein on Ru(111) slab
- Adsorption of H2O in the porous SiO2
- Adsorption of 2-Propen-1-thiol on AuCu cluster
- Adsorption of Co cluster on CeO2 slab
■ chemical_window
Using the chemical potentials of constituent elements as variables, we calculate the range of chemical potentials where the target material can stably exist.
When different phases precipitate experimentally, the relationship between the precipitate phase and the chemical potentials becomes clear.
This allows us to estimate the values of chemical potentials necessary to evaluate the energy of structures deviating from stoichiometric compositions, such as crystal defects or surfaces.
■ collision_detector
The function judges whether the collision atoms (the pair of short distance atoms) exist in the system.
It make easy to find the collision atoms in PBC conditions or manually generated structures.
■ data
The function can extract structure information form Materials Project through mp_api
NOTE) It needs the API key to access Materials Project.
■ get_hkl_bulk_structure
Convert bulk structure into the structure with set miller index
=>
■ isotropic_filter
The filter can convert the stress to the isotropic stress.
■ isosurface
Creates a Gaussian cube file to visualize the diffusion path of specific elements from trajectory data.
The cube file can be loaded into applications such as OVITO, VESTA, and NGLViewer.
How to use:
- Prepare trajectory file as trj.
-
Execute the codes as below.
iso = IsosurfaceCalculator(trj, grid_size = 0.5) )
iso.calculate(symbol = ‘Li’) x
iso.export(‘./output.cube’)
■ jupyter_run
The script can execute another notebooks one by one.
Please use this if you want to separate and execute the steps sequentially.
■ liquid_generator
The function can generate liquid system by packing molecules in the cell.
■ math
gaussian_broadening
The function convert the graph by gaussian broadening method.
■ make_mol_surface
Create the surface strucutre of organic molecules
How to use:
- Prepare the crystal structure
- Define the components (molecule)
- Execute make_mol_surface function
(a) anthracene, (b) graphene, (c) SiO2, (d) CH3, NH3, Pbl3
■ monte_carlo
GCMC
The scripts can conduct Groud canonical Monte Carlo, GCMC
In the example, adsorption of CO2 molecules in Metal-organic-framework (MOFs) was introduced.
Lattice MC
The scripts can conduct Lattice Monte Carlo, LMC.
In the example, the structure search of metal slab with Pt3Au case.
■ partial_occupancy
The example can create the structure from CIF file with occupancy is not 1.
■ povray_animation
Create video files from trajectory file.
The format below can be obtained.
- .gif
- .png
■ shift_energy(deprecated)
Converts the reference value of energy used in Matlantis to the reference value of energy used in VASP.
Since calculation is now possible using `estimator.get_shift_energy_table()` in the pfp-api-client, this feature is deprecated.
■ structure
composition
Creates an alloy with arbitrary ratios or a crystal structure with partial element substitution.
■ solid_solid_interface
Make a solid-solid interface model.
* requires "pymatgen"
Procedure:
- Prepare two different bulk structures
- Each cut into rectangular ("make_rectangular_slab")
- Calculate multiplier that minimizes cell size gap when stacked. ("make_similar_lattice_const_slabs")
- The two are stacked to create an interface structure. ("surface_stack")
- Extract unit cell. ("make_primitive")
- Save
■ select_subset
An algorithm has been added that searches for the most stable structure of an alloy using random substitution, greedy algorithms, and annealing methods.
The greedy algorithm is used to search for stable configurations of alloys. This is effective for creating initial configurations for the Monte Carlo method and for simple screening.
■find_interstitial_sites
Find interstitial sites within a crystal structure and insert atoms into them. This is useful for simulating doping and diffusion, and for exploring new compounds.
■generate_conformers
For the input smiles or atoms, you can get a conformer in atoms type. Detailed argument settings are also possible depending on the purpose.
■ deposition_scheduler
A function has been added to perform MD such as adding and deleting molecules from the calculation system.
- DepositionScheduler: A scheduler that adds molecules to the system during MD calculation.
- DeleteMoleculeScheduler: A scheduler that deletes molecules that have been thrown out of the system during MD calculation.
- TemperatureScaleScheduler: A scheduler that controls the temperature of specified atoms with simple temperature scaling.
■virtual_wall
Added the function to elastically reflect molecules at cell boundaries in MD calculations of non-periodic systems.
■ uniform_electric_field
Conduct MD with uniform electric field
■ visualization
view_ngl
view_ngl is a light-weight visualization tool, quickly allows you to inspect your structure.
Some useful features:
- Change color scheme and ball size
- Save images
- Display force and charge*
- View trajectory file
* Displaying force and charge requires setting calculator.
SurfaceEditor
SurfaceEditor is a versatile editor/visualization tool. (Setting calculator is required)
Some useful features:
- Change color scheme and ball size
- Change view direction
- Select atom to apply changes
- Delete and replace
- Move and rotate
- Check energy and max force
- Perform a quick optimization
- Save images
- Display forces and xyz axes
- Displays atom ID and coordinates (w/Hovering mouse cursor over an atom)
■addEditor
The functionality of the SurfaceEditor has been expanded, and an AddEditor has been added that allows for molecular shaping on a GUI.
Operations can be easily undone (Undo, Redo), carbon chain extension at the clicked index, and hydrogen coverage on the catalyst surface.
■ wrap_molecule
- wrap_molecule() … wrap a molecule that crosses a periodic boundary without splitting it.
- get_mol_index() … Index numbering and labeling for each molecule
- get_mol_list() … Split the Atoms object into separate molecules.
eg.: wrap_molecule()
■reaction_path_MIC
When creating the initial configuration for NEB calculations, if an atom crosses a periodic boundary between images, the atomic position is corrected using the minimum image convention (MIC).
In the example below, the atom in the slab at [1,0,0] is determined to be located across the periodic boundary at [1,1,0], which can cause the interpolation structure to be incorrect. In such cases, it is possible to correctly select atoms within the periodic boundary and interpolate.