Solphin
solphin helps characterise candidate photovoltaic materials from first-principles calculations. It combines
detailed-balance analysis with the photovoltaic figure of merit of A. Crovetto, the Spectroscopic Limited Maximum
Efficiency (SLME), the Blank et al. maximum efficiency and optical absorption plots to build a full picture of a
material's theoretical photovoltaic performance. From an initial crystal structure, solphin generates the VASP or
CASTEP input files for each required calculation, and reads the results of either code.
Documentation, including workflow tutorials for both codes and the Python API reference, lives at solphin.readthedocs.io.
Installation
pip install solphin
Python 3.11 or newer is required.
To work on solphin itself, or to run the tutorial notebooks from the repository, install from a checkout instead:
git clone https://github.com/SMTG-Bham/solphin
cd solphin
pip install -e .
See the installation docs for the optional extras, the conda development environment and VASP pseudopotential setup.
Quick start
The detailed-balance analysis needs nothing beyond the package itself, so it is the quickest way to check an install. This computes the Shockley-Queisser limit for a 1.39 eV absorber (the Cu2GeS3 band gap used in the tutorials) under the bundled AM1.5G spectrum, then draws the three-panel detailed-balance figure:
import matplotlib.pyplot as plt
import solphin.db_fom as db_fom
import solphin.db_plots as db_plots
E_gap = 1.39 # band gap in eV
Tcell = 300.0 # cell temperature in K
spectrum = db_fom.load_spectrum("AM1.5")
photon_spectrum = db_fom.convert_spectrum(spectrum)
print(f"Jsc = {db_fom.jsc(E_gap, photon_spectrum, Tcell):.1f} A m^-2")
print(f"Voc = {db_fom.voc(E_gap, photon_spectrum, Tcell):.3f} V")
print(f"SQ efficiency limit = {100 * db_fom.max_eff(E_gap, photon_spectrum, Tcell):.1f} %")
db_plots.plot_db_combined(spectrum=photon_spectrum, Egap=E_gap, Tcell=Tcell, spectrum_type="AM1.5")
plt.savefig("detailed_balance.png", dpi=150, bbox_inches="tight")
The full workflow, from generating VASP or CASTEP inputs for a crystal structure to reading the finished
calculations back into band gap, effective mass, absorption, SLME and figure-of-merit analyses, is walked through in
the tutorial notebooks:
full_workflow_tutorial.ipynb
for VASP and
castep_workflow_tutorial.ipynb
for CASTEP. The same notebooks are rendered in the
documentation, alongside the
API reference.
Contributing and support
Bug reports, feature requests and questions about using the code all go through the
issue tracker. For a bug, please include the smallest snippet that
reproduces it, the full traceback and your solphin version
(python -c "import solphin; print(solphin.__version__)").
If you would like to contribute code or documentation, CONTRIBUTING.md covers the development environment, the style and docstring conventions, how to run the tests and how to build the documentation. This project follows the Contributor Covenant code of conduct.
Citation
If you use solphin in your work, please cite the following:
- Cox, P. U., Russell, P. P., Crovetto, A., Squires, A. G., Slocombe, L, & Scanlon, D. O. Solphin [Computer software]. https://github.com/SMTG-Bham/solphin
- Crovetto, A., 2024. A phenomenological figure of merit for photovoltaic materials. Journal of Physics: Energy, 6 (2), p.025009.
- Alex M. Ganose, Adam J. Jackson, David O. Scanlon. sumo: Command-line tools for plotting and analysis of periodic ab initio calculations. Journal of Open Source Software, 2018 3 (28), 717, doi:10.21105/joss.00717.
Acknowledgements
The developers Philippa U. Cox, Peter P. Russell and Louie Slocombe would like to thank Alexander G. Squires, Andrea Crovetto and David O. Scanlon for their guidance on this project, Brooke Busbee for her work on the branding and Jacob Baggott for his assistance.
License
solphin is released under the MIT License.
Metadata
Release files for solphin 1.0.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| solphin-1.0.0.tar.gz | 142.4 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| solphin-1.0.0-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 279.3 kB
Release files / solphin-1.0.0.tar.gz
| Download URL | solphin-1.0.0.tar.gz |
|---|---|
| Size | 142.4 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
ac8151187c902ccc5137edf0208f5cd25e56fdbe37f81541b4f60f461c14eca1
|
|
BLAKE2b-256 checksum How to use checksums |
f0073b192ea3ffdd7cb830ab8f40a3042232bb3cd6570129d053f3e35cc9e5f3
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Sep 21, 2026.
Transparency logRelease files / solphin-1.0.0-py3-none-any.whl
| Download URL | solphin-1.0.0-py3-none-any.whl |
|---|---|
| Size | 136.8 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
ef4fe42b8c84e4b6e97ef731a39474f4fe2a0944e157265e46a3c8bbef191a86
|
|
BLAKE2b-256 checksum How to use checksums |
527da30954fc495f2b76bff1ff804381bb63b92a20a40dacfa8351dbd83d297b
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Sep 21, 2026.
Transparency log