Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add Gaussian harness #442

Open
wants to merge 30 commits into
base: master
Choose a base branch
from
Open
Changes from 1 commit
Commits
Show all changes
30 commits
Select commit Hold shift + click to select a range
c9c49a4
Create gaussian.py
QuChem Nov 29, 2023
70596ae
Update gaussian.py
QuChem Nov 29, 2023
b4c5d30
Cleaning gaussian.py
QuChem Nov 29, 2023
1aa3522
Removed the empty line
QuChem Nov 30, 2023
10ae387
implement cclib into gaussian.py
QuChem Dec 12, 2023
11fc097
Convert QCElemental inputs to Gaussian inputs
QuChem Dec 20, 2023
ee0dcb4
Convert QCElemental inputs to Gaussian inputs
QuChem Dec 20, 2023
f93420c
Add input generator
QuChem Jan 10, 2024
3050155
Improved the parse_output function
QuChem Jan 10, 2024
b1097be
Add versioning
QuChem Jan 18, 2024
a5265b6
Improved parse_output function
QuChem Jan 23, 2024
5d73c9f
the parse_output function extracts more data
QuChem Feb 1, 2024
6eb55e4
Cleaning gaussian.py
QuChem Feb 14, 2024
aad52cf
Create programs.py
QuChem Feb 16, 2024
ce55302
Add gaussian to base.py
QuChem Feb 16, 2024
0ccc8ef
Delete qcengine/programs.py
QuChem Mar 1, 2024
30e2579
Changed "Gaussian" to "gaussian"
QuChem Mar 14, 2024
d76c5e7
Try to handle .fchk file format in gaussian.py
QuChem Apr 11, 2024
95d16f0
Handle the fchk file in gaussian.py
QuChem Apr 12, 2024
61216dd
Dependency cclib check
QuChem Jun 12, 2024
a2ff5c8
gaussian.py encompasses g09 and g16
QuChem Jun 12, 2024
ab23bb6
Extract different energy values
QuChem Jul 15, 2024
5df8272
reordered the if-else statement
QuChem Jul 16, 2024
6377cb0
Add additional libraries to gaussian.py
QuChem Jan 16, 2025
c7c0c1c
Add major updates to most of the methos in gaussian.py
QuChem Jan 16, 2025
39d565a
Update parse_output method
QuChem Jan 29, 2025
1d04979
Update compute method
QuChem Jan 29, 2025
62b0b9b
Update build_input method
QuChem Jan 29, 2025
3ccdc93
Update the execute method
QuChem Jan 29, 2025
9c39b94
Update the parse_output method
QuChem Jan 31, 2025
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
Prev Previous commit
Next Next commit
Add gaussian to base.py
QuChem authored Feb 16, 2024

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature.
commit ce55302956780a8dae00af28bea2b8a6cda1bf02
2 changes: 2 additions & 0 deletions qcengine/programs/base.py
Original file line number Diff line number Diff line change
@@ -28,6 +28,7 @@
from .torchani import TorchANIHarness
from .turbomole import TurbomoleHarness
from .xtb import XTBHarness
from .gaussian import GaussianHarness

__all__ = ["register_program", "get_program", "list_all_programs", "list_available_programs"]

@@ -118,6 +119,7 @@ def list_available_programs() -> Set[str]:
register_program(TurbomoleHarness())
register_program(TeraChemFrontEndHarness())
register_program(TeraChemPBSHarness())
register_program(GaussianHarness())

# Semi-empirical
register_program(MopacHarness())

Unchanged files with check annotations Beta

"""
import os
import re

Check notice

Code scanning / CodeQL

Unused import Note

Import of 're' is not used.
import tempfile

Check notice

Code scanning / CodeQL

Unused import Note

Import of 'tempfile' is not used.
import warnings

Check notice

Code scanning / CodeQL

Unused import Note

Import of 'warnings' is not used.
from collections import defaultdict

Check notice

Code scanning / CodeQL

Unused import Note

Import of 'defaultdict' is not used.
from typing import Any, Dict, List, Optional, Tuple

Check notice

Code scanning / CodeQL

Unused import Note

Import of 'Tuple' is not used.
import cclib
from cclib.method import Nuclear
import numpy as np

Check notice

Code scanning / CodeQL

Unused import Note

Import of 'np' is not used.
from qcelemental import constants
from qcelemental.models import AtomicInput, AtomicResult, Molecule, Provenance

Check notice

Code scanning / CodeQL

Unused import Note

Import of 'Molecule' is not used.
from qcelemental.molparse import regex

Check notice

Code scanning / CodeQL

Unused import Note

Import of 'regex' is not used.
from qcelemental.util import parse_version, safe_version, which

Check notice

Code scanning / CodeQL

Unused import Note

Import of 'parse_version' is not used.
Import of 'safe_version' is not used.
from qcengine.config import TaskConfig, get_config

Check notice

Code scanning / CodeQL

Unused import Note

Import of 'get_config' is not used.
from ..exceptions import InputError, UnknownError
from ..util import disk_files, execute, temporary_directory

Check notice

Code scanning / CodeQL

Unused import Note

Import of 'disk_files' is not used.
Import of 'temporary_directory' is not used.
from .model import ProgramHarness
class GaussianHarness(ProgramHarness):
else:
raise InputError(f"Driver {input_model.driver} not implemented for Gaussian.")
#if input_model.molecule.fix_com or input_model.molecule.fix_orientation:
# keywords["SYM_IGNORE"] = "TRUE"

Check notice

Code scanning / CodeQL

Commented-out code Note

This comment appears to contain commented-out code.
if 'SCF_CONVERGENCE' in keywords:
gaussian_kw.append('SCF=' + keywords["SCF_CONVERGENCE"])
if 'POPULATION' in keywords:
gaussian_kw.append('Pop=' + keywords['POPULATION'])
keywords = {'scf_damp': 'true',

Check notice

Code scanning / CodeQL

Unused local variable Note

Variable keywords is not used.
'scf_diis': 'false'}
# Begin input file
input_file = []
data = cclib.io.ccread(tmp_output_file)
cclib_vars = data.getattributes(True)
last_occupied_energy = data.moenergies[0][data.homos[0]]

Check notice

Code scanning / CodeQL

Unused local variable Note

Variable last_occupied_energy is not used.
#output_data['HOMO ENERGY'] = last_occupied_energy
scf_energy = data.scfenergies[0] / constants.conversion_factor("hartree", "eV") # Change from the eV unit to the Hartree unit
output_data['return_result'] = scf_energy
#print (os.system('ccget --list ' + tmp_output_file)) #data available in the output for parsing
#if input_model.driver == 'energy':
# print (cclib.__version__)
# print (output_data)

Check notice

Code scanning / CodeQL

Commented-out code Note

This comment appears to contain commented-out code.
#print (input_model)
properties = {
output_data['success'] = True
#print ('output_data: ', output_data)
provenance = Provenance(creator="Gaussian", version=self.get_version(), routine='g09').dict()

Check notice

Code scanning / CodeQL

Unused local variable Note

Variable provenance is not used.
stdout = outfiles.pop('stdout')

Check notice

Code scanning / CodeQL

Unused local variable Note

Variable stdout is not used.
stderr = outfiles.pop('stderr')

Check notice

Code scanning / CodeQL

Unused local variable Note

Variable stderr is not used.
#print("\nPRINT STDOUT: \n", stdout)
method = input_model.model.method.lower()

Check notice

Code scanning / CodeQL

Unused local variable Note

Variable method is not used.
#method = method[4:] if method.startswith("") else method
# filter unwanted data