t-e3nn

Time-reversal Euclidean neural networks based on e3nn

https://github.com/hongyu-yu/t-e3nn

Science Score: 41.0%

This score indicates how likely this project is to be science-related based on various indicators:

  • CITATION.cff file
    Found CITATION.cff file
  • codemeta.json file
  • .zenodo.json file
  • DOI references
    Found 8 DOI reference(s) in README
  • Academic publication links
    Links to: arxiv.org, aps.org, zenodo.org
  • Academic email domains
  • Institutional organization owner
  • JOSS paper metadata
  • Scientific vocabulary similarity
    Low similarity (11.3%) to scientific vocabulary
Last synced: 10 months ago · JSON representation ·

Repository

Time-reversal Euclidean neural networks based on e3nn

Basic Info
  • Host: GitHub
  • Owner: Hongyu-yu
  • License: other
  • Language: Python
  • Default Branch: main
  • Homepage:
  • Size: 10.3 MB
Statistics
  • Stars: 13
  • Watchers: 1
  • Forks: 1
  • Open Issues: 0
  • Releases: 0
Created over 3 years ago · Last pushed almost 2 years ago
Metadata Files
Readme Changelog Contributing License Code of conduct Citation

README.md

Time-reversal Euclidean neural networks

DOI

T-e3nn is an extension of e3nn with consideration of time-reversal symmetry include quantities such as spin and velocity.

The aim of this library is to help the development of Time-reversal E(3) equivariant neural networks.

It's built on this version of e3nn with nearly the same usage API considering Time-reversal and E(3) symmetry. So you can transfer your E(3) equivariant model into a Time-reversal E(3) equivariant model easily by initializing input considering time-reversal related irreps with T-e3nn. See more details in this H. Yu, B. Liu, Y. Zhong, L. Hong, J. Ji, C. Xu, X. Gong, and H. Xiang, Physics-informed time-reversal equivariant neural network potential for magnetic materials, Phys. Rev. B 110, 104427 (2024). .

Installation

$ git clone https://github.com/Hongyu-yu/T-e3nn.git $ cd T-e3nn/ $ pip install . Warning: with T-e3nn installed, e3nn packages will be removed in your python environment while original code using e3nn should work fine as before. If any code based on e3nn originally works fine but not for T-e3nn which is carefully prevented during development, please submit an issue. Codes about import e3nn will be directed to T-e3nn instead. Please check the small difference of API listed below. Generally, very few changes including the initialization of the input irreps are needed to be made to transfer your model from e3nn to T-e3nn.

Difference with E3NN

With a few changes on your original codes based on e3nn, time-reversal can be considered.

Irreps:

Initialization

Usually, the only difference between e3nn and T-e3nn for network developer is to initialize the input of network considering time-reversal order.

In T-e3nn, Irreps are stored with (l, p, t) with t about time-reversal symmetry and l p from e3nn.

You can initial Irreps by - Irrep(l, p, t) or Irrep(l, p) with default t=1. - Irrep("lee") or Irrep("1e") with default t=1 If you want to generate Irrep with odd time-reversal, you should include t when initializing Irrep.

Example: - Irrep of spin vector should be Irrep(1, 1, -1) or Irrep("1eo") - Irrep of bond vector can be Irrep(1, -1) or Irrep("1o") as the same in e3nn or Irrep(1, -1, 1) or Irrep("1oe") with explicit time-reversal index. Iteration like for mul, (l, p) in irreps in e3nn should be modified as for mul, (l, p, t) in irrep

Property

While p is about parity, t is about time-reversal. Here we use T as the time-reversal operation and x as the variable with (l,p,t)

For x of t=1, Tx=x. For most of physical quantities, t=1

For x of t=-1, Tx=-x. For the physical quantities related with time, such as velocity v=dx/dt and spin, t=-1.

t will be considered in the operation just like p.

When t of all variables is 1, it's degenerate into E(3) and act exactly the same as E3NN.

Class method difference

Difference below is barely used though.

Difference are highlighted with bold. - Dfromangles(alpha, beta, gamma, k, kt=None) - Dfromquaternion(q, k, kt) - Dfrommatrix(R, parity=True, time_reversal=False) - sphericalharmonics(lmax, p=-1, t=1) - **sortarray** - Sort the representations and return also the array index based on sort

Other API difference

API below help to initialize the input and its irreps and test of the network.

  • io.SphericalTensor(lmax, pval, parg, t_val=1, t_arg=1)
  • o3.SphericalHarmonics(..., parity=True, time_reversal=False)
  • o3.sphericalharmonics(..., parity=True, **timereversal**=False)
  • util.test.assertequivariant(...,**dotimereversal*=True, *doonlyrotspin**=False)
    • Whether to check time-reversal symmetry and whether spin-orbit effect existence.
    • If you want to check that SOC is turn off in your model, doonlyrot_spin should be true.
  • util.test.equivarianceerror(..., **dotimereversal*=True, *doonlyrotspin**=False)
  • util.argtools.transform(..., parity=1, tr_k=0, onlyrotspin=False)
    • When checking model equivariance, just as ireeps of positions r represented with keyword "cartesianpoints", all "1eo" vectors should be reprented with keyword "spin" such as spin, spinforce, velocity.

Citing

