Why wait for cluster time when others are publishing? Run your simulations now and stay ahead.
This tutorial will show you how to run Octopus simulations using the Inductiva API.
We will cover the 01-propagators.03-etrs_taylor use case from the Octopus Gitlab repository, to help you get started with simulations.
Create a folder named SimulationFiles, and place the following files inside it, using the specified filenames:
Your SimulationFiles folder should look like this:
SimulationFiles/
├── gs.inp
└── td.inp
You're now ready to send your simulation to the Cloud.
Here is the code required to run an Octopus simulation using the Inductiva API:
"""Octopus example"""
import inductiva
# Allocate cloud machine on Google Cloud Platform
cloud_machine = inductiva.resources.MachineGroup( \
provider="GCP",
machine_type="c2d-highcpu-16",
spot=True)
# Initialize the Simulator
octopus = inductiva.simulators.Octopus( \
version="16.1",
use_dev=True)
commands = [
"mv gs.inp inp",
"octopus",
"mv inp gs.inp",
"mv td.inp inp",
"octopus",
"mv inp td.inp"
]
# Run simulation
task = octopus.run( \
input_dir="/Path/to/SimulationFiles",
commands=commands,
on=cloud_machine)
task.wait()
cloud_machine.terminate()
task.download_outputs()
task.print_summary()
Note: Setting
spot=Trueenables the use of spot machines, which are available at substantial discounts. However, your simulation may be interrupted if the cloud provider reclaims the machine.
This example consists of two main steps:
octopus with the input file qs.inp. This performs the ground-state calculation and generates the restart/gs directory, which stores the wavefunctions and other data required for the next stage.octopus with the input file td.inp. This launches a real-time, time-dependent simulation based on Time-Dependent Density Functional Theory (TDDFT), using the results obtained from the previous ground-state step.When you run the Python script above, the simulation is executed on a cloud machine of type c2d-highcpu-16, which provides
16 virtual CPUs. For larger or more compute-intensive simulations, consider adjusting the machine_type parameter to
select a machine with more virtual CPUs and increased memory capacity. You can explore the full range of available machines here.
To adapt this script for other Octopus simulations, replace input_dir with the
path to your Octopus input files.
When the simulation is complete, we terminate the machine, download the results and print a summary of the simulation as shown below.
Task status: Success
Timeline:
Waiting for Input at 14/07, 15:29:45 0.771 s
In Queue at 14/07, 15:29:46 49.68 s
Preparing to Compute at 14/07, 15:30:36 5.735 s
In Progress at 14/07, 15:30:42 9.018 s
├> 1.086 s mv gs.inp inp
├> 2.093 s octopus
├> 1.083 s mv inp gs.inp
├> 1.073 s mv td.inp inp
├> 2.083 s octopus
└> 1.075 s mv inp td.inp
Finalizing at 14/07, 15:30:51 0.529 s
Success at 14/07, 15:30:51
Data:
Size of zipped output: 557.60 KB
Size of unzipped output: 1.49 MB
Number of output files: 51
Total estimated cost (US$): 0.01039 US$
Estimated computation cost (US$): 0.00039 US$
Task orchestration fee (US$): 0.010 US$
Note: A per-run orchestration fee (0.010 US$) applies to tasks run from 01 Dec 2025, in addition to the computation costs.
Learn more about costs at: https://inductiva.ai/guides/basics/how-much-does-it-cost
As you can see in the "In Progress" line, the part of the timeline that represents the actual execution of the simulation, the core computation time of this simulation was approximately 9 seconds.