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
2 changes: 1 addition & 1 deletion Build/props/tests.props
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
</PropertyGroup>

<ItemGroup>
<PackageReference Include="Microsoft.Quantum.Xunit" Version="0.10.2001.2831" />
<PackageReference Include="Microsoft.Quantum.Xunit" Version="0.12.20072301-beta" />
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="16.4.0" />
<PackageReference Include="xunit" Version="2.4.1" />
<PackageReference Include="xunit.runner.visualstudio" Version="2.4.1" />
Expand Down
4 changes: 2 additions & 2 deletions Chemistry/src/Runtime/Runtime.csproj
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<Project Sdk="Microsoft.Quantum.Sdk/0.12.20062514-beta">
<Project Sdk="Microsoft.Quantum.Sdk/0.12.20072301-beta">

<PropertyGroup>
<TargetFramework>netstandard2.1</TargetFramework>
Expand Down Expand Up @@ -36,7 +36,7 @@
</ItemGroup>

<ItemGroup>
<PackageReference Include="Microsoft.Quantum.Simulators" Version="0.12.20062514-beta" />
<PackageReference Include="Microsoft.Quantum.Simulators" Version="0.12.20072301-beta" />
</ItemGroup>

<ItemGroup>
Expand Down
2 changes: 1 addition & 1 deletion Chemistry/tests/ChemistryTests/QSharpTests.csproj
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<Project Sdk="Microsoft.Quantum.Sdk/0.12.20062514-beta">
<Project Sdk="Microsoft.Quantum.Sdk/0.12.20072301-beta">

<Import Project="..\..\..\Build\props\tests.props" />

Expand Down
2 changes: 1 addition & 1 deletion Chemistry/tests/SystemTests/SystemTests.csproj
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<Project Sdk="Microsoft.Quantum.Sdk/0.12.20062514-beta">
<Project Sdk="Microsoft.Quantum.Sdk/0.12.20072301-beta">

<Import Project="..\..\..\Build\props\tests.props" />

Expand Down
2 changes: 1 addition & 1 deletion MachineLearning/src/MachineLearning.csproj
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<Project Sdk="Microsoft.Quantum.Sdk/0.12.20062514-beta">
<Project Sdk="Microsoft.Quantum.Sdk/0.12.20072301-beta">
<PropertyGroup>
<TargetFramework>netstandard2.1</TargetFramework>
<AssemblyName>Microsoft.Quantum.MachineLearning</AssemblyName>
Expand Down
2 changes: 1 addition & 1 deletion MachineLearning/tests/MachineLearningTests.csproj
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<Project Sdk="Microsoft.Quantum.Sdk/0.12.20062514-beta">
<Project Sdk="Microsoft.Quantum.Sdk/0.12.20072301-beta">

<Import Project="..\..\Build\props\tests.props" />

Expand Down
4 changes: 2 additions & 2 deletions Numerics/src/Numerics.csproj
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<Project Sdk="Microsoft.Quantum.Sdk/0.12.20062514-beta">
<Project Sdk="Microsoft.Quantum.Sdk/0.12.20072301-beta">

<PropertyGroup>
<TargetFramework>netstandard2.1</TargetFramework>
Expand Down Expand Up @@ -40,7 +40,7 @@
</ItemGroup>

<ItemGroup>
<PackageReference Include="Microsoft.Quantum.Simulators" Version="0.12.20062514-beta" />
<PackageReference Include="Microsoft.Quantum.Simulators" Version="0.12.20072301-beta" />
<PackageReference Include="Microsoft.SourceLink.GitHub" Version="1.0.0" PrivateAssets="All" />
</ItemGroup>

Expand Down
2 changes: 1 addition & 1 deletion Numerics/tests/NumericsTests.csproj
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<Project Sdk="Microsoft.Quantum.Sdk/0.12.20062514-beta">
<Project Sdk="Microsoft.Quantum.Sdk/0.12.20072301-beta">

