球谐函数快速计算
项目描述
球形艺术
这是一个球形艺术,一个用于在笛卡尔坐标系中高效计算实球谐函数及其导数的多语言库。
有关库的使用说明和示例,请参阅我们的文档。
如果您在学术工作中使用球形艺术,您可以引用它如下
@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},
}
本库采用Apache License 2.0和MIT许可的双重授权。您可以根据任意一种许可协议使用它。
安装
Python
预构建版本(https://pypi.ac.cn/project/sphericart/)。
pip install sphericart # numpy version
pip install sphericart[torch] # including also the torch bindings
pip install sphericart[jax] # JAX bindings (CPU-only)
请注意,预构建包是为通用CPU编译的,可能在特定处理器上性能不如预期。为了生成针对目标系统优化的库,您可以从源代码构建。
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]
从源代码构建也是使用sphericart的PyTorch GPU功能所必需的,并且需要CUDA编译器。
Julia
提供了sphericart的本地Julia实现,称为SpheriCart。通过打开REPL,切换到包管理器,输入]
然后输入add SpheriCart
来安装包。有关使用说明,请参阅julia/README.md。
C和C++
从源代码
git clone https://github.com/lab-cosmo/sphericart
cd sphericart
mkdir build && cd build
cmake .. <cmake configuration options>
cmake --build . --target install
以下cmake配置选项可用
-DSPHERICART_BUILD_TORCH=ON/OFF
:除了主库外,还构建torch绑定-DSPHERICART_BUILD_TESTS=ON/OFF
:构建C++单元测试-DSPHERICART_BUILD_EXAMPLES=ON/OFF
:构建C++示例和基准测试-DSPHERICART_OPENMP=ON/OFF
:启用OpenMP并行性-DCMAKE_INSTALL_PREFIX=<where/you/want/to/install>
设置安装根路径
运行测试和文档
可以使用tox
运行测试和本地构建的文档。默认测试,也在CI上运行,可以简单地通过在仓库的主要文件夹中运行来执行:
tox
。
要在一个仅CPU的环境中运行测试,您可以在调用tox之前设置环境变量PIP_EXTRA_INDEX_URL
,例如:
PIP_EXTRA_INDEX_URL=https://download.pytorch.org/whl/cpu tox -e docs
将在一个仅CPU的环境中构建文档。
其他球谐函数版本
虽然sphericart原生地根据笛卡尔位置计算实球谐函数,但很容易操纵其输出以计算复球谐函数和/或接受球坐标作为输入。您可以在此处查看示例这里。
项目详情
关闭
sphericart-0.5.0.tar.gz 的哈希值
算法 | 哈希摘要 | |
---|---|---|
SHA256 | 2f3d2672a20efd7cf400cce42d0648f04d16fe8abaf834d167a1b45ef2f87e46 |
|
MD5 | b6524985aa71f6ca97c01466aa28f6fc |
|
BLAKE2b-256 | f12de57af54de6409b6140ebd42f9be1614fc1c7880ca2a090b10f330be6cdf1 |
关闭
sphericart-0.5.0-py3-none-manylinux_2_17_x86_64.manylinux2014_x86_64.whl 的哈希值
算法 | 哈希摘要 | |
---|---|---|
SHA256 | 817248768a5358936f9404cf08625cac46bd419be20d5a39e44dd1c7c29dfbbe |
|
MD5 | cf48c662bb14e17158fc69e4a11c157d |
|
BLAKE2b-256 | 259625521d53ea67d2bd1d554b2b0a306fc96a1087c742f7f8d7f0bbbd224cb9 |
关闭
sphericart-0.5.0-py3-none-macosx_11_0_x86_64.whl 的哈希值
算法 | 哈希摘要 | |
---|---|---|
SHA256 | 0b6bf3392708830cbb91513aef06786b65c927c12aade4835f3218c46df2765f |
|
MD5 | 71ce2abc1414d98e8323a6c4d723271f |
|
BLAKE2b-256 | f6e4e2770cf93892acdfb4a7fffd67825d389a55e83aa444b9d8dda5d2400994 |
关闭
sphericart-0.5.0-py3-none-macosx_11_0_arm64.whl 的哈希值
算法 | 哈希摘要 | |
---|---|---|
SHA256 | 8637a9b00668b2b1bbe8771597e10e8e85b0dd868ba73bd31ecda04ba950fffd |
|
MD5 | 5608ad3560ef8935dd15dd425cc123d2 |
|
BLAKE2b-256 | acdf360fdd312a480b0ed07465e5d484641cb4d5784cdc2bc2cc57db1b4a9898 |