ORCA quantum chemistry data parser
Project description
Blackfish 🐋
Installation
pip install blackfish
Quick Start
from blackfish import OrcaParser
# Load the ORCA output file
parser = OrcaParser("my_calculation.out")
# Data can then be parsed as polars DataFrames
ir_spectrum = parser.get_ir_spectrum()
nacme = parser.get_nacme()
tddft_roots = parser.get_tddft_roots()
tddft_soc_spectrum = parser.get_tddft_soc_spectrum()
soc_states = parser.get_soc_states()
socme = parser.get_socme()
# Energy values are stored in an Energies object.
# If a value can't be parsed, it returns None
energies = parser.get_energies()
energies.fspe # Hartree
energies.fspe(unit="kj/mol") # kJ/mol
energies.gibbs_free_energy
energies.gibbs_minus_electronic_energy
energies.entropy
energies.enthalpy
energies.zero_point_energy
# or simply convert energies
energy_in_kjmol = OrcaParser.convert_energy(energy_in_kcalmol, from_unit="kcal/mol", to_unit="kj/mol")
# Available energy units
# - hartree
# - ev
# - 1/cm
# - kj/mol
# - kcal/mol
Examples
IR Spectrum Analysis
# Get IR spectrum data
ir_spectrum = orca.get_ir_spectrum()
# View strongest vibrational modes
strongest_modes = ir_spectrum.filter(pl.col("rel_intensity") > 0.5)
print(strongest_modes)
# Get frequencies above 3000 1/cm
high_freq = ir_spectrum.filter(pl.col("frequency_cm") > 3000)
print(high_freq)
Electronic State Analysis
# Get excited state data
tddft_roots = orca.get_tddft_roots()
# Group transitions by multiplicity
by_mult = tddft_roots.group_by("mult").agg([
pl.count(),
pl.mean("energy_cm").alias("avg_energy")
])
SOC States Analysis
# Get SOC states
soc_states = orca.get_soc_states()
# Get contributions to specific SOC state
state1 = soc_states.filter(pl.col("state") == 1)
# Find states with large spin mixing
mixed_states = soc_states.filter(pl.col("weight") > 0.2)
# Summarize spin components per state
spin_summary = soc_states.group_by("state").agg([
pl.n_unique("spin").alias("n_spin_components"),
pl.max("weight").alias("max_contribution")
])
NACME Analysis
# Get non-adiabatic coupling elements
nacme = orca.get_nacme()
# Find atoms with strong coupling
strong_coupling = nacme.filter(pl.col("magnitude") > 0.1)
# Get coupling vectors for specific atoms
h_atoms = nacme.filter(pl.col("symbol") == "H")
# Sort atoms by coupling magnitude
sorted_coupling = nacme.sort("magnitude", descending=True)
TDDFT SOC Spectrum Analysis
# Get absorption spectrum
tddft_soc_spectrum = orca.get_tddft_soc_spectrum()
# Find intense transitions
intense = tddft_soc_spectrum.filter(pl.col("rel_intensity") > 0.5)
# Get visible region transitions
visible = tddft_soc_spectrum.filter(
(pl.col("wavelength_nm") >= 380) &
(pl.col("wavelength_nm") <= 700)
)
# Summarize by spin multiplicity
by_mult = tddft_soc_spectrum.group_by("mult").agg([
pl.count(),
pl.mean("energy_ev").alias("avg_energy"),
pl.max("osc_strength").alias("max_intensity")
])
Data Structure
Blackfish uses Polars DataFrames for efficient data handling. Common DataFrame schemas include:
IR Spectrum
mode: Vibrational mode numberfrequency_cm: Frequency in cm⁻¹intensity: IR intensityrel_intensity: Normalized intensitytx/ty/tz: Transition dipole components
Excited States (Roots)
root: State numbermult: Spin multiplicitydonor: Donor orbitalacceptor: Acceptor orbitalweight: Configuration weightenergy_cm: Energy in cm⁻¹
SOC States
state: SOC state numberspin: Spin componentroot: Contributing root stateweight: State contribution weightenergy_cm: Energy in cm⁻¹
NACME
id: Atom indexsymbol: Atomic symbolx/y/z: Coupling vector componentsmagnitude: Total coupling magnitude
SOC Absorption Spectrum
state: Final state numbermult: State multiplicityenergy_ev: Transition energy in eVenergy_cm: Energy in cm⁻¹wavelength_nm: Wavelength in nmosc_strength: Oscillator strengthrel_intensity: Normalized intensity
License
This project is licensed under the Apache2.0 License - see the LICENSE file for details.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
blackfish-0.3.6.tar.gz
(628.8 kB
view details)
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
blackfish-0.3.6-py3-none-any.whl
(23.9 kB
view details)
File details
Details for the file blackfish-0.3.6.tar.gz.
File metadata
- Download URL: blackfish-0.3.6.tar.gz
- Upload date:
- Size: 628.8 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: uv/0.5.20
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
e4b2dab99c9da14a433b03a771b5443efd57ac2868ec9640faed486db6288c4b
|
|
| MD5 |
4dd5e189bf2f5dc5fb5fff7e2dafe2f2
|
|
| BLAKE2b-256 |
d733f413739ed1ffdb105920a5e87880efc2e70c205e625616f68479c469bb1d
|
File details
Details for the file blackfish-0.3.6-py3-none-any.whl.
File metadata
- Download URL: blackfish-0.3.6-py3-none-any.whl
- Upload date:
- Size: 23.9 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: uv/0.5.20
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
4150a164415eb62e11915554a06803911022d7b917362d8aef7157fe0fc34d75
|
|
| MD5 |
16637666c4544ff3665847474ad151b9
|
|
| BLAKE2b-256 |
9ceee7bbf05c0f084903eb34b929892b6d25aef3567bf3bf0905e8f4625aae00
|