# simulate_dynamics

Source: https://docs.q-ctrl.com/references/fire-opal/fireopal/fireopal.simulate_dynamics

```python
fireopal.simulate_dynamics(model, initial_state, simulation, observables, shot_count, backend_name, credentials)
```

Simulate the dynamics of a many-body model and estimate observables.

Use this function to time-evolve a quantum many-body model from a given
initial state and compute the expectation value of one or more observables
of the evolved state. Unlike circuit-based functions, this function does
not take any circuit input; the dynamics are specified entirely through the
model and simulation definitions.

The user input has four components: the model definition, the simulation
parameters, the initial state, and the observables of interest.

### Parameters
* **model** ([*ModelType*](https://docs.q-ctrl.com/references/fire-opal/fireopal/fireopal.types.ModelType.md#fireopal.types.ModelType)) – The model to simulate, created using
  [`ModelType()`](https://docs.q-ctrl.com/references/fire-opal/fireopal/fireopal.types.ModelType.md#fireopal.types.ModelType). Describes the model
  name, lattice_type and the per-term
  parameters. See `ModelType` for
  details.
* **initial_state** (*str*) – The initial state from which to begin the time evolution.
* **simulation** ([*SimulationType*](https://docs.q-ctrl.com/references/fire-opal/fireopal/fireopal.types.SimulationType.md#fireopal.types.SimulationType)) – The time-evolution method and its parameters, created using
  [`SimulationType()`](https://docs.q-ctrl.com/references/fire-opal/fireopal/fireopal.types.SimulationType.md#fireopal.types.SimulationType). Describes the
  method, step_count, and time_step.
* **observables** ([*SparseOccupationOperators*](https://docs.q-ctrl.com/references/fire-opal/fireopal/fireopal.types.SparseOccupationOperators.md#fireopal.types.SparseOccupationOperators) *|* *list* *[*[*SparseOccupationOperators*](https://docs.q-ctrl.com/references/fire-opal/fireopal/fireopal.types.SparseOccupationOperators.md#fireopal.types.SparseOccupationOperators) *]*) – Observable(s) for which to compute expectation values of the evolved
  state. Accepts a single SparseOccupationOperators instance or a list
  of SparseOccupationOperators instances.
* **shot_count** (*int*) – Number of measurements (shots) to take per circuit.
* **backend_name** (*str*) – Name of the backend that will execute circuits.
* **credentials** (*Credentials*) – Credentials for the target hardware provider, created using the
  appropriate helper from the [`fireopal.credentials`](https://docs.q-ctrl.com/references/fire-opal/fireopal/fireopal.credentials.md#module-fireopal.credentials) module. For
  example, use [`make_credentials_for_ibm_cloud()`](https://docs.q-ctrl.com/references/fire-opal/fireopal/fireopal.credentials.make_credentials_for_ibm_cloud.md#fireopal.credentials.make_credentials_for_ibm_cloud) for
  IBM backends.
### Returns
[`FireOpalJob`](https://docs.q-ctrl.com/references/fire-opal/fireopal/fireopal.FireOpalJob.md#fireopal.FireOpalJob) – A job object whose [`result()`](https://docs.q-ctrl.com/references/fire-opal/fireopal/fireopal.FireOpalJob.result.md#fireopal.FireOpalJob.result) method returns a dictionary
containing:

  observable_expectation_values (list[float])
  : The estimated expectation values of the observables for the evolved
    state.

  observables (list[PauliOperator])
  : The observables the user submitted.

  provider_job_ids ([str])
  : List of provider job IDs for all quantum jobs run during the simulation.

  warnings (list[str])
  : The warnings produced while compiling or running the simulation.
### Raises
**QctrlArgumentsValueError** – If the input parameter for model is not a `ModelType` instance.
    If the input parameter for simulation is not a `SimulationType` instance.
    If the input parameter for observables is not a `SparseOccupationOperators`
    or a list of them.
    If the input parameter for initial_state is longer than 64 characters.
    If any observable references a site index greater than
    `len(initial_state) - 1`.
