Skip to content
This repository was archived by the owner on Jan 12, 2024. It is now read-only.
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
28 changes: 28 additions & 0 deletions src/Simulation/Core/IAzureMachine.cs
Original file line number Diff line number Diff line change
@@ -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
{
/// <summary>
/// Function that configures a job object before submission.
/// </summary>
public delegate void ConfigureJob(object job);

/// <summary>
/// Gets the ID of the quantum machine provider.
/// </summary>
string ProviderId { get; }

/// <summary>
/// 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.
/// </summary>
string Target { get; }
}
}
43 changes: 43 additions & 0 deletions src/Simulation/Core/IQirMachine.cs
Original file line number Diff line number Diff line change
@@ -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
{
/// <summary>
/// Submits a job to execute a Q# program.
/// Does not wait for execution to be completed.
/// </summary>
/// <param name="info">Information about the Q# program.</param>
/// <param name="input">Input for the Q# program.</param>
/// <param name="qir">Input for the Q# program.</param>
/// <typeparam name="TInput">Type of input the quantum program receives.</typeparam>
/// <typeparam name="TOutput">Type of output the quantum program returns.</typeparam>
/// <returns>An object that implements the IQuantumMachineJob interface through which data about the job can be obtained.</returns>
Task<IQuantumMachineJob> SubmitAsync<TInput, TOutput>(
EntryPointInfo<TInput, TOutput> info,
TInput input,
byte[] qir) => SubmitAsync(info, input, qir, null);

/// <summary>
/// Submits a job to execute a Q# program.
/// Does not wait for execution to be completed.
/// </summary>
/// <param name="info">Information about the Q# program.</param>
/// <param name="input">Input for the Q# program.</param>
/// <param name="qir">Input for the Q# program.</param>
/// <param name="configureJobCallback">Function that configures a job object before submission.</param>
/// <typeparam name="TInput">Type of input the quantum program receives.</typeparam>
/// <typeparam name="TOutput">Type of output the quantum program returns.</typeparam>
/// <returns>An object that implements the IQuantumMachineJob interface through which data about the job can be obtained.</returns>
Task<IQuantumMachineJob> SubmitAsync<TInput, TOutput>(
EntryPointInfo<TInput, TOutput> info,
TInput input,
byte[] qir,
ConfigureJob configureJobCallback);
}
}