Replies: 2 comments 9 replies
-
A possible concern with
|
Beta Was this translation helpful? Give feedback.
-
Something I'd really like to know is what a more usable interface to this might be. It seems equivalent to Here is the full list of params: def run_shots(
self,
simulator: Simulator,
n_qubits: int,
n_shots: int = 1,
error_model: ErrorModel = IdealErrorModel(),
runtime: Runtime = SimpleRuntime(),
event_hook: EventHook = NoEventHook(),
verbose: bool = False,
timeout: datetime.timedelta | None = None,
results_logfile: Path | None = None,
random_seed: int | None = None,
shot_offset: int = 0,
shot_increment: int = 1,
n_processes: int = 1,
) -> Iterator[Iterator[TaggedResult]]: There's even one more argument to be added, and already available in 0.1 (internal), that determines whether event hooks are processed via selene or simply kept in the result stream. Put simply - it's a flexible interface but insufficiently structured, and is starting to remind me of another python function that is so highly configurable that it trips me up every time I use it. One thing I have been considering is abstracting it with emulation usecases, e.g. def coinflip(...)
def classical_replay(...)
# ... where the simulator args and some other things are pre-baked in (e.g. classical replay should have no error model). Perhaps from the guppy side of things you have some solid usecases in mind and a top-down approach could be beneficial - forget the selene interface and consider what the perfect interface to those usecases might be, then find a way to connect that to selene. Then, over time, we can look at the structure that has emerged and see if Selene itself would benefit from adopting it (I hope this to be the case). Stick with a run_shots-like interface and it might make implementation of abstractions in selene a bit more sticky. |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
Now that Selene is open source it gives us an oppurtunity to include Selene as an optional extra when installing Guppy. We can also bind Selene and have a nice interface for Selene as part of Guppy.
Benefits
build
needed) -> https://github.com/quantinuum-dev/selene/issues/149Selene as an optional extra for Guppy
Alternatives
pip install guppylang[selene]
,pip install guppy[emulator]
Initial syntax ideas
guppy.build_executable
would build an object file from a hugr (just likebuild
in selene.Its probably also worth having a method that builds an object file from guppy source (skipping the hugr step).
We could have
guppy.compile_executable
or something for this? Although thats possibly confusing if we already havebuild_executable
as well forhugr -> selene executable
.Open to better syntax ideas. These are just initial suggestions.
Beta Was this translation helpful? Give feedback.
All reactions