build

selene_sim.build(src: Any, name: str | None = None, *, build_dir: Path | None = None, interface: QuantumInterface | None = None, utilities: Sequence[Utility] | None = None, verbose: bool = False, planner: BuildPlanner | None = None, progress_bar: bool = False, strict: bool = False, save_planner: bool = False, complete_manifest: bool = False, **kwargs) SeleneInstance

Build an selene runner from a supported input resource type, e.g. a hugr package, LLVM file, etc. The type of this input is determined by matching against registered artifact kinds in the build planner.

The build planner is used to determine a sequence of steps to transform the input resource into a selene executable. These are then performed, and the selene executable is returned wrapped in a SeleneInstance instance.

Parameters:
  • src – The input resource representing a hybrid program.

  • name – The stem of the output executable filename, and referred to in temporary paths created in the process. If None (default), a random name is used.

  • build_dir – The directory in which to establish the directory structure for building and running the selene instance. Defaults to a temporary directory.

  • build_method – Where applicable, the method used to build the selene executable. Defaults to BuildMethod.VIA_LLVM_BITCODE.

  • interface – The quantum interface to target. This defaults to the Helios QIS.

  • utilities – A list of utility plugins to use. These are linked in with the final program to expose additional symbols to the user program.

  • verbose – If True, the build process will be more verbose.

  • planner – The build planner to use. If None, the default global planner is used. For more information, see the selene_core.build_utils documentation.

  • progress_bar – If True, a progress bar will be displayed during the build process. This requires tqdm to be installed.

  • strict – If True, intermediate artifacts will be validated against their kinds on each step. This is more expensive, and is only recommended when debugging or developing new artifact kinds and build steps.

  • complete_manifest – If True, the written manifest will include all intermediate artifacts produced during the build, providing a complete picture of all build stages. If False (default), only the final binary artifact is recorded in the manifest, which reduces manifest size and the time taken to write it.

Returns:

An SeleneInstance object representing the built selene runner