import openchemistry as oc

"""
Explanation: Open Chemistry JupyterLab NWChem calculations
End of explanation
"""


mol = oc.find_structure('InChI=1S/C2H6/c1-2/h1-2H3')
mol.structure.show()

"""
Explanation: Start by finding structures using online databases (or cached local results). This uses an InChI for ethane to seed the molecule collection.
End of explanation
"""


image_name = 'openchemistry/nwchem:6.6'
input_parameters = {
    'theory': 'dft',
    'functional': 'b3lyp',
    'basis': '6-31g'
}

"""
Explanation: Set up the calculation, by specifying the name of the Docker image that will be used, and by providing input parameters that are known to the specific image
End of explanation
"""


result = mol.optimize(image_name, input_parameters)

result.orbitals.show(mo='lumo', iso=0.005)

"""
Explanation: Geometry Optimization Calculation
The mol.optimize() method is a specialized helper function that adds 'task': 'optimize' to the input_parameters dictionary,
and then calls the generic mol.calculate() method internally.
End of explanation
"""


result = mol.energy(image_name, input_parameters)

result.orbitals.show(mo='homo', iso=0.005)

"""
Explanation: Single Point Energy Calculation
The mol.energy() method is a specialized helper function that adds 'task': 'energy' to the input_parameters dictionary,
and then calls the generic mol.calculate() method internally.
End of explanation
"""


result = mol.frequencies(image_name, input_parameters)

result.vibrations.show(mode=1)

"""
Explanation: Normal Modes Calculation
The mol.frequencies() method is a specialized helper function that adds 'task': 'frequency' to the input_parameters dictionary,
and then calls the generic mol.calculate() method internally.
End of explanation
"""


