Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
49 changes: 49 additions & 0 deletions Methane-VibFreqAnalysis.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
import psi4
import numpy as np

# Initial setup
psi4.set_memory('2 GB')
psi4.set_num_threads(2)

file_prefix = 'methane_HF-DZ'

ch4 = psi4.geometry("""
symmetry c1
0 1
C -0.85972 2.41258 0.00000
H 0.21028 2.41258 0.00000
H -1.21638 2.69390 -0.96879
H -1.21639 3.11091 0.72802
H -1.21639 1.43293 0.24076
""")


# Geometry optimization
psi4.set_output_file(file_prefix + '_geomopt.dat', False)
psi4.set_options({'g_convergence': 'gau_tight'})
psi4.optimize('scf/cc-pVDZ', molecule=ch4)


# Run vibrational frequency analysis
psi4.set_output_file(file_prefix + '_vibfreq.dat', False)
scf_energy, scf_wfn = psi4.frequency('scf/cc-pVDZ', molecule=ch4, return_wfn=True, dertype='gradient')

# Save "raw" frequencies into a variable
frequencies = scf_wfn.frequency_analysis['omega'].data # this command is just to get you started!

# Eliminate imaginary parts of frequencies,
frequencies2 = np.real(frequencies)
# round the frequencies (to the nearest whole number),
frequencies_rounded = np.round(frequencies2)
# and extract only the *non-zero* frequencies
frequencies_abovezero = frequencies_rounded[frequencies_rounded>0]
# Determine the unique non-zero frequencies and
# the number of times each such frequency occurs;
# store these in a NumPy array in the format:
# {frequency, count} (i.e, one line per freq.)
(frequency, count)= np.unique(frequencies_abovezero, return_counts = True)
frequencies_final = np.asarray((frequency, count)).T
# Save the NumPy array with frequency and count data
# to a text file with the header line: 'freq degen'
np.savetxt('frequency degeneracies.txt', frequencies_final, header = 'freq degen')

5 changes: 5 additions & 0 deletions frequencydegeneracies.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
# freq degen
1.434000000000000000e+03 3.000000000000000000e+00
1.648000000000000000e+03 2.000000000000000000e+00
3.165000000000000000e+03 1.000000000000000000e+00
3.286000000000000000e+03 3.000000000000000000e+00
14 changes: 7 additions & 7 deletions text1.txt
Original file line number Diff line number Diff line change
Expand Up @@ -5,26 +5,26 @@ under her vivid hair gave the impression that her whole head was on fire.

Raindrops the size of bullets thundered on the castle windows for days on end; the lake rose, the flower beds turned into muddy streams,
and Hagrid's pumpkins swelled to the size of garden sheds. Oliver Wood's enthusiasm for regular training sessions, however, was not
dampened, which was why Harry was to be found, late one stormy Saturday afternoon a few days before Halloween, returning to Gryffindor
dampened, which was why Mimi was to be found, late one stormy Saturday afternoon a few days before Halloween, returning to Gryffindor
Tower, drenched to the skin and splattered with mud.

Even aside from the rain and wind it hadn't been a happy practice session. Fred and George, who had been spying on the Slytherin team,
had seen for themselves the speed of those new Nimbus Two Thousand and Ones. They reported that the Slytherin team was no more than seven
greenish blurs, shooting through the air like missiles.

As Harry squelched along the deserted corridor he came across somebody who looked just as preoccupied as he was. Nearly Headless Nick,
As Mimi squelched along the deserted corridor he came across somebody who looked just as preoccupied as he was. Nearly Headless Nick,
the ghost of Gryffindor Tower, was staring morosely out of a window, muttering under his breath, ". . . don't fulfill their
requirements . . . half an inch, if that . . ."

"Hello, Nick," said Harry.
"Hello, Nick," said Mimi.

"Hello, hello," said Nearly Headless Nick, starting and looking round. He wore a dashing, plumed hat on his long curly hair,
and a tunic with a ruff, which concealed the fact that his neck was almost completely severed. He was pale as smoke, and Harry
and a tunic with a ruff, which concealed the fact that his neck was almost completely severed. He was pale as smoke, and Mimi
could see right through him to the dark sky and torrential rain outside.

"You look troubled, young Potter," said Nick, folding a transparent letter as he spoke and tucking it inside his doublet.
"You look troubled, young Lavin," said Nick, folding a transparent letter as he spoke and tucking it inside his doublet.

"So do you," said Harry.
"So do you," said Mimi.

"Ah," Nearly Headless Nick waved an elegant hand, "a matter of no importance. . . . It's not as though I really wanted to join. . . .
Thought I'd apply, but apparently I 'don't fulfill requirements' -"
Expand All @@ -34,7 +34,7 @@ In spite of his airy tone, there was a look of great bitterness on his face.
"But you would think, wouldn't you," he erupted suddenly, pulling the letter back out of his pocket, "that getting hit forty-five
times in the neck with a blunt axe would qualify you to join the Headless Hunt?"

"Oh - yes," said Harry, who was obviously supposed to agree.
"Oh - yes," said Mimi, who was obviously supposed to agree.

"I mean, nobody wishes more than I do that it had all been quick and clean, and my head had come off properly, I mean,
it would have saved me a great deal of pain and ridicule. However -" Nearly Headless Nick shook his letter open and read
Expand Down
4 changes: 4 additions & 0 deletions text2.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
Quotes from The Fresh Prince of Bel-Air:

Mimi: "I love chemistry."
Lisette: "I love computing."
Mimi: "If only there was a way we could combine the two!"

Uncle Phil: "We Eat Here Later. You Eat Here Never.
Jazz: "Looks Like You Eat Here Often."

Expand Down
1 change: 1 addition & 0 deletions text3.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Beep beep boop boop -robot