Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions docs/requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,8 @@ myst-parser # markdown => rst translation, used in extensions/featomic_json_
# dependencies for the tutorials
--extra-index-url https://download.pytorch.org/whl/cpu
metatensor-operations >=0.5.0,<0.6
metatensor-torch >=0.9.0,<0.10
metatomic-torch >= 0.1.12,<0.2
metatensor-torch >=0.10.0,<0.11
metatomic-torch >= 0.1.15,<0.2
torch
chemfiles
matplotlib
Expand Down
6 changes: 6 additions & 0 deletions featomic-torch/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,12 @@ a changelog](https://keepachangelog.com/en/1.1.0/) format. This project follows
### Removed
-->

## [Version 0.7.5](https://github.com/metatensor/featomic/releases/tag/featomic-torch-v0.7.5) - 2026-06-25

### Changed

- The code is now compatible with metatensor-torch v0.10

## [Version 0.7.4](https://github.com/metatensor/featomic/releases/tag/featomic-torch-v0.7.4) - 2026-05-15

### Changed
Expand Down
12 changes: 6 additions & 6 deletions featomic-torch/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ function(check_compatible_versions _dependency_ _actual_ _requested_)
endfunction()


set(REQUIRED_FEATOMIC_VERSION "0.6.6")
set(REQUIRED_FEATOMIC_VERSION "0.6.7")
if (NOT "$ENV{FEATOMIC_NO_LOCAL_DEPS}" STREQUAL "1")
# If building a dev version, we also need to update the
# REQUIRED_FEATOMIC_VERSION in the same way we update the
Expand Down Expand Up @@ -122,8 +122,8 @@ find_package(Torch 2.3 REQUIRED)
#
# When updating METATENSOR_TORCH_FETCH_VERSION, you will also have to update the
# SHA256 sum of the file in `FetchContent_Declare`.
set(METATENSOR_TORCH_FETCH_VERSION "0.9.0")
set(REQUIRED_METATENSOR_TORCH_VERSION "0.9")
set(METATENSOR_TORCH_FETCH_VERSION "0.10.0")
set(REQUIRED_METATENSOR_TORCH_VERSION "0.10")
if (FEATOMIC_FETCH_METATENSOR_TORCH)
message(STATUS "Fetching metatensor-torch from github")

Expand All @@ -132,7 +132,7 @@ if (FEATOMIC_FETCH_METATENSOR_TORCH)
FetchContent_Declare(
metatensor_torch
URL ${URL_ROOT}/metatensor-torch-v${METATENSOR_TORCH_FETCH_VERSION}/metatensor-torch-cxx-${METATENSOR_TORCH_FETCH_VERSION}.tar.gz
URL_HASH SHA256=4e31c235447b6bc14c7703c640e2f35409813c2f159a32b8d23386ad4a5abd57
URL_HASH SHA256=a0a25e061ae4fbf2a563e9fcceed68ac79b4d857e4c9803a1614d301dc3fdfcd
)

FetchContent_MakeAvailable(metatensor_torch)
Expand All @@ -150,7 +150,7 @@ endif()
#
# When updating METATOMIC_TORCH_FETCH_VERSION, you will also have to update the
# SHA256 sum of the file in `FetchContent_Declare`.
set(METATOMIC_TORCH_FETCH_VERSION "0.1.12")
set(METATOMIC_TORCH_FETCH_VERSION "0.1.15")
set(REQUIRED_METATOMIC_TORCH_VERSION "0.1")
if (FEATOMIC_FETCH_METATENSOR_TORCH)
message(STATUS "Fetching metatomic-torch from github")
Expand All @@ -160,7 +160,7 @@ if (FEATOMIC_FETCH_METATENSOR_TORCH)
FetchContent_Declare(
metatomic_torch
URL ${URL_ROOT}/metatomic-torch-v${METATOMIC_TORCH_FETCH_VERSION}/metatomic-torch-cxx-${METATOMIC_TORCH_FETCH_VERSION}.tar.gz
URL_HASH SHA256=d9e587c7ce3d9d6338ed5f6da119e2a3b29698381886f36a53603523c0499542
URL_HASH SHA256=2fa4c94144164168834a90ff195ed7d788959c9d9ffd3ea4a85e2f470925c708
)

FetchContent_MakeAvailable(metatomic_torch)
Expand Down
2 changes: 1 addition & 1 deletion featomic-torch/VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
0.7.4
0.7.5
2 changes: 1 addition & 1 deletion featomic-torch/tests/cmake-project/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ project(featomic-torch-test-cmake-project CXX)
# We need to update the REQUIRED_FEATOMIC_VERSION in the same way we update the
# featomic version for dev builds
include(../../cmake/dev-versions.cmake)
set(REQUIRED_FEATOMIC_TORCH_VERSION "0.7.4")
set(REQUIRED_FEATOMIC_TORCH_VERSION "0.7.5")
create_development_version("${REQUIRED_FEATOMIC_TORCH_VERSION}" FEATOMIC_TORCH_FULL_VERSION "featomic-torch-v")
string(REGEX REPLACE "([0-9]*)\\.([0-9]*).*" "\\1.\\2" REQUIRED_FEATOMIC_TORCH_VERSION ${FEATOMIC_TORCH_FULL_VERSION})
find_package(featomic_torch ${REQUIRED_FEATOMIC_TORCH_VERSION} REQUIRED)
Expand Down
7 changes: 7 additions & 0 deletions featomic/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,13 @@ a changelog](https://keepachangelog.com/en/1.1.0/) format. This project follows
### Removed
-->

## [Version 0.6.7](https://github.com/metatensor/featomic/releases/tag/featomic-v0.6.7) - 2026-06-25

### Added

- `spherical_to_cartesian` python function, doing the inverse of
`cartesian_to_spherical`.

## [Version 0.6.6](https://github.com/metatensor/featomic/releases/tag/featomic-v0.6.6) - 2026-05-15

### Changed
Expand Down
4 changes: 2 additions & 2 deletions featomic/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -246,7 +246,7 @@ endif()
#
# When updating METATENSOR_FETCH_VERSION, you will also have to update the
# SHA256 sum of the file in `FetchContent_Declare`.
set(METATENSOR_FETCH_VERSION "0.2.0")
set(METATENSOR_FETCH_VERSION "0.2.2")
set(METATENSOR_REQUIRED_VERSION "0.2")
if (FEATOMIC_FETCH_METATENSOR)
message(STATUS "Fetching metatensor-core from github")
Expand All @@ -256,7 +256,7 @@ if (FEATOMIC_FETCH_METATENSOR)
FetchContent_Declare(
metatensor
URL ${URL_ROOT}/metatensor-core-v${METATENSOR_FETCH_VERSION}/metatensor-core-cxx-${METATENSOR_FETCH_VERSION}.tar.gz
URL_HASH SHA256=809a799b1c8d58b7ede3868d6ebe4123924ba31e4637481f9ca5c8a0ed14be17
URL_HASH SHA256=a104512516c8761080075e3ba7c023fcc1bb3430df7c67b25bded359a729e2ff
)

FetchContent_MakeAvailable(metatensor)
Expand Down
2 changes: 1 addition & 1 deletion featomic/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "featomic"
version = "0.6.6"
version = "0.6.7"
authors = ["Guillaume Fraux <guillaume.fraux@epfl.ch>"]
edition = "2021"
rust-version = "1.74"
Expand Down
4 changes: 2 additions & 2 deletions featomic/include/featomic.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -635,7 +635,7 @@ class Calculator {
options.as_featomic_calculation_options_t()
));

return metatensor::TensorMap(descriptor);
return metatensor::TensorMap::unsafe_from_ptr(descriptor);
}

/// Runs a calculation for multiple `systems`
Expand Down Expand Up @@ -669,7 +669,7 @@ class Calculator {
options.as_featomic_calculation_options_t()
));

return metatensor::TensorMap(descriptor);
return metatensor::TensorMap::unsafe_from_ptr(descriptor);
}

/// Get the underlying pointer to a `featomic_calculator_t`.
Expand Down
2 changes: 1 addition & 1 deletion featomic/tests/cmake-project/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ project(featomic-test-cmake-project C CXX)
# We need to update the REQUIRED_FEATOMIC_VERSION in the same way we update the
# featomic version for dev builds
include(../../cmake/dev-versions.cmake)
set(REQUIRED_FEATOMIC_VERSION "0.6.6")
set(REQUIRED_FEATOMIC_VERSION "0.6.7")
create_development_version("${REQUIRED_FEATOMIC_VERSION}" FEATOMIC_FULL_VERSION "featomic-v")
string(REGEX REPLACE "([0-9]*)\\.([0-9]*).*" "\\1.\\2" REQUIRED_FEATOMIC_VERSION ${FEATOMIC_FULL_VERSION})
find_package(featomic ${REQUIRED_FEATOMIC_VERSION} REQUIRED)
Expand Down
2 changes: 1 addition & 1 deletion python/featomic/build-backend/backend.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,5 +11,5 @@ def get_requires_for_build_wheel(config_settings=None):
defaults = build_meta.get_requires_for_build_wheel(config_settings)
return defaults + [
"cmake",
"metatensor-core >=0.2.0,<0.3",
"metatensor-core >=0.2.2,<0.3",
]
2 changes: 0 additions & 2 deletions python/featomic/featomic/clebsch_gordan/_backend.py
Original file line number Diff line number Diff line change
Expand Up @@ -53,5 +53,3 @@ class TorchDType:
Array = Union[np.ndarray, TorchTensor]
DType = Union[np.dtype, TorchDType]
Device = Union[str, TorchDevice]

BACKEND_IS_METATENSOR_TORCH = False
18 changes: 7 additions & 11 deletions python/featomic/featomic/clebsch_gordan/_coefficients.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@

from . import _dispatch
from ._backend import (
BACKEND_IS_METATENSOR_TORCH,
Array,
Device,
DType,
Expand Down Expand Up @@ -84,11 +83,7 @@ def calculate_cg_coefficients(

complex_like = torch.empty(0, dtype=complex_dtype, device=device)
real_like = torch.empty(0, dtype=dtype, device=device)
if BACKEND_IS_METATENSOR_TORCH:
labels_values_like = torch.empty(0, dtype=torch.int32, device=device)
else:
# we are using metatensor-core with torch arrays
labels_values_like = np.empty(0, dtype=np.int32)
labels_values_like = torch.empty(0, dtype=torch.int32, device=device)
else:
assert arrays_backend == "numpy"
if dtype == np.float32:
Expand All @@ -110,7 +105,6 @@ def calculate_cg_coefficients(
cg_coeff_dict = _build_dense_cg_coeff_dict(
lambda_max,
complex_like,
labels_values_like,
arrays_backend=arrays_backend,
dtype=dtype,
device=device,
Expand All @@ -137,7 +131,6 @@ def calculate_cg_coefficients(
def _build_dense_cg_coeff_dict(
lambda_max: int,
complex_like: Array,
labels_values_like: Array,
arrays_backend: str,
dtype: DType,
device: Device,
Expand Down Expand Up @@ -575,9 +568,12 @@ def _cg_couple_dense(
l1 = (array.shape[1] - 1) // 2
l2 = (array.shape[2] - 1) // 2

cg_l1l2lam = (-1) ** (l1 + l2 + o3_lambda) * cg_coefficients.block(
{"l1": l1, "l2": l2, "lambda": o3_lambda}
).values
key = Labels(
["l1", "l2", "lambda"],
_dispatch.int_array_like([[l1, l2, o3_lambda]], cg_coefficients.keys.values),
)

cg_l1l2lam = (-1) ** (l1 + l2 + o3_lambda) * cg_coefficients.block(key).values

return _dispatch.tensordot(array, cg_l1l2lam[0, ..., 0], axes=([2, 1], [1, 0]))

Expand Down
2 changes: 1 addition & 1 deletion python/featomic/pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ classifiers = [
]

dependencies = [
"metatensor-core >=0.2.0,<0.3",
"metatensor-core >=0.2.2,<0.3",
"metatensor-operations >=0.5.0,<0.6",
"wigners",
]
Expand Down
6 changes: 3 additions & 3 deletions python/featomic_torch/build-backend/backend.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
FEATOMIC_DEP = f"featomic @ {FEATOMIC_SRC.as_uri()}"
else:
# we are building from a sdist
FEATOMIC_DEP = "featomic >=0.6.6,<0.7"
FEATOMIC_DEP = "featomic >=0.6.7,<0.7"

FORCED_TORCH_VERSION = os.environ.get("FEATOMIC_TORCH_BUILD_WITH_TORCH_VERSION")
if FORCED_TORCH_VERSION is not None:
Expand All @@ -43,7 +43,7 @@ def get_requires_for_build_wheel(config_settings=None):
return defaults + [
"cmake",
TORCH_DEP,
"metatensor-torch >=0.9.0,<0.10",
"metatomic-torch >=0.1.12,<0.2",
"metatensor-torch >=0.10.0,<0.11",
"metatomic-torch >=0.1.15,<0.2",
FEATOMIC_DEP,
]
2 changes: 0 additions & 2 deletions python/featomic_torch/featomic/torch/clebsch_gordan.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,6 @@
# This module only exposes a handful of things, defined here. Any changes here MUST also
# be made to the `featomic/clebsch_gordan/_backend.py` file, which is used in
# non-TorchScript mode.
module.__dict__["BACKEND_IS_METATENSOR_TORCH"] = True

module.__dict__["Labels"] = metatensor.torch.Labels
module.__dict__["TensorBlock"] = metatensor.torch.TensorBlock
module.__dict__["TensorMap"] = metatensor.torch.TensorMap
Expand Down
4 changes: 2 additions & 2 deletions python/featomic_torch/setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -346,8 +346,8 @@ def create_version_number(version):

install_requires = [
f"torch {torch_version}",
"metatensor-torch >=0.9.0,<0.10",
"metatomic-torch >=0.1.12,<0.2",
"metatensor-torch >=0.10.0,<0.11",
"metatomic-torch >=0.1.15,<0.2",
]

# when packaging a sdist for release, we should never use local dependencies
Expand Down
6 changes: 3 additions & 3 deletions tox.ini
Original file line number Diff line number Diff line change
Expand Up @@ -21,11 +21,11 @@ lint-folders = "{toxinidir}/python" "{toxinidir}/setup.py"
# we need to manually install dependencies for featomic, since tox will install
# the fresh wheel with `--no-deps` after building it.
metatensor-core-requirement =
metatensor-core >=0.2.0,<0.3
metatensor-core >=0.2.2,<0.3

metatensor-torch-requirement =
metatensor-torch >=0.9.0,<0.10
metatomic-torch >=0.1.12,<0.2
metatensor-torch >=0.10.0,<0.11
metatomic-torch >=0.1.15,<0.2

build-single-wheel = --no-deps --no-build-isolation --check-build-dependencies
warning_options =
Expand Down
Loading