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
45 changes: 36 additions & 9 deletions Build/manifest.ps1
Original file line number Diff line number Diff line change
@@ -1,23 +1,50 @@
#!/usr/bin/env pwsh
#Requires -PSEdition Core
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License.

<#
.SYNOPSIS
Provides the list of artifacts (Packages and Assemblies) generated by this repository.

.PARAMETER OutputFormat
Specifies if the output of this script should be a hashtable with the artifacts
as strings with the absolute path (AbsolutePath) or FileInfo structures.
#>
param(
[ValidateSet('FileInfo','AbsolutePath')]
[string] $OutputFormat = 'FileInfo'
);


& "$PSScriptRoot/set-env.ps1"

@{
$artifacts = @{
Packages = @(
"Microsoft.Quantum.Standard",
"Microsoft.Quantum.Standard.Visualization",
"Microsoft.Quantum.Chemistry",
"Microsoft.Quantum.Chemistry.DataModel",
"Microsoft.Quantum.Chemistry.Jupyter",
"Microsoft.Quantum.Chemistry.Runtime",
"Microsoft.Quantum.Chemistry.Tools",
"Microsoft.Quantum.MachineLearning",
"Microsoft.Quantum.Numerics",
"Microsoft.Quantum.MachineLearning"
);
"Microsoft.Quantum.Standard",
"Microsoft.Quantum.Standard.Visualization"
) | ForEach-Object { Join-Path $Env:NUGET_OUTDIR "$_.$Env:NUGET_VERSION.nupkg" };

Assemblies = @(
".\Standard\src\bin\$Env:BUILD_CONFIGURATION\netstandard2.1\Microsoft.Quantum.Standard.dll",
".\Visualization\src\bin\$Env:BUILD_CONFIGURATION\netstandard2.1\Microsoft.Quantum.Standard.Visualization.dll",
".\Numerics\src\bin\$Env:BUILD_CONFIGURATION\netstandard2.1\Microsoft.Quantum.Numerics.dll",
".\MachineLearning\src\bin\$Env:BUILD_CONFIGURATION\netstandard2.1\Microsoft.Quantum.MachineLearning.dll",
".\Chemistry\src\DataModel\bin\$Env:BUILD_CONFIGURATION\netstandard2.1\Microsoft.Quantum.Chemistry.DataModel.dll",
".\Chemistry\src\Jupyter\bin\$Env:BUILD_CONFIGURATION\netstandard2.1\Microsoft.Quantum.Chemistry.Jupyter.dll",
".\Chemistry\src\Runtime\bin\$Env:BUILD_CONFIGURATION\netstandard2.1\Microsoft.Quantum.Chemistry.Runtime.dll",
".\Chemistry\src\Tools\bin\$Env:BUILD_CONFIGURATION\netcoreapp3.1\qdk-chem.dll"
) | ForEach-Object { Get-Item (Join-Path $PSScriptRoot ".." $_) };
} | Write-Output;
) | ForEach-Object { Join-Path $PSScriptRoot (Join-Path ".." $_) };
}

if ($OutputFormat -eq 'FileInfo') {
$artifacts.Packages = $artifacts.Packages | ForEach-Object { Get-Item $_ };
$artifacts.Assemblies = $artifacts.Assemblies | ForEach-Object { Get-Item $_ };
}

$artifacts | Write-Output;
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.12.20102008-beta" />
<PackageReference Include="Microsoft.Quantum.Xunit" Version="0.13.201118141-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
6 changes: 6 additions & 0 deletions Build/steps.yml
Original file line number Diff line number Diff line change
Expand Up @@ -36,4 +36,10 @@ steps:
workingDirectory: $(System.DefaultWorkingDirectory)/Build


- pwsh: .\manifest.ps1
displayName: "List built packages & assemblies"
workingDirectory: '$(System.DefaultWorkingDirectory)/Build'
condition: succeededOrFailed()


- template: step-wrap-up.yml
4 changes: 4 additions & 0 deletions Chemistry/src/Jupyter/Jupyter.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,10 @@
<PackageReference Include="Newtonsoft.Json" Version="12.0.3" />
</ItemGroup>

<ItemGroup>
<Compile Include="..\..\Common\DelaySign.cs" Link="Properties\DelaySign.cs" />
</ItemGroup>

<ItemGroup>
<None Include="..\..\..\Build\assets\qdk-nuget-icon.png" Pack="true" Visible="false" PackagePath="" />
</ItemGroup>
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.20102008-beta">
<Project Sdk="Microsoft.Quantum.Sdk/0.13.201118141-beta">

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

