Physical constants, conversion factors, and a periodic table with clear source information for every value.
Project description
QCConst
Physical constants, conversion factors, and a periodic table with clear source information for every value. Data from NIST CODATA 2022, Pubchem, and Washington University. All data in atomic units (e.g., length in Bohr).
Data Sources
Each piece of data contains a link to its source. Primary data sources include:
| Data Name | Source | Source Links |
|---|---|---|
Physical Constants |
NIST 2022 CODATA | Individual Constant Lookup, Fundamenal Constants Listing, Conversion Factors |
Periodic Table |
PubChem, Cordero 2008, Pyykkö 2009, Alvarez 2013 | Periodic Table, Raw CSV Data, Cordero 2008, Pyykkö 2009, Alvarez 2013 |
Solvent Data |
University of Washington | Solvent Properties |
Installation
python -m pip install qcconst
Quickstart
Constants
Top-level constants can be accessed at attributes on the constants module for easy discovery and TAB-completion in Jupyter Notebooks or IDEs. This is the most convenient way to access constants. Most values come directly from CODATA (or are conversion factors computed directly from CODATA) that are given more computationally-friendly names for easy access.
>>> from qcconst import constants
>>> constants.BOHR_TO_ANGSTROM
0.529177210544, unit=Å, source=https://physics.nist.gov/cgi-bin/cuu/Value?bohrrada0
# Use constants just like a float
>>> constants.BOHR_TO_ANGSTROM * 10
5.29177210544
# Know the source of every constant
>>> constants.BOHR_TO_ANGSTROM.source
'https://physics.nist.gov/cgi-bin/cuu/Value?bohrrada0'
# See sources for all constants
>>> constants.sources
['https://physics.nist.gov/cgi-bin/cuu/Value?bohrrada0', 'https://physics.nist.gov/cgi-bin/cuu/Value?hrj|search_for=hartree+to+joule', 'https://physics.nist.gov/cuu/Constants/Table/allascii.txt', 'https://www.nist.gov/pml/special-publication-811/nist-guide-si-appendix-b-conversion-factors/nist-guide-si-appendix-b8']
# List all available constants
>>> constants.as_list()
['ANGSTROM_TO_BOHR', 'AVOGADRO_NUMBER', 'BOHR_TO_ANGSTROM', 'BOLTZMANN_CONSTANT', 'HARTREE_TO_JOULE', 'HARTREE_TO_KCAL_PER_MOL', 'KCAL_TO_JOULE', ...]
# Human readable print out of all available constants
>>> constants.show()
name value unit source
----------------------- -------------- -------- ---------------------------------------------------------
ANGSTROM_TO_BOHR 1.88973 Bohr Derived as 1 / BOHR_TO_ANGSTROM
AVOGADRO_NUMBER 6.02214e+23 mol⁻¹ https://physics.nist.gov/cuu/Constants/Table/allascii.txt
BOHR_TO_ANGSTROM 0.529177 Å https://physics.nist.gov/cgi-bin/cuu/Value?bohrrada0
BOLTZMANN_CONSTANT 1.38065e-23 J/K https://physics.nist.gov/cuu/Constants/Table/allascii.txt
...
All CODATA Physical Constants
The full CODATA 2022 set of constants are available by their NIST-given name at constants.phys or constants.codata2022. constants.phys will always point to the latest CODATA values. Currently this is the 2022 release.
>>> from qcconst import constants
>>> constants.phys['atomic unit of permittivity']
1.1126500562e-10, unit=kg m s^-1, source=CODATA 2022: https://physics.nist.gov/cuu/Constants/Table/allascii.txt
>>> constants.codata2022['conventional value of von Klitzing constant']
25812.807, unit=ohm, source=CODATA 2022: https://physics.nist.gov/cuu/Constants/Table/allascii.txt
Periodic Table
>>> from qcconst import periodic_table as pt
>>> pt.Ni
Element(symbol='Ni', number=28, name='Nickel', mass=58.6934, group=10, period=4, block='d', electron_config='[Ar] 3d8 4s2')
>>>pt.Ni.number
28
# Lookup by atomic number
>>> pt.number(4)
Element(symbol='Be', number=4, name='Beryllium', mass=9.012183, group=2, period=2, block='Alkaline earth metal', electron_config='[He]2s2')
>>> pt.group(1)
[Element(symbol='H', number=1, name='Hydrogen', mass=1.00784, group=1, period=1, block='s', electron_config='1s1'),
Element(symbol='Li', number=3, name='Lithium', mass=6.94, group=1, period=2, block='s', electron_config='[He] 2s1'),
Element(symbol='Na', number=11, name='Sodium', mass=22.98976928, group=1, period=3, block='s', electron_config='[Ne] 3s1'),
Element(symbol='K', number=19, name='Potassium', mass=39.0983, group=1, period=4, block='s', electron_config='[Ar] 4s1'),
Element(symbol='Rb', number=37, name='Rubidium', mass=85.4678, group=1, period=5, block='s', electron_config='[Kr] 5s1'),
Element(symbol='Cs', number=55, name='Cesium', mass=132.90545196, group=1, period=6, block='s', electron_config='[Xe] 6s1'),
Element(symbol='Fr', number=87, name='Francium', mass=223.0, group=1, period=7, block='s', electron_config='[Rn] 7s1')]
>>> pt.period(3)
[Element(symbol='Na', number=11, name='Sodium', mass=22.9897693, group=1, period=3, block='Alkali metal', electron_config='[Ne]3s1'),
Element(symbol='Mg', number=12, name='Magnesium', mass=24.305, group=2, period=3, block='Alkaline earth metal', electron_config='[Ne]3s2'),
Element(symbol='Al', number=13, name='Aluminum', mass=26.981538, group=13, period=3, block='Post-transition metal', electron_config='[Ne]3s2 3p1'),
Element(symbol='Si', number=14, name='Silicon', mass=28.085, group=14, period=3, block='Metalloid', electron_config='[Ne]3s2 3p2'),
Element(symbol='P', number=15, name='Phosphorus', mass=30.973762, group=15, period=3, block='Nonmetal', electron_config='[Ne]3s2 3p3'),
Element(symbol='S', number=16, name='Sulfur', mass=32.07, group=16, period=3, block='Nonmetal', electron_config='[Ne]3s2 3p4'),
Element(symbol='Cl', number=17, name='Chlorine', mass=35.45, group=17, period=3, block='Halogen', electron_config='[Ne]3s2 3p5'),
Element(symbol='Ar', number=18, name='Argon', mass=39.9, group=18, period=3, block='Noble gas', electron_config='[Ne]3s2 3p6')]
# Know the sources of the data
>>> pt.sources
['Alvarez 2013: https://doi.org/10.1039/C3DT50599E', 'Pyykkö et al. 2009: https://doi.org/10.1002/chem.200901472', 'PubChem: https://pubchem.ncbi.nlm.nih.gov/periodic-table', 'Cordero et al. 2008: https://doi.org/10.1039/b801115j']
# Human readable print out of the Periodic Table data
>>> pt.show()
Sources: ['Pyykkö et al. 2009: https://doi.org/10.1002/chem.200901472', 'Cordero et al. 2008: https://doi.org/10.1039/b801115j', 'Alvarez 2013: https://doi.org/10.1039/C3DT50599E', 'PubChem: https://pubchem.ncbi.nlm.nih.gov/periodic-table']
symbol number name mass group period block electron_config electronegativity atomic_radius cov_radius cov_radius_double cov_radius_triple vdw_radius
------ ------ ------------- ------ ----- ------ --------------------- --------------------------------- ----------------- ------------- ---------- ----------------- ----------------- ----------
H 1 Hydrogen 1.008 1 1 Nonmetal 1s1 2.2 2.2677 0.58582 2.2677
He 2 Helium 4.0026 18 1 Noble gas 1s2 2.6456 0.52912 2.7023
Li 3 Lithium 7 1 2 Alkali metal [He]2s1 0.98 3.4393 2.4188 2.3433 4.0062
Be 4 Beryllium 9.0122 2 2 Alkaline earth metal [He]2s2 1.57 2.8913 1.8141 1.7008 1.6063 3.7417
B 5 Boron 10.81 13 2 Metalloid [He]2s2 2p1 2.04 3.6283 1.5874 1.474 1.3795 3.6094
C 6 Carbon 12.011 14 2 Nonmetal [He]2s2 2p2 2.55 3.2125 1.4362 1.2661 1.1338 3.3448
N 7 Nitrogen 14.007 15 2 Nonmetal [He] 2s2 2p3 3.04 2.9291 1.3417 1.1338 1.0205 3.1369
...
Solvents
Solvents are accessed with a dictionary lookup rather than attribute lookup because many of their names are invalid Python attributes (i.e., they start with a number or contain - characters). For example, solvents.1,2-dimethoxyethane is invalid syntax. As a result, solvents are looked up using solvents['name'] rather than solvents.name.
from qcconst import solvents
>>> solvents["1,4-dioxane"]
Solvent(name='1,4-dioxane', dielectric=2.25, sources=['https://depts.washington.edu/eooptic/linkfiles/dielectric_chart%5B1%5D.pdf'])
>>> solvents["1,4-dioxane"].dielectric
2.25
# Will return None if solvent not found
>>> solvents.get("Fake Solvent")
>>>
# List all available solvents
>>> solvents.as_list()
['acetic acid', 'acetone', 'acetonitrile', 'anisole', 'benzene', 'bromobenzene', 'carbon disulfide', 'carbon tetrachloride', 'chlorobenzene', 'chloroform', 'cyclohexane', 'dibutyl ether', 'o-dichlorobenzene', '1,2-dichloroethane', 'dichloromethane', 'diethylamine', 'diethyl ether', '1,2-dimethoxyethane', 'n', 'n,n-dimethylformamide', 'dimethyl sulfoxide', '1,4-dioxane', 'ethanol', 'ethyl acetate', 'ethyl benzoate', 'formamide', 'hexamethylphosphoramide', 'isopropyl alcohol', 'methanol', '2-methyl-2-propanol', 'nitrobenzene', 'nitromethane', 'pyridine', 'tetrahydrofuran', 'toluene', 'trichloroethylene', 'triethylamine', 'trifluoroacetic acid', '2,2,2-trifluoroethanol', 'water', 'o-xylene', ...]
# Know the sources of the data
>>> solvents["water"].sources
['https://depts.washington.edu/eooptic/linkfiles/dielectric_chart%5B1%5D.pdf']
# Human readable print out of all available solvents
>>> solvents.show()
name dielectric sources
----------------------- ------------ ------------------------------------------------------------------------------
acetic acid 6.15 ['https://depts.washington.edu/eooptic/linkfiles/dielectric_chart%5B1%5D.pdf']
acetone 20.7 ['https://depts.washington.edu/eooptic/linkfiles/dielectric_chart%5B1%5D.pdf']
acetonitrile 37.5 ['https://depts.washington.edu/eooptic/linkfiles/dielectric_chart%5B1%5D.pdf']
anisole 4.33 ['https://depts.washington.edu/eooptic/linkfiles/dielectric_chart%5B1%5D.pdf']
benzene 2.27 ['https://depts.washington.edu/eooptic/linkfiles/dielectric_chart%5B1%5D.pdf']
bromobenzene 5.17 ['https://depts.washington.edu/eooptic/linkfiles/dielectric_chart%5B1%5D.pdf']
...
Adding New Values
Adding new values is simple! Just add it to one of the .csv files in src/qcconst/data. Include the value, its source, and any other required metadata and then open a PR. That's it! ✨
The QC Suite of Programs
If you like qcconst you may like my other libraries for computational chemistry.
- qcio - Elegant and intuitive data structures for quantum chemistry, featuring seamless Jupyter Notebook visualizations. Documentation
- qccodec - A library for parsing Quantum Chemistry output files into structured data objects and converting structured input objects into program-native input files. Uses data structures from
qcio. - qcop - A package for operating quantum chemistry programs using
qciostandardized data structures. Compatible withTeraChem,psi4,QChem,NWChem,ORCA,Molpro,geomeTRICand many more. - BigChem - A distributed application for running quantum chemistry calculations at scale across clusters of computers or the cloud. Bring multi-node scaling to your favorite quantum chemistry program.
ChemCloud- A web application and associated Python client for exposing a BigChem cluster securely over the internet.
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file qcconst-0.2.1.tar.gz.
File metadata
- Download URL: qcconst-0.2.1.tar.gz
- Upload date:
- Size: 56.0 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.12.9
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
97aee85ba2ba078eb076dc0544737fe59206cf68d8efababc57e4578b7e4595a
|
|
| MD5 |
c3b30636a29e89e138497cb65f3b4817
|
|
| BLAKE2b-256 |
049b5e257bfa14fb4abc6f90b5109c51d697f3e412b4afeac008b6ebaf92f36c
|
Provenance
The following attestation bundles were made for qcconst-0.2.1.tar.gz:
Publisher:
publish-to-pypi.yaml on coltonbh/qcconst
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
qcconst-0.2.1.tar.gz -
Subject digest:
97aee85ba2ba078eb076dc0544737fe59206cf68d8efababc57e4578b7e4595a - Sigstore transparency entry: 226816195
- Sigstore integration time:
-
Permalink:
coltonbh/qcconst@ebaf274f66abf6d5349fdb80a4cec9f88ba947e3 -
Branch / Tag:
refs/tags/0.2.1 - Owner: https://github.com/coltonbh
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish-to-pypi.yaml@ebaf274f66abf6d5349fdb80a4cec9f88ba947e3 -
Trigger Event:
push
-
Statement type:
File details
Details for the file qcconst-0.2.1-py3-none-any.whl.
File metadata
- Download URL: qcconst-0.2.1-py3-none-any.whl
- Upload date:
- Size: 34.1 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.12.9
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
2c1489e60909ac03daa448a06b59705376be6d71d6d0cee1caecde5517559206
|
|
| MD5 |
28501d57ef584e422dee17cfbeecf1e2
|
|
| BLAKE2b-256 |
93d7f12f520a35d8ff5cd647d37627bcf1be98f701c4ab69b520164214ba7e77
|
Provenance
The following attestation bundles were made for qcconst-0.2.1-py3-none-any.whl:
Publisher:
publish-to-pypi.yaml on coltonbh/qcconst
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
qcconst-0.2.1-py3-none-any.whl -
Subject digest:
2c1489e60909ac03daa448a06b59705376be6d71d6d0cee1caecde5517559206 - Sigstore transparency entry: 226816196
- Sigstore integration time:
-
Permalink:
coltonbh/qcconst@ebaf274f66abf6d5349fdb80a4cec9f88ba947e3 -
Branch / Tag:
refs/tags/0.2.1 - Owner: https://github.com/coltonbh
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish-to-pypi.yaml@ebaf274f66abf6d5349fdb80a4cec9f88ba947e3 -
Trigger Event:
push
-
Statement type: