Skip to content

Commit

Permalink
change version number
Browse files Browse the repository at this point in the history
  • Loading branch information
mariogeiger committed Mar 20, 2022
1 parent 24121fa commit 853f20e
Show file tree
Hide file tree
Showing 4 changed files with 69 additions and 2 deletions.
29 changes: 29 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
name: Upload Python Package

on:
release:
types: [created]

jobs:
deploy:

runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v2
- name: Set up Python
uses: actions/setup-python@v2
with:
python-version: 3.8
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install setuptools wheel twine
- name: Build and publish
env:
TWINE_USERNAME: ${{ secrets.PYPI_USERNAME }}
TWINE_PASSWORD: ${{ secrets.PYPI_PASSWORD }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
python setup.py sdist bdist_wheel
twine upload dist/*
12 changes: 12 additions & 0 deletions ChangeLog.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
# Changelog
All notable changes to this project will be documented in this file.

The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).

## [Unreleased]

## [0.4.0] - 2022-03-19

### Added
- Changelog
28 changes: 27 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ Disclamier: This is a work in progress. No part of the library can be considered
## What is different from the pytorch version?

- no more `shared_weights` and `internal_weights` in `TensorProduct`. Extensive use of `jax.vmap` instead (see example below)
- support of python list of `jnp.array` for the data. This allows to avoid unnecessary `jnp.concatenante` followed by indexing to reverse the concatenation
- support of python structure `IrrepsData` that contains a contiguous version of the data and a list of `jnp.array` for the data. This allows to avoid unnecessary `jnp.concatenante` followed by indexing to reverse the concatenation
- support of `None` in the list of `jnp.array` to avoid unnecessary computation with zeros

## Example
Expand All @@ -32,6 +32,32 @@ irreps.D_from_angles(alpha=0.0, beta=0.0, gamma=0.0, k=1) # the matrix that app
# [ 0., -1.]], dtype=float32)
```

`IrrepsData` contains both the irreps and the data.
Here is the example of the tensor product of the two vectors.
```python
from e3nn_jax import full_tensor_product, IrrepsData

out = full_tensor_product(
IrrepsData.from_contiguous("1o", jnp.array([2.0, 0.0, 0.0])),
IrrepsData.from_contiguous("1o", jnp.array([0.0, 2.0, 0.0]))
)
# out is of type `IrrepsData` and contains the following fields:

out.irreps
# 1x0e+1x1e+1x2e

out.contiguous
# DeviceArray([0. , 0. , 0. , 2.83, 0. , 2.83, 0. , 0. , 0. ], dtype=float32)

out.list
# [DeviceArray([[0.]], dtype=float32),
# DeviceArray([[0. , 0. , 2.83]], dtype=float32),
# DeviceArray([[0. , 2.83, 0. , 0. , 0. ]], dtype=float32)]
```

The two fields `contiguous` and `list` contain the same information under different forms.
This is not a performence issue, we rely on `jax.jit` to optimize the code and get rid of the unused operations.

## Shared weights

`torch` version ([e3nn](github.com/e3nn/e3nn) repo):
Expand Down
2 changes: 1 addition & 1 deletion e3nn_jax/__init__.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
__version__ = "0.3.1"
__version__ = "0.4.0"

from ._graph_util import index_add, radius_graph
from ._rotation import (
Expand Down

0 comments on commit 853f20e

Please sign in to comment.