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
56 changes: 56 additions & 0 deletions src/Simulation/Core/EntryPointInfo.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License.

using System;

namespace Microsoft.Quantum.Simulation.Core
{
/// <summary>
/// Base class containing information about a Q# entry point.
/// </summary>
public class EntryPointInfo<I, O>
{
public Type Operation { get; }
public Type InType => typeof(I);
public Type OutType => typeof(O);

public EntryPointInfo(Type operation) =>
this.Operation = operation;
}

/// <summary>
/// Base class containing information about an entry point
/// for a Q# executable targeted for a Alfred quantum processor.
/// </summary>
public class AlfredEntryPointInfo<I, O>
: EntryPointInfo<I, O>
{
public AlfredEntryPointInfo(Type operation)
: base(operation)
{ }
}

/// <summary>
/// Base class containing information about an entry point
/// for a Q# executable targeted for a Bruno quantum processor.
/// </summary>
public class BrunoEntryPointInfo<I, O>
: EntryPointInfo<I, O>
{
public BrunoEntryPointInfo(Type operation)
: base(operation)
{ }
}

/// <summary>
/// Base class containing information about an entry point
/// for a Q# executable targeted for a Clementine quantum processor.
/// </summary>
public class ClementineEntryPointInfo<I, O>
: EntryPointInfo<I, O>
{
public ClementineEntryPointInfo(Type operation)
: base(operation)
{ }
}
}
4 changes: 2 additions & 2 deletions src/Simulation/Core/IQuantumMachine.cs
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ public interface IQuantumMachine<TJob, TRawResult>
/// <typeparam name="TInput">Type of input the quantum program receives.</typeparam>
/// <typeparam name="TOutput">Type of output the quantum program returns.</typeparam>
/// <returns>Sampled output of the quantum program</returns>
Task<Tuple<TOutput, TRawResult>> ExecuteAsync<TInput, TOutput>(OperationInfo<TInput, TOutput> info, TInput input);
Task<Tuple<TOutput, TRawResult>> ExecuteAsync<TInput, TOutput>(EntryPointInfo<TInput, TOutput> info, TInput input);

/// <summary>
/// Submits a job to execute a Q# program.
Expand All @@ -47,6 +47,6 @@ public interface IQuantumMachine<TJob, TRawResult>
/// <typeparam name="TInput">Type of input the quantum program receives.</typeparam>
/// <typeparam name="TOutput">Type of output the quantum program returns.</typeparam>
/// <returns>A Job instance. Status and results from the execution can be retrieved from this instance.</returns>
Task<TJob> SubmitAsync<TInput, TOutput>(OperationInfo<TInput, TOutput> info, TInput input);
Task<TJob> SubmitAsync<TInput, TOutput>(EntryPointInfo<TInput, TOutput> info, TInput input);
}
}
21 changes: 0 additions & 21 deletions src/Simulation/Core/OperationInfo.cs

This file was deleted.

Loading