suncat-center / catkit Goto Github PK
View Code? Open in Web Editor NEWGeneral purpose tools for high-throughput catalysis
License: GNU General Public License v3.0
General purpose tools for high-throughput catalysis
License: GNU General Public License v3.0
When repeating a 1x1 slab composed of a single element, while periodic boundary conditions are True in at least one dimension, a userwarning is thrown, and the connectivity matrix still reflects the 1x1 slab. Ideally the connectivity matrix would be updated for the repeated (e.g. 2x2) slab.
Seems that starting from 0.5.1, the copy method in gratoms is trying to access _cell, and _pbc attributes. But I don't see those attributes being defined anywhere, nor in ase.
def copy(self): atoms = self.__class__(cell=self._cell, pbc=self._pbc, info=self.info)
Running the code provided at https://catkit-jboes.readthedocs.io/en/latest/_static/frontmatter/catgen.html#org0e3e58d gives an error:
return self._nodes[n]
KeyError: 1
Following the SI of the 2019 paper results in a split adsorbate (C3H5) as shown below
Following the code:
from catkit.gen.surface import SlabGenerator
from catkit.gen.adsorption import Builder
from ase.build import bulk
from ase.io import write
from ase.visualize import view
import numpy as np
from catkit.build import molecule
atoms = bulk('Pd', 'fcc', a=4, cubic=True)
atoms[3].symbol='Au'
gen = SlabGenerator(atoms, miller_index= [1,1,1], layers=6, layer_type='trim', vacuum=10)
slab = gen.get_slab()
exslab=slab.copy()
exslab*=(9,9,1)
exslab.set_cell(slab.cell)
exslab.translate(-4*np.sum(exslab.cell[:2], axis=0))
adsorbate=molecule('C3H5')[4]
builder=Builder(slab)
ads_slab = builder.add_adsorbate(adsorbate, bonds=[0, 2], index=-1)
for aslab in ads_slab:
aslab = aslab.copy()
surf_atoms = np.where(np.in1d(aslab.get_chemical_symbols(), ['Pd', 'Au']))
del aslab[surf_atoms]
aslab += exslab
aslab.set_cell([0, 0, 0])
write('tutorial-1.xyz', ads_slab)
write('tutorial-2.xyz', aslab)
import catkit
catkit.__version__ # '0.5.4'
When using the same catkit.surface.SlabGenerator()
more than once to get adsorption sites (e.g. to get the adsorption sites for more than one termination), it fails with a rather cryptic error message. The problem is demonstrated in this Gist. From the outside it seems counter-intuitive to instantiate a fresh SlabGenerator
before every call to this function.
surface_sites
is very expensive to calculate it should somehow detect if the function has been called with the same slab
argument or a different one than previously and re-calculate the surface_atoms
/surface_sites
iff the slab
has changed.I ran into this issue when trying to adsorb linear molecules with three or more atoms. Here's a small example, adapted from the documentation:
from catkit import Gratoms
from catkit.build import molecule
from catkit.gen.surface import SlabGenerator
from catkit.gen.adsorption import Builder
from catkit.gen.molecules import get_3D_positions
from ase.build import bulk
from ase.visualize import view
slab = SlabGenerator(bulk('Pd'),
miller_index=(1, 1, 1),
layers=8,
vacuum=4,
standardize_bulk=True).get_slab()
adsorbate = molecule('OCO', bond_index=1)[0]
ads_slab = Builder(slab).add_adsorbate(adsorbate, bonds=[1], index=-1)
print('{} adsorption structures generated'.format(len(ads_slab)))
view(ads_slab)
Produces the output:
Traceback (most recent call last):
File "bug.py", line 18, in <module>
ads_slab = Builder(slab).add_adsorbate(adsorbate, bonds=[1], index=-1)
File "/Users/ehermes/Library/Python/3.6/lib/python/site-packages/catkit/gen/adsorption.py", line 525, in add_adsorbate
**kwargs)]
File "/Users/ehermes/Library/Python/3.6/lib/python/site-packages/catkit/gen/adsorption.py", line 602, in _single_adsorption
atoms, branch, root, adsorption=True)
File "/Users/ehermes/Library/Python/3.6/lib/python/site-packages/catkit/gen/molecules.py", line 267, in _branch_molecule
basis[:, 1] *= -np.sin(tor)
IndexError: index 1 is out of bounds for axis 1 with size 1
This seems to happen for high aspect ratio unit cells with many atoms, when the call is made to scipy.spatial.Voronoi
. Can something be done to either:
In surface.py on line 537 and 546 get_point_group() function call should be get_pointgroup, per definition in symmetry.py
Right now the install process is broken since the setup.py line 15 refers to a non-existing directory catkit.api
that no longer exists.
atoms = surface('Pd', size=(3, 3), miller=(1, 1, 1), vacuum=4)
gives out an AttributeError of 'Gratoms' object has no attribute '_cell'. Maybe it is related to the ASE version, I'm using ASE 3.19.1.
I am trying to convert RMG adjacency list molecule specifications into 3D structures, and I've been running into issues where the predicted structures are unreasonable and do not match chemical intuition. As an illustration of the problem, consider the following script, which generates hydrogen peroxide
from catkit.build import molecule
from ase.visualize import view
view(molecule('H2O2')[0])
This results in the following geometry, with the O-O-H bond highlighted to show a bond angle of 180 degrees:
From what I can tell, CatKit determines the bond angles by just looking at the number of bonds each atom has, and assuming the hybridization is whatever a neutral carbon atom would be given the same number of bonds. This breaks for other elements (like oxygen) and for species containing carbon radicals.
Ideally, CatKit would at least be able to generate proper structures for compounds containing oxygen atoms. Perhaps this could be done by connecting dummy "lone pair" atoms to elements like oxygen, then generating the 3D structure and deleting the lone pair sites. This could also be extended to allow for user-specified lone pairs for radical species, which would enable me to quickly convert RMG adjacency lists (which optionally specify lone pairs and lone unpaired electrons) into reasonable 3D structures.
Hallo,
I would like to ask in your webpage you have mentioned Delaunay triangulation symmetries for surface atoms. Is this technique implemented and can it be used to find optimal position of ad-atoms inside a bulk phase. Is this technique depends on adaptive sampling approach.
One more questions regarding CatGen: Catalysis Generator is whether can we construct surfaces of any orientation for any alloys using this tool.
Thank for your input.
Asif
Have you considered merging projects into ase or pymatgen? There are many functions are repeated, and repeated wheel is not a good choice. This can also help some features quickly promote.
I meet a alert, but it looks like nothing serious.
from catkit.build import molecule
/home/xxx/anaconda3/lib/python3.8/site-packages/CatKit-0.5.4-py3.8.egg/catkit/gen/adsorption.py:517: SyntaxWarning: "is" with a literal. Did you mean "=="?
/home/xxx/anaconda3/lib/python3.8/site-packages/CatKit-0.5.4-py3.8.egg/catkit/gen/adsorption.py:517: SyntaxWarning: "is" with a literal. Did you mean "=="?
Creating np.array() from inhomogeneous lists is no longer allowed. "dtype=object" has to be explicitly stated.
Examples where the issue exists:
-catkit.gen.adsorption lines 60-61, 94, 876-877
fix: self.r1_topology = np.array(self.r1_topology) --> self.r1_topology = np.array(self.r1_topology, dtype=object)
D:\Ana\lib\site-packages\catkit\gratoms.py in copy(self)
150 def copy(self):
151 """Return a copy."""
--> 152 atoms = self.class(cell=self._cell, pbc=self._pbc, info=self.info)
153
154 atoms.arrays = {}
AttributeError: 'Gratoms' object has no attribute '_cell'
I cannot run any code with this error. Ask for your help, thank you!
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.