EmulatorBuilder

class guppylang.emulator.EmulatorBuilder(_name: str | None = None, _build_dir: Path | None = None, _verbose: bool = False, _planner: BuildPlanner | None = None, _utilities: Sequence[Utility] | None = None, _interface: QuantumInterface | None = None, _progress_bar: bool = False, _strict: bool = False, _save_planner: bool = False)[source]

A builder class for creating EmulatorInstance objects.

Supports configuration parameters for compilation of emulator instances.

__delattr__(name)

Implement delattr(self, name).

__eq__(other)

Return self==value.

__hash__()

Return hash(self).

__init__(_name: str | None = None, _build_dir: Path | None = None, _verbose: bool = False, _planner: BuildPlanner | None = None, _utilities: Sequence[Utility] | None = None, _interface: QuantumInterface | None = None, _progress_bar: bool = False, _strict: bool = False, _save_planner: bool = False) None
__repr__()

Return repr(self).

__setattr__(name, value)

Implement setattr(self, name, value).

build(package: Package, n_qubits: int) EmulatorInstance[source]

Build an EmulatorInstance from a compiled package.

Args:

package: The compiled HUGR package to build the emulator from. n_qubits: The number of qubits to allocate for the emulator instance.

Returns:

An EmulatorInstance that can be used to run the compiled program.

property build_dir: Path | None

Directory to store intermediate build files and execution results. Defaults to None, in which case a temporary directory is used.

property name: str | None

User specified name for the emulator instance. Defaults to None.

property verbose: bool

Whether to print verbose output during the build process.

with_build_dir(value: Path | None) Self[source]

Set the build directory for the emulator instance, see EmulatorBuilder.build_dir.

with_name(value: str | None) Self[source]

Set the name for the emulator instance.

with_verbose(value: bool) Self[source]

Set whether to print verbose output during the build process.