<ItemGroup>
<PackageReference Include="Microsoft.Quantum.Simulators" Version="0.12.20102008-beta" />
<PackageReference Include="Microsoft.Quantum.Simulators" Version="0.13.201118141-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.20102008-beta">
<Project Sdk="Microsoft.Quantum.Sdk/0.13.201118141-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.20102008-beta">
<Project Sdk="Microsoft.Quantum.Sdk/0.13.201118141-beta">

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

Expand Down
31 changes: 24 additions & 7 deletions MachineLearning.sln
Original file line number Diff line number Diff line change
@@ -1,13 +1,15 @@

Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio 15
VisualStudioVersion = 15.0.26124.0
# Visual Studio Version 16
VisualStudioVersion = 16.0.30413.136
MinimumVisualStudioVersion = 15.0.26124.0
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "MachineLearning", "MachineLearning", "{D067C787-94C3-4DB8-9012-1F22AE784BEF}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "MachineLearningTests", "MachineLearning\tests\MachineLearningTests.csproj", "{94EBDF5F-0A9D-4CE5-9D16-3FF323B8792C}"
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "MachineLearningTests", "MachineLearning\tests\MachineLearningTests.csproj", "{94EBDF5F-0A9D-4CE5-9D16-3FF323B8792C}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "MachineLearning", "MachineLearning\src\MachineLearning.csproj", "{B045BF35-6BE6-4982-9618-8725C70D3F91}"
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "MachineLearning", "MachineLearning\src\MachineLearning.csproj", "{B045BF35-6BE6-4982-9618-8725C70D3F91}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Standard", "Standard\src\Standard.csproj", "{9907AAA7-10DA-470B-A154-5A19D1A831E6}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Expand All @@ -18,9 +20,6 @@ Global
Release|x64 = Release|x64
Release|x86 = Release|x86
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
{94EBDF5F-0A9D-4CE5-9D16-3FF323B8792C}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{94EBDF5F-0A9D-4CE5-9D16-3FF323B8792C}.Debug|Any CPU.Build.0 = Debug|Any CPU
Expand All @@ -46,9 +45,27 @@ Global
{B045BF35-6BE6-4982-9618-8725C70D3F91}.Release|x64.Build.0 = Release|Any CPU
{B045BF35-6BE6-4982-9618-8725C70D3F91}.Release|x86.ActiveCfg = Release|Any CPU
{B045BF35-6BE6-4982-9618-8725C70D3F91}.Release|x86.Build.0 = Release|Any CPU
{9907AAA7-10DA-470B-A154-5A19D1A831E6}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{9907AAA7-10DA-470B-A154-5A19D1A831E6}.Debug|Any CPU.Build.0 = Debug|Any CPU
{9907AAA7-10DA-470B-A154-5A19D1A831E6}.Debug|x64.ActiveCfg = Debug|Any CPU
{9907AAA7-10DA-470B-A154-5A19D1A831E6}.Debug|x64.Build.0 = Debug|Any CPU
{9907AAA7-10DA-470B-A154-5A19D1A831E6}.Debug|x86.ActiveCfg = Debug|Any CPU
{9907AAA7-10DA-470B-A154-5A19D1A831E6}.Debug|x86.Build.0 = Debug|Any CPU
{9907AAA7-10DA-470B-A154-5A19D1A831E6}.Release|Any CPU.ActiveCfg = Release|Any CPU
{9907AAA7-10DA-470B-A154-5A19D1A831E6}.Release|Any CPU.Build.0 = Release|Any CPU
{9907AAA7-10DA-470B-A154-5A19D1A831E6}.Release|x64.ActiveCfg = Release|Any CPU
{9907AAA7-10DA-470B-A154-5A19D1A831E6}.Release|x64.Build.0 = Release|Any CPU
{9907AAA7-10DA-470B-A154-5A19D1A831E6}.Release|x86.ActiveCfg = Release|Any CPU
{9907AAA7-10DA-470B-A154-5A19D1A831E6}.Release|x86.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
EndGlobalSection
GlobalSection(NestedProjects) = preSolution
{94EBDF5F-0A9D-4CE5-9D16-3FF323B8792C} = {D067C787-94C3-4DB8-9012-1F22AE784BEF}
{B045BF35-6BE6-4982-9618-8725C70D3F91} = {D067C787-94C3-4DB8-9012-1F22AE784BEF}
EndGlobalSection
GlobalSection(ExtensibilityGlobals) = postSolution
SolutionGuid = {08B056E4-F7DA-4802-B23C-BB11D6616F5E}
EndGlobalSection
EndGlobal
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.20102008-beta">
<Project Sdk="Microsoft.Quantum.Sdk/0.13.201118141-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.20102008-beta">
<Project Sdk="Microsoft.Quantum.Sdk/0.13.201118141-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.20102008-beta">
<Project Sdk="Microsoft.Quantum.Sdk/0.13.201118141-beta">

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