<Import Project="..\..\Build\props\tests.props" />

Expand Down
19 changes: 19 additions & 0 deletions Standard/src/Arrays/ForEach.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
// Copyright (c) Microsoft Corporation.
// Licensed under the MIT License.

using Microsoft.Quantum.Simulation.Core;
using System;

namespace Microsoft.Quantum.Arrays
{
public partial class ForEach<__T__, __U__>
{
public override RuntimeMetadata GetRuntimeMetadata(IApplyData args)
{
var metadata = base.GetRuntimeMetadata(args);
if (metadata == null) throw new NullReferenceException($"Null RuntimeMetadata found for {this.ToString()}.");
metadata.IsComposite = true;
return metadata;
}
}
}
52 changes: 52 additions & 0 deletions Standard/src/Canon/Combinators/ApplyToEach.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
// Copyright (c) Microsoft Corporation.
// Licensed under the MIT License.

using Microsoft.Quantum.Simulation.Core;
using System;

namespace Microsoft.Quantum.Canon
{
public partial class ApplyToEach<__T__>
{
public override RuntimeMetadata GetRuntimeMetadata(IApplyData args)
{
var metadata = base.GetRuntimeMetadata(args);
if (metadata == null) throw new NullReferenceException($"Null RuntimeMetadata found for {this.ToString()}.");
metadata.IsComposite = true;
return metadata;
}
}

public partial class ApplyToEachC<__T__>
{
public override RuntimeMetadata GetRuntimeMetadata(IApplyData args)
{
var metadata = base.GetRuntimeMetadata(args);
if (metadata == null) throw new NullReferenceException($"Null RuntimeMetadata found for {this.ToString()}.");
metadata.IsComposite = true;
return metadata;
}
}

public partial class ApplyToEachA<__T__>
{
public override RuntimeMetadata GetRuntimeMetadata(IApplyData args)
{
var metadata = base.GetRuntimeMetadata(args);
if (metadata == null) throw new NullReferenceException($"Null RuntimeMetadata found for {this.ToString()}.");
metadata.IsComposite = true;
return metadata;
}
}

public partial class ApplyToEachCA<__T__>
{
public override RuntimeMetadata GetRuntimeMetadata(IApplyData args)
{
var metadata = base.GetRuntimeMetadata(args);
if (metadata == null) throw new NullReferenceException($"Null RuntimeMetadata found for {this.ToString()}.");
metadata.IsComposite = true;
return metadata;
}
}
}
4 changes: 2 additions & 2 deletions Standard/src/Standard.csproj
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<Project Sdk="Microsoft.Quantum.Sdk/0.12.20062514-beta">
<Project Sdk="Microsoft.Quantum.Sdk/0.12.20072301-beta">

<PropertyGroup>
<TargetFramework>netstandard2.1</TargetFramework>
Expand Down Expand Up @@ -30,7 +30,7 @@
</ItemGroup>

<ItemGroup>
<PackageReference Include="Microsoft.Quantum.Simulators" Version="0.12.20062514-beta" />
<PackageReference Include="Microsoft.Quantum.Simulators" Version="0.12.20072301-beta" />
<PackageReference Include="Microsoft.SourceLink.GitHub" Version="1.0.0" PrivateAssets="All" />
</ItemGroup>

Expand Down
36 changes: 36 additions & 0 deletions Standard/tests/Arrays/MapTests.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License.


using Microsoft.Quantum.Simulation.Core;
using Microsoft.Quantum.Simulation.Simulators;
using Microsoft.Quantum.Simulation.XUnit;
using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.Security.Cryptography;
using System.Text;
using Xunit;

