import openchemistry as oc

"""
Explanation: Demonstration of Open Chemistry JupyterLab Environment
End of explanation
"""


aspirin = oc.find_structure('aspirin')

aspirin.structure.show()

"""
Explanation: Find and display structures using online databases (or cached local results). This uses the CACTUS structure resolver on the backend if the structure is not available.
End of explanation
"""


calc_setup = {
    'basis': '3-21g',
    'functional': 'B3LYP'
}

result = aspirin.optimize(**calc_setup)

"""
Explanation: Set up a calculation for a structure, using various identifiers
End of explanation
"""


result.structure.show()

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

"""
Explanation: Once we have a result (currently inserted, will be triggered in next few months) we can show the 3D structure (geometry and electronic).
End of explanation
"""


result.orbitals.url()

"""
Explanation: We can also generate a unique URL for the result, and any electronic structure visualization, etc. This is available without authentication, can be viewed on desktop, mobile, tablet, and remains interactive using WebGL.
End of explanation
"""


result = aspirin.frequencies(**calc_setup)


result.frequencies.show(mode=56, animate_modes=True)

"""
Explanation: Vibrational analysis can also be shown, ability to animate, look at charts, with interactive charts liked to 3D visualization.
End of explanation
"""