<ItemGroup>
<PackageReference Include="Microsoft.Quantum.Simulators" Version="0.12.20102008-beta" />
<PackageReference Include="Microsoft.Quantum.Simulators" Version="0.13.201118141-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.20102008-beta">
<Project Sdk="Microsoft.Quantum.Sdk/0.13.201118141-beta">

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

Expand Down
14 changes: 7 additions & 7 deletions Standard/src/Diagnostics/Emulation/AllowQubitAllocations.cs
Original file line number Diff line number Diff line change
Expand Up @@ -51,17 +51,17 @@ public Native(IOperationFactory m) : base(m)
);
}
},
setup: handler => Simulator.OnAllocateQubits += handler,
cleanup: handler => Simulator.OnAllocateQubits -= handler
setup: handler => Simulator.BeforeAllocateQubits += handler,
cleanup: handler => Simulator.BeforeAllocateQubits -= handler
),

new ActionDisposer<Action<IQArray<Qubit>>>(
register =>
new ActionDisposer<Action<long>>(
nQubits =>
{
nQubitsAllocated -= register.Length;
nQubitsAllocated -= nQubits;
},
setup: handler => Simulator.OnReleaseQubits += handler,
cleanup: handler => Simulator.OnReleaseQubits -= handler
setup: handler => Simulator.AfterReleaseQubits += handler,
cleanup: handler => Simulator.AfterReleaseQubits -= handler
)
));

Expand Down
2 changes: 1 addition & 1 deletion Standard/src/Diagnostics/Emulation/Internal.cs
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ public override bool Callback(uint idx, double real, double img)

