# ---
# jupyter:
#   jupytext:
#     text_representation:
#       extension: .py
#       format_name: light
#       format_version: '1.5'
#       jupytext_version: 1.14.4
#   kernelspec:
#     display_name: pyenv38
#     language: python
#     name: pyenv38
# ---

# + [markdown] pycharm={"name": "#%% md\n"}
# # Psience

# + [markdown] pycharm={"name": "#%% md\n"}
# This notebook tracks the most up to date version of `Psience`.
# Test data is also available.
# -

import os, sys
sys.path.insert(0, os.path.dirname(os.path.dirname(os.getcwd())))

# + pycharm={"name": "#%%\n"}
import os
import Psience

test_dir = os.path.join(os.path.dirname(os.getcwd()), 'ci', 'tests', 'TestData')
def test_data(name):
    return os.path.join(test_dir, name)


# + [markdown] pycharm={"name": "#%% md\n"}
# ## Examples

# + [markdown] pycharm={"name": "#%% md\n"}
# We will provide a brief examples for the common use cases for each module.
# More information can be found on the pages themselves.
# The unit tests for each package are provided on the bottom of the package page.
# These provide useful usage examples.
# -

# ## Molecools

from Psience.Molecools import *

# Load a molecule from a formatted checkpoint file

# + tags=[]
mol = Molecule.from_file(test_data("HOH_freq.fchk"), bonds=[[0, 1], [0, 2]])
mol

# + [markdown] tags=[]
# Visualize its normal modes

# + jupyter={"outputs_hidden": true} tags=[]
mol.normal_modes.modes

# + [markdown] pycharm={"name": "#%% md\n"}
# ## VPT

# + [markdown] pycharm={"name": "#%% md\n"}
# The `VPT` package provides a toolkit for running vibrational perturbation theory calculations

# + pycharm={"name": "#%%\n"}
from Psience.VPT2 import *
# -

# Set up a basic VPT for water and plot the spectrum

analyzer = VPTAnalyzer.run_VPT(test_data("HOH_freq.fchk"), 3) # up through 3 quantum transitions
analyzer.spectrum.plot(image_size=650, aspect_ratio=.5)

# Print a table of frequencies and intensities

analyzer.print_output_tables()

StarcoderdataJupyterScriptsDedupFiltered