{"id":13699057,"url":"https://github.com/lab-cosmo/sphericart","last_synced_at":"2026-02-17T14:02:36.815Z","repository":{"id":77806931,"uuid":"597443527","full_name":"lab-cosmo/sphericart","owner":"lab-cosmo","description":"Multi-language library for the calculation of spherical harmonics in Cartesian coordinates","archived":false,"fork":false,"pushed_at":"2026-02-17T10:20:30.000Z","size":13892,"stargazers_count":94,"open_issues_count":15,"forks_count":16,"subscribers_count":4,"default_branch":"main","last_synced_at":"2026-02-17T11:27:23.229Z","etag":null,"topics":["geometric-deep-learning","python","pytorch","spherical-harmonics"],"latest_commit_sha":null,"homepage":"https://sphericart.readthedocs.io/en/latest/","language":"C++","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/lab-cosmo.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE-APACHE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2023-02-04T15:15:25.000Z","updated_at":"2026-02-17T09:45:36.000Z","dependencies_parsed_at":"2024-04-02T12:45:52.053Z","dependency_job_id":"bf3dc727-62e2-4825-a259-5353dabf1c70","html_url":"https://github.com/lab-cosmo/sphericart","commit_stats":null,"previous_names":[],"tags_count":15,"template":false,"template_full_name":null,"purl":"pkg:github/lab-cosmo/sphericart","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lab-cosmo%2Fsphericart","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lab-cosmo%2Fsphericart/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lab-cosmo%2Fsphericart/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lab-cosmo%2Fsphericart/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/lab-cosmo","download_url":"https://codeload.github.com/lab-cosmo/sphericart/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lab-cosmo%2Fsphericart/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":29546751,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-02-17T13:00:00.370Z","status":"ssl_error","status_checked_at":"2026-02-17T12:57:14.072Z","response_time":100,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.5:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["geometric-deep-learning","python","pytorch","spherical-harmonics"],"created_at":"2024-08-02T19:00:56.971Z","updated_at":"2026-02-17T14:02:36.806Z","avatar_url":"https://github.com/lab-cosmo.png","language":"C++","funding_links":[],"categories":["Mathematical tools"],"sub_categories":[],"readme":"# sphericart\n\n[![Test](https://github.com/lab-cosmo/sphericart/actions/workflows/tests.yml/badge.svg?branch=main)](https://github.com/lab-cosmo/sphericart/actions/workflows/tests.yml)\n\nThis is sphericart, a multi-language library for the efficient calculation of real\nspherical harmonics and their derivatives in Cartesian coordinates.\n\nFor instructions and examples on the usage of the library, please refer to our\n[documentation](https://sphericart.readthedocs.io/en/latest/).\n\n\u003cp align=\"center\"\u003e\n  \u003cimg src=\"./docs/src/_static/sphericart_3-0.png\" alt=\"A plot of the +-1 isosurfaces of the Y^0\\_3 solid harmonic, including also gradients.\" width=\"50%\"\u003e\n\u003c/p\u003e\n\nIf you are using sphericart for your academic work, you can cite it as\n\n```\n@article{sphericart,\n    title={Fast evaluation of spherical harmonics with sphericart},\n    author={Bigi, Filippo and Fraux, Guillaume and Browning, Nicholas J. and Ceriotti, Michele},\n    journal={J. Chem. Phys.},\n    year={2023},\n    number={159},\n    pages={064802},\n}\n```\n\nThis 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.\n\n## Installation\n\n### Python\n\nPre-built (https://pypi.org/project/sphericart/).\n\n```bash\npip install sphericart             # numpy interface, CPU only\npip install sphericart[torch]      # Torch (and TorchScript) interface, CPU and GPU\npip install sphericart[jax]        # JAX interface, CPU and GPU\n```\n\nNote that the pre-built packages are compiled for a generic CPU, and might be\nless performant than they could be on a specific processor. To generate\nlibraries that are optimized for the target system, you can build from source:\n\n```bash\ngit clone https://github.com/lab-cosmo/sphericart\npip install .\n\n# if you also want the torch bindings (CPU and GPU)\npip install .[torch]\n\n# torch bindings, CPU-only version\npip install --extra-index-url https://download.pytorch.org/whl/cpu .[torch]\n```\n\nIf you want to enable the CUDA version of the code when builing from source,\nyou'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.\n\n### Julia\n\nA native Julia implementation of `sphericart` is provided, called `SpheriCart`.\nInstall the package by opening a REPL, switch to the package manager by\ntyping `]` and then `add SpheriCart`.\nSee [julia/README.md](julia/README.md) for usage.\n\n\n### C and C++\n\nFrom source\n\n```bash\ngit clone https://github.com/lab-cosmo/sphericart\ncd sphericart\n\nmkdir build \u0026\u0026 cd build\n\ncmake .. \u003ccmake configuration options\u003e\ncmake --build . --target install\n```\n\nThe following cmake configuration options are available:\n- `-DSPHERICART_BUILD_TORCH=ON/OFF`: build the torch bindings in addition to the main library\n- `-DSPHERICART_BUILD_TESTS=ON/OFF`: build C++ unit tests\n- `-DSPHERICART_BUILD_EXAMPLES=ON/OFF`: build C++ examples and benchmarks\n- `-DSPHERICART_OPENMP=ON/OFF`: enable OpenMP parallelism\n- `-DCMAKE_INSTALL_PREFIX=\u003cwhere/you/want/to/install\u003e` set the root path for installation\n\n\n### Running tests and documentation\n\nTests and the local build of the documentation can be run with `tox`.\nThe default tests, which are also run on the CI, can be executed by simply running\n\n```bash\ntox\n```\n\nin the main folder of the repository.\n\nTo run tests in a CPU-only environment you can set the environment variable\n`PIP_EXTRA_INDEX_URL` before calling tox, e.g.\n\n```bash\nPIP_EXTRA_INDEX_URL=https://download.pytorch.org/whl/cpu tox -e docs\n```\n\nwill build the documentation in a CPU-only environment.\n\n\n## Other flavors of spherical harmonics\n\nAlthough sphericart natively calculates real solid and spherical harmonics from\nCartesian positions, it is easy to manipulate its output it to calculate complex\nspherical harmonics and/or to accept spherical coordinates as inputs. You can see\nexamples [here](https://sphericart.readthedocs.io/en/latest/spherical-complex.html).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flab-cosmo%2Fsphericart","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Flab-cosmo%2Fsphericart","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flab-cosmo%2Fsphericart/lists"}