public override bool Dump(IQArray<Qubit>? qubits = null)
{
var count = qubits?.Length ?? Simulator.QubitManager!.GetAllocatedQubitsCount();
var count = qubits?.Length ?? Simulator.QubitManager!.AllocatedQubitsCount;
var nQubitsPerRegister = ((int)count / 2);
Data = np.empty(new Shape(1 << ((int)count), 2));
var result = base.Dump(qubits);
Expand Down
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.20102008-beta">
<Project Sdk="Microsoft.Quantum.Sdk/0.13.201118141-beta">

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

<ItemGroup>
<PackageReference Include="Microsoft.Quantum.Simulators" Version="0.12.20102008-beta" />
<PackageReference Include="Microsoft.Quantum.Simulators" Version="0.13.201118141-beta" />
<PackageReference Include="Microsoft.SourceLink.GitHub" Version="1.0.0" PrivateAssets="All" />
<PackageReference Include="NumSharp" Version="0.20.5" />
</ItemGroup>
Expand Down
11 changes: 6 additions & 5 deletions Standard/tests/AmplitudeAmplificationTests.qs
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,8 @@ namespace Microsoft.Quantum.Tests {
/// In this minimal example, there are no system qubits, only a single flag qubit.
/// ExampleStatePrep is already of type StateOracle, so we call
/// StandardAmplitudeAmplification(iterations: Int, stateOracle : StateOracle, idxFlagQubit : Int startQubits: Qubit[]) : ()
operation AmpAmpByOracleTest () : Unit {
@Test("QuantumSimulator")
operation CheckAmpAmpByOracle () : Unit {

using (qubits = Qubit[1]) {
ResetAll(qubits);
Expand All @@ -54,8 +55,8 @@ namespace Microsoft.Quantum.Tests {
}
}


operation AmpAmpObliviousByOraclePhasesTest () : Unit {
@Test("QuantumSimulator")
operation CheckAmpAmpObliviousByOraclePhases () : Unit {

using (qubits = Qubit[1]) {
ResetAll(qubits);
Expand All @@ -80,8 +81,8 @@ namespace Microsoft.Quantum.Tests {
}
}


operation AmpAmpTargetStateReflectionOracleTest () : Unit {
@Test("QuantumSimulator")
operation CheckAmpAmpTargetStateReflectionOracle () : Unit {

using (qubits = Qubit[1]) {
ResetAll(qubits);
Expand Down
3 changes: 2 additions & 1 deletion Standard/tests/ApplyMultiControlledTests.qs
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,8 @@ namespace Microsoft.Quantum.Tests {
/// Tests multiply controlled not implementation that uses
/// ApplyMultiControlledCA against multiply controlled version of
/// the Microsoft.Quantum.Intrinsic.X
operation ApplyMultiControlledTest () : Unit {
@Test("QuantumSimulator")
operation CheckApplyMultiControlled() : Unit {

let twoQubitOp = CNOT;

Expand Down
10 changes: 6 additions & 4 deletions Standard/tests/ApplyRepeatedOverTests.qs
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@ namespace Microsoft.Quantum.Tests {
open Microsoft.Quantum.Diagnostics;
open Microsoft.Quantum.Arrays;


operation ApplySeriesOfOpsTest() : Unit {
@Test("QuantumSimulator")
operation CheckApplySeriesOfOps() : Unit {
// create the sample ops + their targets here
let op1 = ApplyToFirstQubit(X, _);
let op2 = ApplyToFirstTwoQubits(CNOT, _);
Expand All @@ -34,7 +34,8 @@ namespace Microsoft.Quantum.Tests {
ApplyToEachCA(H, Subarray([1, 2, 3, 4], register));
}

operation ApplyRepeatedOpTest() : Unit {
@Test("QuantumSimulator")
operation CheckApplyRepeatedOp() : Unit {
let op = ApplyToFirstThreeQubits(CCNOT, _);
let targets = [[0, 1, 2], [2, 1, 0], [3, 4, 5], [2, 4, 0], [5, 3, 1]];
AssertOperationsEqualReferenced(6, ApplyOpRepeatedlyOver(op, targets, _), SampleApplyRepeatedOp(_));
Expand All @@ -49,7 +50,8 @@ namespace Microsoft.Quantum.Tests {
CCNOT(register[5], register[3], register[1]);
}

operation PermuteQubitsTest() : Unit {
@Test("QuantumSimulator")
operation CheckPermuteQubits() : Unit {
let sampleOrder = [5, 3, 2, 0, 1, 4];
AssertOperationsEqualReferenced(6, PermuteQubits(sampleOrder, _) , SamplePermuteQubits);
}
Expand Down
3 changes: 2 additions & 1 deletion Standard/tests/Arithmetic/ReflectionTests.qs
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,8 @@ namespace Microsoft.Quantum.Tests {
ReflectAboutInteger(5, littleEndian);
}

operation ReflectAboutIntegerTest() : Unit {
@Test("QuantumSimulator")
operation CheckReflectAboutInteger() : Unit {
AssertOperationsEqualReferenced(3,
ReflectAboutFiveUsingLibrary,
ManuallyReflectAboutFive
Expand Down
14 changes: 7 additions & 7 deletions Standard/tests/ArithmeticTests.qs
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,9 @@ namespace Microsoft.Quantum.ArithmeticTests {
}
}


operation ApplyXorInPlaceTest () : Unit {
@Test("QuantumSimulator")
operation CheckApplyXorInPlace() : Unit {

ApplyToEach(InPlaceXorTestHelper, [(63, 6), (42, 6)]);
}

Expand All @@ -42,7 +42,7 @@ namespace Microsoft.Quantum.ArithmeticTests {
/// Exhaustively tests Microsoft.Quantum.Artihmetic.IncrementByInteger
/// on 4 qubits
@Test("QuantumSimulator")
operation IncrementByIntegerTest () : Unit {
operation CheckIncrementByInteger() : Unit {

let numberOfQubits = 4;

Expand Down Expand Up @@ -86,7 +86,7 @@ namespace Microsoft.Quantum.ArithmeticTests {
/// Tests Microsoft.Quantum.Arithmetic.IncrementByModularInteger
/// on 4 qubits with modulus 13
@Test("QuantumSimulator")
operation IncrementByModularIntegerTest () : Unit {
operation CheckIncrementByModularInteger() : Unit {

let numberOfQubits = 4;
let modulus = 13;
Expand Down Expand Up @@ -122,7 +122,7 @@ namespace Microsoft.Quantum.ArithmeticTests {
/// Tests Microsoft.Quantum.Canon.ModularAddProductLE
/// on 4 qubits with modulus 13
@Test("QuantumSimulator")
operation MultiplyAndAddByModularIntegerTest () : Unit {
operation CheckMultiplyAndAddByModularInteger() : Unit {

let numberOfQubits = 4;
let modulus = 13;
Expand Down Expand Up @@ -160,7 +160,7 @@ namespace Microsoft.Quantum.ArithmeticTests {
/// Tests Microsoft.Quantum.Canon.ModularMultiplyByConstantLE
/// on 4 qubits with modulus 13
@Test("QuantumSimulator")
operation MultiplyByModularIntegerTest () : Unit {
operation CheckMultiplyByModularInteger() : Unit {

let numberOfQubits = 4;
let modulus = 13;
Expand Down
Loading