Comments (5)
Hi @Firaskigali,
Thank you for your question. I would need a minimal non-working example to reproduce this behaviour. I can't seem to reproduce the issue with a minimal example like this:
from dscribe.descriptors import SOAP
from ase.build import bulk
soap_descriptor = SOAP(species=['Cu'], n_max=2, l_max=2, r_cut=5, periodic=True)
system_1x1 = bulk("Cu", "fcc")
features_1x1 = soap_descriptor.create(system_1x1, centers=[0])
system_3x3 = bulk("Cu", "fcc") * [3, 3, 3]
features_3x3 = soap_descriptor.create(system_3x3, centers=[0])
diff = features_1x1-features_3x3
print(diff.max())
where difference seems to be well below numerical accuracy of floating point operations.
Are you sure that you have set periodic boundary conditions correctly both in the descriptor, and in your ASE.Atoms
?
from dscribe.
data.zip
Hi lauri,
Thank you for your response and your example. I have attached two data files: one contained a unit cell of a monoclinic ZrO2 system, and the second file is a 2x2x2 of the unit cell. Then the issue comes when I try to compute the similarity between the first atom, "Zr," in the unit cell and its equivalent atoms in the supercell (the first 8 atoms) as follows:
unit_cell_mono, super_cell_mono = 'ZrO2_mono_111.xyz', 'ZrO2_mono_222.xyz'
system_1x1 = ase.io.read(unit_cell_mono,':')
system_2x2 = ase.io.read(super_cell_mono,':')
metric_soap = AverageKernel(metric="polynomial",gamma=None, degree=4, coef0=1.0, normalize_kernel=True)
soap_descriptor = SOAP(species=['Zr','O'], rcut=2.5, nmax=10, lmax=10, sigma=0.5, periodic=True, rbf='polynomial',crossover=True, sparse=False)
features_1x1 = soap_descriptor.create(system_1x1)
features_2x2 = soap_descriptor.create(system_2x2)
diff = features_1x1[0] - features_2x2 [0]
#diff is not equal to zero
CUB_MONO = []
for j in range(0,8):
sim_kernel = metric_soap.create([features_1x1[0].reshape(1, -1), features_2x2[j].reshape(1, -1)])
CUB_MONO.append(sim_kernel[0][1])
print(j, sim_kernel[0][1])
print(np.mean(CUB_MONO))
The output shows that the average similarity between equivalent atoms is not very close to one. While in your example we can see the average similarity between equivalent atoms is one Why is that? Do you know an explanation of this or any modifications or post-processing that can be done?
Thank you in advance.
Firas
from dscribe.
Hi @Firaskigali,
There is a problem in your structure file ZrO2_mono_222.xyz
: it is not a 2x2x2 version of the unit cell, but instead contains some sort of a rotation of the atom positions.
If you e.g. use ASE to create the 2x2x2 system, you should get correct behaviour:
system_2x2 = system_1x1 * [2, 2, 2]
Below is a full example (base on dscribe==2.1.0, hence the syntax differences) of your script, from which I get the maximum absolute difference of 3.5373242421136986e-13 between the descriptor values.
import numpy as np
import ase.io
from dscribe.descriptors import SOAP
from dscribe.kernels import AverageKernel
unit_cell_mono = 'ZrO2_mono_111.xyz'
system_1x1 = ase.io.read(unit_cell_mono, 0)
system_2x2 = system_1x1 * [2, 2, 2]
metric_soap = AverageKernel(
metric="polynomial",
gamma=None,
degree=4,
coef0=1.0,
normalize_kernel=True
)
soap_descriptor = SOAP(
species=['Zr','O'],
r_cut=2.5,
n_max=10,
l_max=10,
sigma=0.5,
periodic=True,
rbf='polynomial',
compression={"mode": "crossover"},
sparse=False
)
features_1x1 = soap_descriptor.create(system_1x1)
features_2x2 = soap_descriptor.create(system_2x2)
max_diff = np.max(np.abs(features_1x1[0] - features_2x2[0]))
print(f"Maximum difference in SOAP desciptor: {max_diff}")
CUB_MONO = []
for j in range(0, 8):
sim_kernel = metric_soap.create([features_1x1[0].reshape(1, -1), features_2x2[j].reshape(1, -1)])
CUB_MONO.append(sim_kernel[0][1])
print(j, sim_kernel[0][1])
print(np.mean(CUB_MONO))
from dscribe.
Closing as inactive.
from dscribe.
Thank you very much for your help. I duplicated the unit cell as you suggested, and everything is fine now. Thank you.
from dscribe.
Related Issues (20)
- Descriptor that recognizes each atom of the same species differently HOT 1
- The example in README.md is not correct HOT 1
- [Bug] Error in SOAP derivatives when using weighting. HOT 2
- API compatibility is broken since 0696656 HOT 1
- ACSF.create cannot accept cartesian positions as "centers" parameter HOT 2
- Numpy operations on sparsed derivatives HOT 5
- Similarity based on Average kernel obtain deferent value between each atom and its replica atoms. HOT 1
- Segmentation fault in SOAP for l_max > 9 HOT 2
- Analytic Integral of SH expansion coefficients HOT 2
- SOAP polynomial RBF error HOT 3
- issue with "species" HOT 2
- MBTR HOT 3
- ACSF G5 values HOT 2
- Segmentation fault in creation of SOAP descriptor HOT 4
- SOAP_sparse=True HOT 2
- Molecular representations for bio-molecules HOT 1
- Can not Flatten CoulombMatrix HOT 3
- Inconsistency of Numerical SOAP Derivative with Finite-Difference Test HOT 2
- MBTR k2, k3
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from dscribe.