Skip to main content

A Python package to analyze magnetic molecular orbitals (SOMOs) from Gaussian outputs

Project description

SOMOs

Version [0.9.0] - 2024-04-26 Changed

  • logo is now gSOMOs instead of SOMOs
  • in the projection scheme (proj.py), there are now two criteria to identify a SOMO, namely "SOMO P2v?" (formerly SOMO?) and "SOMO dom. β MO?" (see scientific documentation)
    • SOMOs identified according to the P^2_virtual criterion are highlighted in green
    • SOMOs identified only on the basis of a dominant virtual beta MO are highlighted in orange (weaker criterion)
  • Scientific documentation renamed gSOMOs.pdf. And content updated Added
  • new analyzis scheme in proj.py: bases on the diagonalization of projection matrices
  • new clean_logfile_name() function in io.py (made to solve a prefix issue for X.log.gz files)

SOMOs

🔗 Available on PyPI

A Python library to identify and analyze Single Occupied Molecular Orbitals (SOMOs) from Gaussian 09 or Gaussian 16 .log files.

PyPI version Documentation Status License Python Build


Installation

pip install SOMOs

Capabilities Overview

SOMOs is a Python toolkit for analyzing molecular orbitals (MOs) from Gaussian log files, with a focus on identifying SOMOs (Singly Occupied Molecular Orbitals) in open-shell systems.


🚀 Main Features

Load Gaussian Log Files

  • Parses .log and .log.gz Gaussian output files
  • Extracts orbital energies, coefficients, overlap matrices, and spin
from somos import io
alpha_df, beta_df, alpha_mat, beta_mat, nbasis, S, info = io.load_mos_from_cclib(logfolder, logfile)

Cosine Similarity & SOMO Detection

  • Computes cosine similarities between alpha and beta orbitals
  • Identifies SOMO candidates from orbital projections
from somos import cosim
listMOs, coeffMOs, nBasis, dfSOMOs, S = cosim.analyzeSimilarity(logfolder, logfile)

Projection-Based Analysis

  • Projects occupied and virtual alpha MOs onto virtual beta MOs
  • Decomposes projection matrix to extract leading contributions
from somos import proj
df_proj, info = proj.project_occupied_alpha_onto_beta(logfolder, logfile)
display(proj.show_alpha_to_homo(df_proj, logfolder, logfile))

📊 Visualization Tools

Heatmaps

  • Interactive or static heatmaps of MO similarities
  • Highlights SOMO-related regions and orbital clustering

t-SNE (Dimensionality Reduction)

  • Projects high-dimensional orbital space to 2D for visual exploration
  • Enables inspection of orbital families and similarity patterns
cosim.heatmap_MOs(listMOs, coeffMOs, nBasis, S, logfolder, logfile)          # Generates heatmap from cosine similarities
cosim.tsne(listMOs, coeffMOs, S, logfolder,logfile)                          # Generates 2D layout from cosine similarities
proj.projection_heatmap_from_df(df_proj, info["nbasis"], logfolder, logfile) # Generates heatmap from the projection scheme

📁 Output

  • .xlsx tables of SOMO similarity and projections
  • .png images of heatmaps and projections
  • All results saved in the logs/ folder

✅ Example Used in Notebook

  • H2CO_T1_g09_wOverlaps.log.gz (compressed Gaussian file)

Examples

see the SOMOs-examples.ipynb Jupyter notebook


Technical and scsientific documentation

This document describes two complementary methods to identify singly occupied molecular orbitals (SOMOs) in open-shell systems:

  • Orbital projection analysis, where occupied α orbitals are projected onto the β orbital basis using the AO overlap matrix;
  • Cosine similarity mapping, which computes the angular similarity between α and β orbitals and matches them using the Kuhn–Munkres (Hungarian) algorithm.

An example based on the triplet state (T₁) of formaldehyde (H₂CO) is included in the doc/ folder


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

gsomos-0.9.0.tar.gz (48.7 MB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

gsomos-0.9.0-py3-none-any.whl (4.3 MB view details)

Uploaded Python 3

File details

Details for the file gsomos-0.9.0.tar.gz.

File metadata

  • Download URL: gsomos-0.9.0.tar.gz
  • Upload date:
  • Size: 48.7 MB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.11.12

File hashes

Hashes for gsomos-0.9.0.tar.gz
Algorithm Hash digest
SHA256 1e8e27aee1b8fb36022a5bc08128cff3f04f085c1eedb972111817cbb4befdf9
MD5 8b452ed241265457ed5f97c73e8b104c
BLAKE2b-256 3f4e166bc24c165f7ba6d9bad5e5cc25ddb7b25917b914c0a9d5c2b4705e28fa

See more details on using hashes here.

File details

Details for the file gsomos-0.9.0-py3-none-any.whl.

File metadata

  • Download URL: gsomos-0.9.0-py3-none-any.whl
  • Upload date:
  • Size: 4.3 MB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.11.12

File hashes

Hashes for gsomos-0.9.0-py3-none-any.whl
Algorithm Hash digest
SHA256 2b12433fedc7b718c14861e5bdc282ab82a314f7867007c142cab599a55ba092
MD5 51b7ce305eb61ada3789f3480e23a558
BLAKE2b-256 81371e78b54fc69baad84d995c810a51e0e054bca56878107fe1ac83352d6a13

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page