If you use this repository in your work, please considering citing the preprint below and e3nn. @misc{tenn_paper, doi = {10.48550/ARXIV.2211.11403}, url = {https://arxiv.org/abs/2211.11403}, author = {Hongyu Yu, Yang Zhong, Junyi Ji, Xingao Gong, Hongjun Xiang}, keywords = {Machine Learning (cs.LG), Artificial Intelligence (cs.AI), Neural and Evolutionary Computing (cs.NE), FOS: Computer and information sciences, FOS: Computer and information sciences}, title = {Time-reversal equivariant neural network potential and Hamiltonian for magnetic materials}, publisher = {arXiv}, year = {2022}, copyright = {Creative Commons Attribution 4.0 International} }

README.md of E3nn:

Euclidean neural networks

Coverage Status DOI

Documentation | Code | ChangeLog | Colab

The aim of this library is to help the development of E(3) equivariant neural networks. It contains fundamental mathematical operations such as tensor products and spherical harmonics.

Installation

Important: install pytorch and only then run the command

pip install --upgrade pip pip install --upgrade e3nn

For details and optional dependencies, see INSTALL.md

Breaking changes

e3nn is under development. It is recommanded to install using pip. The main branch is considered as unstable. The second version number is incremented every time a breaking change is made to the code. 0.(increment when backwards incompatible release).(increment for backwards compatible release)

Help

We are happy to help! The best way to get help on e3nn is to submit a Question or Bug Report.

Want to get involved? Great!

If you want to get involved in and contribute to the development, improvement, and application of e3nn, introduce yourself in the discussions.

Code of conduct

Our community abides by the Contributor Covenant Code of Conduct.

Citing

``` @misc{e3nn_paper, doi = {10.48550/ARXIV.2207.09453}, url = {https://arxiv.org/abs/2207.09453}, author = {Geiger, Mario and Smidt, Tess}, keywords = {Machine Learning (cs.LG), Artificial Intelligence (cs.AI), Neural and Evolutionary Computing (cs.NE), FOS: Computer and information sciences, FOS: Computer and information sciences}, title = {e3nn: Euclidean Neural Networks}, publisher = {arXiv}, year = {2022}, copyright = {Creative Commons Attribution 4.0 International} }

@software{e3nn, author = {Mario Geiger and Tess Smidt and Alby M. and Benjamin Kurt Miller and Wouter Boomsma and Bradley Dice and Kostiantyn Lapchevskyi and Maurice Weiler and Michał Tyszkiewicz and Simon Batzner and Dylan Madisetti and Martin Uhrin and Jes Frellsen and Nuri Jung and Sophia Sanborn and Mingjian Wen and Josh Rackers and Marcel Rød and Michael Bailey}, title = {Euclidean neural networks: e3nn}, month = apr, year = 2022, publisher = {Zenodo}, version = {0.5.0}, doi = {10.5281/zenodo.6459381}, url = {https://doi.org/10.5281/zenodo.6459381} } ```

Copyright

Euclidean neural networks (e3nn) Copyright (c) 2020, The Regents of the University of California, through Lawrence Berkeley National Laboratory (subject to receipt of any required approvals from the U.S. Dept. of Energy), Ecole Polytechnique Federale de Lausanne (EPFL), Free University of Berlin and Kostiantyn Lapchevskyi. All rights reserved.

If you have questions about your rights to use or distribute this software, please contact Berkeley Lab's Intellectual Property Office at IPO@lbl.gov.

NOTICE. This Software was developed under funding from the U.S. Department of Energy and the U.S. Government consequently retains certain rights. As such, the U.S. Government has been granted for itself and others acting on its behalf a paid-up, nonexclusive, irrevocable, worldwide license in the Software to reproduce, distribute copies to the public, prepare derivative works, and perform publicly and display publicly, and to permit others to do so.

Owner

  • Name: Hongyu Yu
  • Login: Hongyu-yu
  • Kind: user
  • Company: Fudan University

Ph.D. Candidate. Machine learning and Condensed matter physics.

Citation (CITATION.bib)

@misc{https://doi.org/10.48550/arxiv.2207.09453,
    doi = {10.48550/ARXIV.2207.09453},
    url = {https://arxiv.org/abs/2207.09453},
    author = {Geiger, Mario and Smidt, Tess},
    title = {e3nn: Euclidean Neural Networks},
    publisher = {arXiv},
    year = {2022},
    copyright = {Creative Commons Attribution 4.0 International}
}

GitHub Events

Total
  • Watch event: 6
  • Fork event: 1
Last Year
  • Watch event: 6
  • Fork event: 1

Issues and Pull Requests

Last synced: about 2 years ago

All Time
  • Total issues: 0
  • Total pull requests: 0
  • Average time to close issues: N/A
  • Average time to close pull requests: N/A
  • Total issue authors: 0
  • Total pull request authors: 0
  • Average comments per issue: 0
  • Average comments per pull request: 0
  • Merged pull requests: 0
  • Bot issues: 0
  • Bot pull requests: 0
Past Year
  • Issues: 0
  • Pull requests: 0
  • Average time to close issues: N/A
  • Average time to close pull requests: N/A
  • Issue authors: 0
  • Pull request authors: 0
  • Average comments per issue: 0
  • Average comments per pull request: 0
  • Merged pull requests: 0
  • Bot issues: 0
  • Bot pull requests: 0
Top Authors
Issue Authors
Pull Request Authors
Top Labels
Issue Labels
Pull Request Labels

Dependencies

.github/workflows/release.yml actions
  • actions/checkout v2 composite
  • actions/setup-python v2 composite
.github/workflows/tests.yml actions
  • actions/checkout v2 composite
  • actions/setup-python v2 composite
docs/requirements.txt pypi
  • ase *
  • autodocsumm *
  • ipykernel *
  • jupyter-sphinx *
  • myst-parser *
  • plotly *
  • sphinx *
  • sphinx-rtd-theme *
  • sympy *
  • torch ==1.11.0
  • torch-cluster *
  • torch-geometric *
  • torch-scatter *
  • torch-sparse *
  • torch-spline-conv *
pyproject.toml pypi
setup.py pypi
  • opt_einsum_fx >=0.1.4
  • scipy *
  • sympy *
  • torch >=1.8.0