# Gaussian Frontier Orbitals

> Determine and export HOMO and LUMO cube files from Gaussian formatted checkpoint (.fch) files using Multiwfn, with optional VMD images and energy data. Use for closed-shell Gaussian FCH frontier-orbital analysis.

- **Type:** Skill
- **Install:** `agentstack add skill-nanhuai-x-gaussian-molecule-workflow-gaussian-frontier-orbitals`
- **Verified:** Yes — security-reviewed for prompt injection and unsafe behavior
- **Seller:** [Nanhuai-X](https://agentstack.voostack.com/s/nanhuai-x)
- **Installs:** 0
- **Category:** [Agent Skills](https://agentstack.voostack.com/c/agent-skills)
- **Latest version:** 0.1.0
- **License:** MIT
- **Upstream author:** [Nanhuai-X](https://github.com/Nanhuai-X)
- **Source:** https://github.com/Nanhuai-X/gaussian-molecule-workflow/tree/main/skills/gaussian-frontier-orbitals

## Install

```sh
agentstack add skill-nanhuai-x-gaussian-molecule-workflow-gaussian-frontier-orbitals
```

Requires the [AgentStack CLI](https://agentstack.voostack.com/docs/cli). Works with Claude Code, Cursor, and any MCP-compatible agent.

## About

# Gaussian HOMO/LUMO analysis

Use this skill when `.fch` files need HOMO/LUMO indices, orbital cubes, energy data, or rendered frontier-orbital images.

## Safety gate: wavefunction type

Automatic index selection is valid only for a restricted **closed-shell** wavefunction: HOMO = total electrons / 2 and LUMO = HOMO + 1. Before using it, inspect the FCH occupation/electron information.

- For UHF, ROHF, open-shell, spin-polarized, or fractional occupations, stop automatic selection.
- Ask the user for the required alpha/beta spin channel and orbital indices, or use an occupation-aware parser.
- Never silently apply the closed-shell formula to UHF, ROHF, or fractional systems.

## Workflow

Run the bundled closed-shell exporter from the analysis folder:

```powershell
python /scripts/run_orbitals.py --input fch --output output
```

It carries its own export logic and does not require this repository's root scripts.

1. Locate Multiwfn through `MULTIWFN_BIN`, then `PATH`, then a user-provided path. For optional graphics, resolve `VMD_BIN` similarly; PNG conversion requires Pillow.
2. For every `fch/.fch`, create an isolated run directory and record the selected HOMO/LUMO indices in a root-level `orbital_indices.txt` and a per-molecule log.
3. Export exactly the selected HOMO and LUMO orbital cube files through Multiwfn. Use deterministic names such as `_orb######.cub` and do not overwrite an existing final cube without permission.
4. Extract the selected orbital energies and write `_energies.txt`, including orbital indices, units, and spin channel.
5. If graphics are requested, render the two cubes to `_HOMO.tga` and `_LUMO.tga`, convert them to corresponding PNG files, verify readability, and remove only the temporary TGA files. The two orbital phases use red `#CE3B58` for positive and blue `#4A65A0` for negative.

## Output contract

For a closed-shell molecule, require 2 orbital cubes, `orbital_indices.txt`, and `_energies.txt`; graphics add 2 PNG files. Stop on missing cubes, inconsistent indices, VMD failures, or Multiwfn errors. Some Multiwfn 3.8 Windows builds return an EOF code after writing both orbital cubes; accept that return only when both newly generated cubes and the export log are validated.

## Reporting

Keep long Multiwfn output in molecule logs. Finish with a short table of selected orbitals and generated files; refer ESP requests to `$gaussian-esp-vmd` and ELF requests to `$gaussian-elf`.

## Source & license

This open-source skill is cataloged on AgentStack and links to its original source — we do not rehost the code.

- **Author:** [Nanhuai-X](https://github.com/Nanhuai-X)
- **Source:** [Nanhuai-X/gaussian-molecule-workflow](https://github.com/Nanhuai-X/gaussian-molecule-workflow)
- **License:** MIT

Install and usage instructions live in the source repository linked above.

## Pricing

- **Free** — Free

## Security capabilities

Automated source analysis of v0.1.0 — what this tool can access:

- **Network access:** no
- **Filesystem access:** no
- **Shell / process execution:** no
- **Environment & secrets:** no
- **Dynamic code execution:** no

*"Yes" means the capability is present in the source — more access means more to trust, not that it is unsafe.*


## Versions

- **0.1.0** — security scan: passed — Imported from the upstream source.

## Links

- Listing page: https://agentstack.voostack.com/l/skill-nanhuai-x-gaussian-molecule-workflow-gaussian-frontier-orbitals
- Seller: https://agentstack.voostack.com/s/nanhuai-x
- Browse the marketplace: https://agentstack.voostack.com/browse

---
Listed on AgentStack — the marketplace for AI agent skills and MCP servers. Every listing is security-reviewed. Creators keep 70%.
