Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ModuleNotFoundError: No module named 'tutorial_utils' #344

Open
hezhengda opened this issue Apr 27, 2021 · 4 comments
Open

ModuleNotFoundError: No module named 'tutorial_utils' #344

hezhengda opened this issue Apr 27, 2021 · 4 comments
Labels
bug Something isn't working documentation Needs addtional documentation

Comments

@hezhengda
Copy link

Dear librascal developers,

In the examples, if I open SOAP_example.ipynb and run the first cell. Then it said "ModuleNotFoundError: No module named 'tutorial_utils'", I check the folder there are no file called tutorial_utils. Also there seems no python package with same name. Could you help me understand what I need to do? (install other packages?)

Thanks,
Best,
Zhengda

@Luthaf
Copy link
Contributor

Luthaf commented Apr 28, 2021

Hi @hezhengda 👋 ! Thanks for taking the time to open an issue.

The tutorial_utils.py file was removed by @rosecers in #230, and it looks like we forgot to update this notebook after this change.

@max-veit is currently working on improving the examples in #342, and it looks like he already flagged this notebook as outdated.

We will try to update this notebook as soon as possible. In the mean time, you could give a look at more recent notebooks and examples, such as MLIP_example.ipynb. The code does more than just computing SOAP, but starts by doing just that.
What are you trying to achieve here? Maybe we can help you directly.

@Luthaf Luthaf added bug Something isn't working documentation Needs addtional documentation labels Apr 28, 2021
@hezhengda
Copy link
Author

Hi Luthaf,

Thanks for the reply. I will look into the MLIP_example, thanks for uploading these excellent tutorials. I'm trying to learn how to use SOAP as a descriptor in my own research.

@Luthaf
Copy link
Contributor

Luthaf commented Apr 28, 2021

Ok, then getting a matrix of SOAP descriptors should be as simple as

from rascal.representations import SphericalInvariants
import ase
from ase import io

ase.io.read("<your-structure-file.xyz>", ":")

soap = SphericalInvariants(
    soap_type="PowerSpectrum",
    interaction_cutoff=3.5,
    max_radial=6,
    max_angular=6,
    gaussian_sigma_constant=0.3,
    gaussian_sigma_type="Constant",
    cutoff_smooth_width=0.5,
    radial_basis="GTO",
)

managers = soap.transform(frames)
features = managers.get_features(soap)

print(features.shape)  # n_atoms x n_features matrix

Then you can do what you want with the feature matrix!

@hezhengda
Copy link
Author

Thanks so much! This will help me a lot.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working documentation Needs addtional documentation
Projects
None yet
Development

No branches or pull requests

2 participants