From 22d1b23d83bb3e5005cbf5db55808870ba85051a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?C=C3=A9sar=20Zaragoza=20Cort=C3=A9s?= Date: Mon, 12 Apr 2021 20:04:22 -0700 Subject: [PATCH] Create IQirMachine interface. --- src/Simulation/Core/IAzureMachine.cs | 28 ++++++++++++++++++ src/Simulation/Core/IQirMachine.cs | 43 ++++++++++++++++++++++++++++ 2 files changed, 71 insertions(+) create mode 100644 src/Simulation/Core/IAzureMachine.cs create mode 100644 src/Simulation/Core/IQirMachine.cs diff --git a/src/Simulation/Core/IAzureMachine.cs b/src/Simulation/Core/IAzureMachine.cs new file mode 100644 index 00000000000..c92f18290e4 --- /dev/null +++ b/src/Simulation/Core/IAzureMachine.cs @@ -0,0 +1,28 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +using System.Threading.Tasks; +using Microsoft.Quantum.Simulation.Core; + +namespace Microsoft.Quantum.Runtime +{ + public interface IAzureMachine + { + /// + /// Function that configures a job object before submission. + /// + public delegate void ConfigureJob(object job); + + /// + /// Gets the ID of the quantum machine provider. + /// + string ProviderId { get; } + + /// + /// Gets the name of the target quantum machine. + /// A provider may expose multiple targets that can be used to execute programs. + /// Users may select which target they would like to be used for execution. + /// + string Target { get; } + } +} diff --git a/src/Simulation/Core/IQirMachine.cs b/src/Simulation/Core/IQirMachine.cs new file mode 100644 index 00000000000..0a633dd5435 --- /dev/null +++ b/src/Simulation/Core/IQirMachine.cs @@ -0,0 +1,43 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +using System.Threading.Tasks; +using Microsoft.Quantum.Simulation.Core; + +namespace Microsoft.Quantum.Runtime +{ + public interface IQirMachine : IAzureMachine + { + /// + /// Submits a job to execute a Q# program. + /// Does not wait for execution to be completed. + /// + /// Information about the Q# program. + /// Input for the Q# program. + /// Input for the Q# program. + /// Type of input the quantum program receives. + /// Type of output the quantum program returns. + /// An object that implements the IQuantumMachineJob interface through which data about the job can be obtained. + Task SubmitAsync( + EntryPointInfo info, + TInput input, + byte[] qir) => SubmitAsync(info, input, qir, null); + + /// + /// Submits a job to execute a Q# program. + /// Does not wait for execution to be completed. + /// + /// Information about the Q# program. + /// Input for the Q# program. + /// Input for the Q# program. + /// Function that configures a job object before submission. + /// Type of input the quantum program receives. + /// Type of output the quantum program returns. + /// An object that implements the IQuantumMachineJob interface through which data about the job can be obtained. + Task SubmitAsync( + EntryPointInfo info, + TInput input, + byte[] qir, + ConfigureJob configureJobCallback); + } +}