namespace Microsoft.Quantum.Tests
{
public class ForEachRuntimeMetadataTests
{
[Fact]
public void ForEach()
{
var op = new Microsoft.Quantum.Arrays.ForEach<Qubit, Result>(new QuantumSimulator());
var baseOp = new Microsoft.Quantum.Intrinsic.M(new QuantumSimulator());
IQArray<Qubit> targets = new QArray<Qubit>(new Qubit[] { });
var args = op.__dataIn((baseOp, targets));
var expected = new RuntimeMetadata()
{
Label = "ForEach",
FormattedNonQubitArgs = "(M)",
IsComposite = true,
Targets = new List<Qubit>() { },
};
Assert.Equal(expected, op.GetRuntimeMetadata(args));
}
}
}
87 changes: 87 additions & 0 deletions Standard/tests/Canon/ApplyToEachTests.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,87 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License.


using Microsoft.Quantum.Simulation.Core;
using Microsoft.Quantum.Simulation.Simulators;
using Microsoft.Quantum.Simulation.XUnit;
using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.Security.Cryptography;
using System.Text;
using Xunit;

namespace Microsoft.Quantum.Tests
{
public class ApplyToEachRuntimeMetadataTests
{
[Fact]
public void ApplyToEach()
{
var op = new Microsoft.Quantum.Canon.ApplyToEach<Qubit>(new QuantumSimulator());
var baseOp = new Microsoft.Quantum.Intrinsic.I(new QuantumSimulator());
IQArray<Qubit> targets = new QArray<Qubit>(new Qubit[] { });
var args = op.__dataIn((baseOp, targets));
var expected = new RuntimeMetadata()
{
Label = "ApplyToEach",
FormattedNonQubitArgs = "(I)",
IsComposite = true,
Targets = new List<Qubit>() { },
};
Assert.Equal(expected, op.GetRuntimeMetadata(args));
}

[Fact]
public void ApplyToEachC()
{
var op = new Microsoft.Quantum.Canon.ApplyToEachC<Qubit>(new QuantumSimulator());
var baseOp = new Microsoft.Quantum.Intrinsic.I(new QuantumSimulator());
IQArray<Qubit> targets = new QArray<Qubit>(new Qubit[] { });
var args = op.__dataIn((baseOp, targets));
var expected = new RuntimeMetadata()
{
Label = "ApplyToEachC",
FormattedNonQubitArgs = "(I)",
IsComposite = true,
Targets = new List<Qubit>() { },
};
Assert.Equal(expected, op.GetRuntimeMetadata(args));
}

[Fact]
public void ApplyToEachA()
{
var op = new Microsoft.Quantum.Canon.ApplyToEachA<Qubit>(new QuantumSimulator());
var baseOp = new Microsoft.Quantum.Intrinsic.I(new QuantumSimulator());
IQArray<Qubit> targets = new QArray<Qubit>(new Qubit[] { });
var args = op.__dataIn((baseOp, targets));
var expected = new RuntimeMetadata()
{
Label = "ApplyToEachA",
FormattedNonQubitArgs = "(I)",
IsComposite = true,
Targets = new List<Qubit>() { },
};
Assert.Equal(expected, op.GetRuntimeMetadata(args));
}

[Fact]
public void ApplyToEachCA()
{
var op = new Microsoft.Quantum.Canon.ApplyToEachCA<Qubit>(new QuantumSimulator());
var baseOp = new Microsoft.Quantum.Intrinsic.I(new QuantumSimulator());
IQArray<Qubit> targets = new QArray<Qubit>(new Qubit[] { });
var args = op.__dataIn((baseOp, targets));
var expected = new RuntimeMetadata()
{
Label = "ApplyToEachCA",
FormattedNonQubitArgs = "(I)",
IsComposite = true,
Targets = new List<Qubit>() { },
};
Assert.Equal(expected, op.GetRuntimeMetadata(args));
}
}
}
2 changes: 1 addition & 1 deletion Standard/tests/Standard.Tests.csproj
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<Project Sdk="Microsoft.Quantum.Sdk/0.12.20062514-beta">
<Project Sdk="Microsoft.Quantum.Sdk/0.12.20072301-beta">

<Import Project="..\..\Build\props\tests.props" />

Expand Down