Skip to main content

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

Project description

SOMOs

[0.2.4] - 2024-04-25

Added

  - svg files available again on github

Changed

  • docs/build/html/ now in sphinx_rtd_theme

SOMOs

🔗 Available on PyPI

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


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.2.4.tar.gz (25.2 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.2.4-py3-none-any.whl (5.0 MB view details)

Uploaded Python 3

File details

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

File metadata

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

File hashes

Hashes for gsomos-0.2.4.tar.gz
Algorithm Hash digest
SHA256 b4e86ad906c942ae9b2d7a7e61837260f6e918aad7fe2324d34344d4ec88e4bd
MD5 c52c5118d2e8149a72c8204aa179ffaa
BLAKE2b-256 ea712ac4c66d3e45a8dd46ce81dd640125be5ccefe37acd6bc375268e41c7887

See more details on using hashes here.

File details

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

File metadata

  • Download URL: gsomos-0.2.4-py3-none-any.whl
  • Upload date:
  • Size: 5.0 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.2.4-py3-none-any.whl
Algorithm Hash digest
SHA256 2ab2d6d4120245593b95047ce94dcfd36647c06f99e9031cca745ac15cc8c3a8
MD5 158cea0cec55ecf44a9f8bcd252fa5f6
BLAKE2b-256 c89e3691ef3f6f41733835d97a6659ae8d486b9748e745deba36b8d7d627a44f

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