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

Plans? #1

Open
janosh opened this issue Oct 29, 2023 · 5 comments
Open

Plans? #1

janosh opened this issue Oct 29, 2023 · 5 comments

Comments

@janosh
Copy link
Contributor

janosh commented Oct 29, 2023

Very excited to see this! What are the plans for this? Will this become a rust replacement for spglib?

@lan496
Copy link
Member

lan496 commented Oct 29, 2023

You have a quick eye 😳. My motivation for this hobby project is to see how symmetry-finding implementation can be simplified by modern language and recent advances in crystallographic algorithms. Actually, I have no idea if it will be a successor of spglib, but it is definitely an interesting direction!

@lan496
Copy link
Member

lan496 commented Dec 4, 2024

Hi, @janosh ! Let me introduce the current status of this project.

Now I've implemented the space-group algorithm in this package (pip install moyopy[interface]). Magnetic space-group ones are on-going...

I've checked the symmetry finding with spglib for Materials Project dataset with symprec from 1e-4 to 1e-1.
https://github.com/spglib/moyo/blob/main/bench/mp/mp.py

Moyopy is ~4x faster than spglib on average and gives the same space-group number for 98% of the inputs. The differences occur mostly for large symprec=1e-1, so I think it is not critical.
https://github.com/spglib/moyo/blob/main/bench/mp/analysis.ipynb

If you are looking for Rust crate for symmetry finding, I would suggest this package. As far as I know, there is no such crate except for spglib's Rust binding, which does not seem to be actively maintained.

We do not explicitly consider a migration of spglib itself for now, but it would be interesting to test this package with various inputs because spglib took almost ten years to obtain the current robustness...

@atztogo
Copy link

atztogo commented Dec 4, 2024

spglib took almost ten years to obtain the current robustness...

And also, a decade's worth of technical debt...

@janosh
Copy link
Contributor Author

janosh commented Dec 4, 2024

@lan496 thanks a lot for the update! 4x speedup is very impressive. excited to start migrating my code to moyopy. just tried it out and works great. would you accept a PR to add a repr for MoyoDataset? similar to the one for SpglibDataset?

Screenshot 2024-12-04 at 12 28 42 PM

@lan496
Copy link
Member

lan496 commented Dec 4, 2024

would you accept a PR to add a repr for MoyoDataset?

Sure! IPython.display.display seems to use __repr__, so we need to implement it.
I guess we may need to modify the pyo3 parts.

impl PyMoyoDataset {

https://pyo3.rs/v0.22.5/class/object#string-representations

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants