lab-cosmo/sphericart
lab-cosmo/sphericart has 105 GitHub stars and 18 forks. Star changes are not measured yet. Last checked 2026-11-14 08:38 UTC. Last push 2026-09-14.
측정된 스타 증가
- in 24h
- 기록 수집 중
- in 7 days
- 기록 수집 중
- in 15 days
- 기록 수집 중
- in 1 month
- 기록 수집 중
서로 겹치는 기간의 순증가량이며 일별 합계가 아닙니다. 측정값이 없으면 비워 둡니다. 스타는 관심도를 나타내며 품질을 보장하지 않습니다.
소개
Multi-language library for the calculation of spherical harmonics in Cartesian coordinates
머신러닝README.md
Originalsphericart
This is sphericart, a multi-language library for the efficient calculation of real spherical harmonics and their derivatives in Cartesian coordinates.
For instructions and examples on the usage of the library, please refer to our documentation.
If you are using sphericart for your academic work, you can cite it as
@article{sphericart,
title={Fast evaluation of spherical harmonics with sphericart},
author={Bigi, Filippo and Fraux, Guillaume and Browning, Nicholas J. and Ceriotti, Michele},
journal={J. Chem. Phys.},
year={2023},
number={159},
pages={064802},
}
This library is dual-licensed under the Apache License 2.0 and the MIT license. You can use to use it under either of the two licenses.
Installation
Python
Pre-built (https://pypi.org/project/sphericart/).
pip install sphericart # numpy interface, CPU only
pip install sphericart[torch] # Torch (and TorchScript) interface, CPU and GPU
pip install sphericart[jax] # JAX interface, CPU and GPU
Note that the pre-built packages are compiled for a generic CPU, and might be less performant than they could be on a specific processor. To generate libraries that are optimized for the target system, you can build from source:
git clone https://github.com/lab-cosmo/sphericart
pip install .
# if you also want the torch bindings (CPU and GPU)
pip install .[torch]
# torch bindings, CPU-only version
pip install --extra-index-url https://download.pytorch.org/whl/cpu .[torch]
If you want to enable the CUDA version of the code when builing from source,
you'll need to set the CUDA_HOME environement variable. You can build a CUDA enabled sphericart, but the calculations though numpy will only run on CPU.
Julia
A native Julia implementation of sphericart is provided, called SpheriCart.
Install the package by opening a REPL, switch to the package manager by
typing ] and then add SpheriCart.
See julia/README.md for usage.
SpheriCart.jl is compatible with ChainRules.jl
and Lux.jl and provides GPU kernels
via KernelAbstractions.jl.
C and C++
From source
git clone https://github.com/lab-cosmo/sphericart
cd sphericart
mkdir build && cd build
cmake .. <cmake configuration options>
cmake --build . --target install
The following cmake configuration options are available:
-DSPHERICART_BUILD_TORCH=ON/OFF: build the torch bindings in addition to the main library-DSPHERICART_BUILD_TESTS=ON/OFF: build C++ unit tests-DSPHERICART_BUILD_EXAMPLES=ON/OFF: build C++ examples and benchmarks-DSPHERICART_OPENMP=ON/OFF: enable OpenMP parallelism-DCMAKE_INSTALL_PREFIX=<where/you/want/to/install>set the root path for installation
GPU Support
The support for GPU offload could be controled with the following CMake variables at configuration:
-DSPHERICART_ENABLE_CUDA=ON/OFF: build with CUDA support also setCUDA_HOMEenvironement variable.-DSPHERICART_ENABLE_SYCL=ON/OFF: build with SYCL support, configure tool will search forsycl/sycl.hheader.-DSPHERICART_SYCL_DEVICE=all/cpu/gpu: target architecute for SYCL support, check which devices are available withsycl-ls, forall(default) is possible to control at execution withexport ONEAPI_DEVICE_SELECTOR=opencl:gpuorexport ONEAPI_DEVICE_SELECTOR=opencl:cpu.
The following flags have been tested with Intel OneAPI 2025.3 for enabling SYCL support:
-DCMAKE_CXX_COMPILER=icpx-DCMAKE_C_COMPILER=icx-DCMAKE_CXX_FLAGS=" -qopenmp --intel -fsycl -fsycl-targets=spir64 -Wno-deprecated-declarations -Wno-macro-redefined -Wno-unused-parameter -w"
Note: Only tested in C++, python/JAX/Torch support is in progress.
Running tests and documentation
Tests and the local build of the documentation can be run with tox.
The default tests, which are also run on the CI, can be executed by simply running
tox
in the main folder of the repository.
To run tests in a CPU-only environment you can set the environment variable
PIP_EXTRA_INDEX_URL before calling tox, e.g.
PIP_EXTRA_INDEX_URL=https://download.pytorch.org/whl/cpu tox -e docs
will build the documentation in a CPU-only environment.
Other flavors of spherical harmonics
Although sphericart natively calculates real solid and spherical harmonics from Cartesian positions, it is easy to manipulate its output it to calculate complex spherical harmonics and/or to accept spherical coordinates as inputs. You can see examples here.
Maintainers
This project is maintained by @frostedoyster and @Luthaf. The maintainers will reply to issues and pull requests opened on this repository as soon as possible. You can mention them directly if you have not received an answer after a couple of days.
관련 프로젝트 살펴보기
tensorflow/tensorflow
모두를 위한 오픈소스 머신러닝 프레임워크
201,592 스타huggingface/transformers
🤗 Transformers: 텍스트, 비전, 오디오, 멀티모달 분야의 최첨단 머신러닝 모델을 위한 모델 정의 프레임워크로, 추론과 학습을 모두 지원합니다.
168,958 스타AUTOMATIC1111/stable-diffusion-webui
Stable Diffusion 웹 UI
165,311 스타Comfy-Org/ComfyUI
그래프와 노드로 구성된 인터페이스를 갖춘, 가장 강력하고 모듈성이 뛰어난 확산 모델 GUI, API, 백엔드입니다. 세계에서 가장 빠른 로컬 추론 엔진입니다.
146,747 스타