Coder Social home page Coder Social logo

Comments (4)

lauri-codes avatar lauri-codes commented on June 24, 2024

Hi @lundnguy,

Typically the descriptors also take the chemical species into account. In the case of SOAP, the geometrical features for each species are written into different "channels" in the output. This is why there is a difference between your structures. If you want to only compare the geometry and ignore the species, just set all of your species e.g. to 'H' in the original structures that you feed into soap.create.

Hope this helps

from dscribe.

lundnguy avatar lundnguy commented on June 24, 2024

Hi @lauri-codes

Thank you.

I further calculated the similarities between H2O and H2Pb, between H2S and H2Pb. It appeared that they are the same as that between H2O and H2S (0.777). (Again, all molecules have exactly the same geometry, the difference is the chemical species O, S, Pb). Is there any reason why this happened?

The input file is provided below.

Thanks,
Lund

from dscribe.descriptors import SOAP
from dscribe.kernels import AverageKernel
from ase import io 

a=io.read('H2O.xyz', index=':')
b=io.read('H2S.xyz', index=':')
c=io.read('H2Pb.xyz', index=':')

desc=SOAP(species=["H","O","S","Pb"], rcut=6.0, nmax=15, lmax=12, sigma=0.01, periodic=False, crossover=True, sparse=False)

a_features = desc.create(a)
b_features = desc.create(b)
c_features = desc.create(c)



re_ave = AverageKernel(metric="linear")
print('O & S:', re_ave.create([a_features[0], b_features[0]])[0,1])
print('O & Pb:', re_ave.create([a_features[0],c_features[0]])[0,1])
print('S & Pb:', re_ave.create([b_features[0],c_features[0]])[0,1])


from dscribe.

lauri-codes avatar lauri-codes commented on June 24, 2024

Hi @lundnguy,

The distance measure you are using (metric="linear" is essentially the dot product between two vectors) does not have a special notion of chemical distances between elements. It is simply a linear metric in a space where all species live in different dimensions (= different parts of the output).

There is no "universal distance" between chemical elements as any useful distance is application specific. This is typically where some form of machine learning comes into play, e.g. a neural network may have a latent space that can be seen as an application-specific distance metric between inputs that is trained during the training. Alternatively, you can hand-craft your own chemical distance metric by providing a custom function in the metric argument.

from dscribe.

lundnguy avatar lundnguy commented on June 24, 2024

Thank you!

from dscribe.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.