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
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,9 @@ bld/
# Uncomment if you have tasks that create the project's static files in wwwroot
#wwwroot/

# Visual Studio Code Ionide-FSharp extension cache directory
.ionide/

# Visual Studio 2017 auto generated files
Generated\ Files/

Expand Down
18 changes: 9 additions & 9 deletions src/Simulation/Core/EntryPointInfo.cs
Original file line number Diff line number Diff line change
Expand Up @@ -20,36 +20,36 @@ public EntryPointInfo(Type operation) =>

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

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

/// <summary>
/// Base class containing information about an entry point
/// for a Q# executable targeted for a Clementine quantum processor.
/// for a Q# executable targeted for a QCI quantum processor.
/// </summary>
public class ClementineEntryPointInfo<I, O>
public class QCIEntryPointInfo<I, O>
: EntryPointInfo<I, O>
{
public ClementineEntryPointInfo(Type operation)
public QCIEntryPointInfo(Type operation)
: base(operation)
{ }
}
Expand Down
24 changes: 12 additions & 12 deletions src/Simulation/CsharpGeneration.Tests/SimulationCodeTests.fs
Original file line number Diff line number Diff line change
Expand Up @@ -2328,7 +2328,7 @@ namespace N1
String ICallable.Name => "emptyOperation";
String ICallable.FullName => "Microsoft.Quantum.Testing.emptyOperation";

public static AlfredEntryPointInfo<QVoid, QVoid> Info => new AlfredEntryPointInfo<QVoid, QVoid>(typeof(emptyOperation));
public static HoneywellEntryPointInfo<QVoid, QVoid> Info => new HoneywellEntryPointInfo<QVoid, QVoid>(typeof(emptyOperation));

public override void Init() { }

Expand All @@ -2340,7 +2340,7 @@ namespace N1
}
}
"""
|> testOneClass emptyOperation AssemblyConstants.AlfredProcessor
|> testOneClass emptyOperation AssemblyConstants.HoneywellProcessor

"""
public abstract partial class randomAbstractOperation : Unitary<(Qubit,Basis,(Pauli,IQArray<IQArray<Double>>,Boolean),Int64)>, ICallable
Expand All @@ -2367,7 +2367,7 @@ namespace N1
String ICallable.Name => "randomAbstractOperation";
String ICallable.FullName => "Microsoft.Quantum.Testing.randomAbstractOperation";

public static BrunoEntryPointInfo<(Qubit, Basis, (Pauli, IQArray<IQArray<Double>>, Boolean), Int64), QVoid> Info => new BrunoEntryPointInfo<(Qubit, Basis, (Pauli, IQArray<IQArray<Double>>, Boolean), Int64), QVoid>(typeof(randomAbstractOperation));
public static IonQEntryPointInfo<(Qubit, Basis, (Pauli, IQArray<IQArray<Double>>, Boolean), Int64), QVoid> Info => new IonQEntryPointInfo<(Qubit, Basis, (Pauli, IQArray<IQArray<Double>>, Boolean), Int64), QVoid>(typeof(randomAbstractOperation));

public override void Init() { }

Expand All @@ -2379,7 +2379,7 @@ namespace N1
}
}
"""
|> testOneClass randomAbstractOperation AssemblyConstants.BrunoProcessor
|> testOneClass randomAbstractOperation AssemblyConstants.IonQProcessor

"""
[SourceLocation("%%%", OperationFunctor.Body, 108, 113)]
Expand All @@ -2395,7 +2395,7 @@ namespace N1
String ICallable.Name => "oneQubitOperation";
String ICallable.FullName => "Microsoft.Quantum.Testing.oneQubitOperation";

public static ClementineEntryPointInfo<Qubit, QVoid> Info => new ClementineEntryPointInfo<Qubit, QVoid>(typeof(oneQubitOperation));
public static QCIEntryPointInfo<Qubit, QVoid> Info => new QCIEntryPointInfo<Qubit, QVoid>(typeof(oneQubitOperation));

protected IUnitary<Qubit> X { get; set; }

Expand Down Expand Up @@ -2449,7 +2449,7 @@ namespace N1
}
}
"""
|> testOneClass oneQubitOperation AssemblyConstants.ClementineProcessor
|> testOneClass oneQubitOperation AssemblyConstants.QCIProcessor

[<Fact>]
let ``buildOperationClass - generics`` () =
Expand Down Expand Up @@ -2481,7 +2481,7 @@ namespace N1
String ICallable.Name => "genCtrl3";
String ICallable.FullName => "Microsoft.Quantum.Compiler.Generics.genCtrl3";

public static AlfredEntryPointInfo<(__X__, (Int64, (__Y__, __Z__), Result)), QVoid> Info => new AlfredEntryPointInfo<(__X__, (Int64, (__Y__, __Z__), Result)), QVoid>(typeof(genCtrl3<__X__,__Y__,__Z__>));
public static HoneywellEntryPointInfo<(__X__, (Int64, (__Y__, __Z__), Result)), QVoid> Info => new HoneywellEntryPointInfo<(__X__, (Int64, (__Y__, __Z__), Result)), QVoid>(typeof(genCtrl3<__X__,__Y__,__Z__>));

public override void Init() { }

Expand All @@ -2493,7 +2493,7 @@ namespace N1
}
}
"""
|> testOneClass genCtrl3 AssemblyConstants.AlfredProcessor
|> testOneClass genCtrl3 AssemblyConstants.HoneywellProcessor

"""
[SourceLocation("%%%", OperationFunctor.Body, 1266, 1272)]
Expand Down Expand Up @@ -2522,7 +2522,7 @@ namespace N1
String ICallable.Name => "composeImpl";
String ICallable.FullName => "Microsoft.Quantum.Compiler.Generics.composeImpl";

public static BrunoEntryPointInfo<(ICallable, ICallable, __B__), QVoid> Info => new BrunoEntryPointInfo<(ICallable, ICallable, __B__), QVoid>(typeof(composeImpl<__A__,__B__>));
public static IonQEntryPointInfo<(ICallable, ICallable, __B__), QVoid> Info => new IonQEntryPointInfo<(ICallable, ICallable, __B__), QVoid>(typeof(composeImpl<__A__,__B__>));

public override Func<(ICallable,ICallable,__B__), QVoid> Body => (__in__) =>
{
Expand All @@ -2542,7 +2542,7 @@ namespace N1
}
}
"""
|> testOneClass composeImpl AssemblyConstants.BrunoProcessor
|> testOneClass composeImpl AssemblyConstants.IonQProcessor

[<Fact>]
let ``buildOperationClass - abstract function`` () =
Expand All @@ -2556,7 +2556,7 @@ namespace N1
String ICallable.Name => "genF1";
String ICallable.FullName => "Microsoft.Quantum.Compiler.Generics.genF1";

public static ClementineEntryPointInfo<__A__, QVoid> Info => new ClementineEntryPointInfo<__A__, QVoid>(typeof(genF1<__A__>));
public static QCIEntryPointInfo<__A__, QVoid> Info => new QCIEntryPointInfo<__A__, QVoid>(typeof(genF1<__A__>));

public override void Init() { }

Expand All @@ -2568,7 +2568,7 @@ namespace N1
}
}
"""
|> testOneClass genF1 AssemblyConstants.ClementineProcessor
|> testOneClass genF1 AssemblyConstants.QCIProcessor

[<Fact>]
let ``buildOperationClass - access modifiers`` () =
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@

<ItemGroup>
<PackageReference Update="FSharp.Core" Version="4.7.0" />
<PackageReference Include="Microsoft.Quantum.Compiler" Version="0.10.2004.1717-alpha" />
<PackageReference Include="Microsoft.Quantum.Compiler" Version="0.10.2005.2604-alpha" />
</ItemGroup>

<ItemGroup>
Expand Down
2 changes: 1 addition & 1 deletion src/Simulation/CsharpGeneration/RewriteStep.fs
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ type Emitter() =
let context = CodegenContext.Create (compilation, step.AssemblyConstants)
let targetsQuantumProcessor =
match step.AssemblyConstants.TryGetValue AssemblyConstants.ExecutionTarget with
| true, target -> target = AssemblyConstants.AlfredProcessor || target = AssemblyConstants.BrunoProcessor || target = AssemblyConstants.ClementineProcessor
| true, target -> target = AssemblyConstants.HoneywellProcessor || target = AssemblyConstants.IonQProcessor || target = AssemblyConstants.QCIProcessor
| _ -> false

let allSources = GetSourceFiles.Apply compilation.Namespaces
Expand Down
6 changes: 3 additions & 3 deletions src/Simulation/CsharpGeneration/SimulationCode.fs
Original file line number Diff line number Diff line change
Expand Up @@ -932,9 +932,9 @@ module SimulationCode =
let buildOperationInfoProperty (globalContext:CodegenContext) operationInput operationOutput operationName =
let propertyType =
match globalContext.ExecutionTarget with
| target when target = AssemblyConstants.AlfredProcessor -> sprintf "AlfredEntryPointInfo<%s, %s>" operationInput operationOutput
| target when target = AssemblyConstants.BrunoProcessor -> sprintf "BrunoEntryPointInfo<%s, %s>" operationInput operationOutput
| target when target = AssemblyConstants.ClementineProcessor -> sprintf "ClementineEntryPointInfo<%s, %s>" operationInput operationOutput
| target when target = AssemblyConstants.HoneywellProcessor -> sprintf "HoneywellEntryPointInfo<%s, %s>" operationInput operationOutput
| target when target = AssemblyConstants.IonQProcessor -> sprintf "IonQEntryPointInfo<%s, %s>" operationInput operationOutput
| target when target = AssemblyConstants.QCIProcessor -> sprintf "QCIEntryPointInfo<%s, %s>" operationInput operationOutput
| _ -> sprintf "EntryPointInfo<%s, %s>" operationInput operationOutput
let operationType = simpleBase operationName
let newInstanceArgs = [``invoke`` (``ident`` "typeof") ``(`` [operationType.Type] ``)``]
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<Project Sdk="Microsoft.Quantum.Sdk/0.10.2004.1717-alpha">
<Project Sdk="Microsoft.Quantum.Sdk/0.10.2005.2604-alpha">

<Import Project="..\Common\AssemblyCommon.props" />
<Import Project="..\Common\Simulators.Dev.props" />
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<Project Sdk="Microsoft.Quantum.Sdk/0.10.2004.1717-alpha">
<Project Sdk="Microsoft.Quantum.Sdk/0.10.2005.2604-alpha">

<Import Project="..\Common\AssemblyCommon.props" />
<Import Project="..\Common\DebugSymbols.props" />
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<Project Sdk="Microsoft.Quantum.Sdk/0.10.2004.1717-alpha">
<Project Sdk="Microsoft.Quantum.Sdk/0.10.2005.2604-alpha">

<PropertyGroup>
<OutputType>Exe</OutputType>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<Project Sdk="Microsoft.Quantum.Sdk/0.10.2004.1717-alpha">
<Project Sdk="Microsoft.Quantum.Sdk/0.10.2005.2604-alpha">

<Import Project="..\Common\AssemblyCommon.props" />
<Import Project="..\Common\DebugSymbols.props" />
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<Project Sdk="Microsoft.Quantum.Sdk/0.10.2004.1717-alpha">
<Project Sdk="Microsoft.Quantum.Sdk/0.10.2005.2604-alpha">

<Import Project="..\Common\AssemblyCommon.props" />
<Import Project="..\Common\DebugSymbols.props" />
Expand Down