Compute¶
Computations are physically executed by a BigChem instance fronted by a ChemCloud server. The chemcloud python client submits jobs to and retrieves work from the ChemCloud server. Computations are submitted using the CCClient object.
Computations require a QC proram and ProgramInput
or DualProgramInput
object. The ProgramInput
object contains all the information necessary to run a single calculation. The DualProgramInput
object is used when two QC programs are used in tandem, such as when performing a geometry optimization with one program that uses a subprogram for the energy and gradient calculations.
Basic Single Point Calculation¶
from qcio import ProgramInput, ProgramOutput, Structure
from chemcloud import CCClient
water = Structure(
symbols=["O", "H", "H"],
geometry=[
[0.0000, 0.00000, 0.0000],
[0.2774, 0.89290, 0.2544],
[0.6067, -0.23830, -0.7169],
],
)
client = CCClient()
prog_inp = ProgramInput(
structure=water,
model={"method": "b3lyp", "basis": "6-31g"},
calctype="energy", # Or "gradient" or "hessian"
keywords={},
)
future_result = client.compute("terachem", prog_inp, collect_files=True)
prog_output: ProgramOutput = future_result.get()
# ProgramOutput object containing all returned data
print(prog_output.stdout)
print(prog_output)
# The energy value requested
if prog_output.success:
print(prog_output.results.energy)
print(prog_output.results.files.keys())
else:
print(prog_output.traceback)
Including Files in the Input¶
from qcio import ProgramInput, ProgramOutput, Structure
from chemcloud import CCClient
water = Structure(
symbols=["O", "H", "H"],
geometry=[
[0.0000, 0.00000, 0.0000],
[0.2774, 0.89290, 0.2544],
[0.6067, -0.23830, -0.7169],
],
)
client = CCClient()
prog_inp = ProgramInput(
structure=water,
model={"method": "b3lyp", "basis": "6-31g"},
calctype="energy",
keywords={"guess": "c0"},
files={
"c0": b'\xdf4R\xdea\xd7\xef?\xc1-\xbdg2\xd0\xca?\x8e\xc4\x94\x02\xe5\xcd\xae\xbe\xd9kP\xd8R2\xb7\xbfhV\xc1\x136\xe5\xbe\xbe\xad\x0b#2\xabp\xb6?\xe9\x91\x99\xbf\xd7\xe9e>LQ\x05\xa4F\xaa\xa6>>k\xab\xa4\xd4j\xa1\xbf\xd1#\xbf\x14\t\xdf\xd8>\x99Qq\x1b\x07\x0b\xb4?$*\x0ed\x95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xe1\xbfk\xa6\x86\xed\xfd\x15\xd7?\x9fo\xed~OG\xd0\xbft9\xe6\xcd\xa9\xcd\xd9\xbfa\xa6>"\xeb\xa7\xe3\xbfj?\xea\xd6\x11\xb3\xf3\xbf\xf2=JS\xf6\xc6\xde?9BT]PGQ?\xe9\x80\xd0\x08\xfe\xea\x9b?\xf5G\xb1\x83\xa0O\xc3?\xef\x96y[9\x92\xc2?\xc7\xb6\xd7\x87\xce\x8c\xd5\xbf\xd1Q\x02l\x958\xc6?C\xd8\x13\x1c\xdb\x89\xde\xbf2\x02y\'\xa4\xd2\xd3?^\xef\x1f\xd70\x03\xc7?\xacm2\x05s3\xe6?\xc0\xde\x00pP\xc6\xdb?\x0fx\x8c\xdfP\xea\xf0\xbf\xa7\xd4\x80E\xc9\xbe\xd5\xbf' # noqa: E501
},
)
future_result = client.compute("terachem", prog_inp, collect_files=True)
prog_output: ProgramOutput = future_result.get()
# ProgramOutput object containing all returned data
print(prog_output.stdout)
print(prog_output)
# The energy value requested
print(prog_output.results.energy)
print(prog_output.results.files.keys())
Files can also be added to an input objects using the open_file
method.
prog_input.open_file("some_file.dat")