Skip to main content

Set the current experiment

If an experiment with this name doesn’t exist yet, it will be created with the given description.

Haiqu.init(experiment_ctx: str, experiment_description: str = ”) → str

Set the current experiment. If an experiment with this name doesn’t exist yet, it will be created with the given description. Most objects (e.g. circuits) and actions (e.g. running a job) must be associated with an experiment. The default experiment will be used if one is not set explicitly.
  • Parameters:
    • experiment_ctx (str) — The experiment name.
    • experiment_description (str) — An optional text description of the experiment. Only used when creating the experiment.
  • Returns: Status message.
  • Return type: str

Examples

>>> haiqu.init("Example Experiment", "The experiment to use for all examples.")
'Set current experiment to: Example Experiment'

Update the current experiment metadata

Haiqu.update_experiment(name: str | None = None, description: str | None = None) → str

Update the current experiment metadata. Set the current experiment if wasn’t set.
  • Parameters:
    • name (str | None) — Updated experiment name. Defaults to the current name.
    • description (str | None) — Updated experiment description. Defaults to the current description.
  • Returns: Status message.
  • Return type: str