From 494c7505fdbbe8b09e1afbfaccad095c4264d700 Mon Sep 17 00:00:00 2001 From: Christopher Granade Date: Wed, 24 Jun 2020 15:45:37 +0000 Subject: [PATCH 1/4] Move NoOp to qsharp-runtime. --- Standard/src/Canon/NoOp.qs | 45 -------------------------------------- 1 file changed, 45 deletions(-) delete mode 100644 Standard/src/Canon/NoOp.qs diff --git a/Standard/src/Canon/NoOp.qs b/Standard/src/Canon/NoOp.qs deleted file mode 100644 index caf53b0b508..00000000000 --- a/Standard/src/Canon/NoOp.qs +++ /dev/null @@ -1,45 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -namespace Microsoft.Quantum.Canon { - - /// # Summary - /// Performs the identity operation (no-op) on an argument. - /// - /// # Description - /// This operation takes a value of any type and does nothing to it. - /// This can be useful whenever an input of an operation type is expected, - /// but no action should be taken. - /// For instance, if a particular error correction syndrome indicates that - /// no error has occurred, `NoOp` may be the correct recovery - /// procedure. - /// Similarly, if an operation expects a state preparation procedure as - /// input, `NoOp` can be used to prepare the state - /// $\ket{0 \cdots 0}$. - /// - /// # Input - /// ## input - /// A value to be ignored. - /// - /// # Remarks - /// In almost all cases, the type parameter for `NoOp` needs to be specified - /// explicitly. For instance, `NoOp` is identical to - /// . - /// - /// # See Also - /// - Microsoft.Quantum.Intrinsic.I - operation NoOp<'T>(input : 'T) : Unit is Adj + Ctl { - } - - - /// # Summary - /// Ignores the output of an operation or function. - /// - /// # Input - /// ## value - /// A value to be ignored. - function Ignore<'T> (value : 'T) : Unit { - return (); - } - -} From 66f0d128e7cad58a283be18c95be9f99e0d7349d Mon Sep 17 00:00:00 2001 From: Christopher Granade Date: Wed, 24 Jun 2020 16:55:27 +0000 Subject: [PATCH 2/4] Guard against deprecation stub being missing. --- Standard/src/Characterization/EstimateFrequency.cs | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/Standard/src/Characterization/EstimateFrequency.cs b/Standard/src/Characterization/EstimateFrequency.cs index 75cec3ee6ec..b3863060d36 100644 --- a/Standard/src/Characterization/EstimateFrequency.cs +++ b/Standard/src/Characterization/EstimateFrequency.cs @@ -161,7 +161,9 @@ private static Pauli[] FindPaulis(ICallable measure, long count) public virtual bool CanEmulate(IAdjointable preparation, ICallable measure) => this.Simulator != null && (preparation.Qubits == null || !preparation.Qubits.Where(q => q != null).Any()) && - (measure.FullName == typeof(Primitive.Measure).FullName || measure.FullName == typeof(Intrinsic.Measure).FullName || measure.FullName == typeof(MeasureAllZ).FullName); + // NB: the "Primitive" deprecation stub has been removed, so we check against the exact + // full name instead. That check should be removed in the future. + (measure.FullName == "Microsoft.Quantum.Primitive.Measure" || measure.FullName == typeof(Intrinsic.Measure).FullName || measure.FullName == typeof(MeasureAllZ).FullName); } } } From 0cfbc7293dd8edffefd3eece4ee52b390de73102 Mon Sep 17 00:00:00 2001 From: Christopher Granade Date: Wed, 24 Jun 2020 17:50:07 +0000 Subject: [PATCH 3/4] Move IndexRange as well. --- Standard/src/Arrays/Enumeration.qs | 25 ------------------------- 1 file changed, 25 deletions(-) diff --git a/Standard/src/Arrays/Enumeration.qs b/Standard/src/Arrays/Enumeration.qs index 2ed0283361b..47675a58f68 100644 --- a/Standard/src/Arrays/Enumeration.qs +++ b/Standard/src/Arrays/Enumeration.qs @@ -3,31 +3,6 @@ namespace Microsoft.Quantum.Arrays { - /// # Summary - /// Given an array, returns a range over the indices of that array, suitable - /// for use in a for loop. - /// - /// # Type Parameters - /// ## 'TElement - /// The type of elements of the array. - /// - /// # Input - /// ## array - /// An array for which a range of indices should be returned. - /// - /// # Output - /// A range over all indices of the array. - /// - /// # Example - /// The following `for` loops are equivalent: - /// ```Q# - /// for (idx in IndexRange(array)) { ... } - /// for (idx in IndexRange(array)) { ... } - /// ``` - function IndexRange<'TElement>(array : 'TElement[]) : Range { - return 0..(Length(array) - 1); - } - internal function Identity<'T>(input : 'T) : 'T { return input; } /// # Summary From bbbd6b6994b9b2a7516180c448ea97b3ff42ba52 Mon Sep 17 00:00:00 2001 From: Christopher Granade Date: Thu, 25 Jun 2020 22:29:55 +0000 Subject: [PATCH 4/4] Update to 0.12.20062514-beta. --- Chemistry/src/Runtime/Runtime.csproj | 4 ++-- Chemistry/tests/ChemistryTests/QSharpTests.csproj | 2 +- Chemistry/tests/SystemTests/SystemTests.csproj | 2 +- MachineLearning/src/MachineLearning.csproj | 2 +- MachineLearning/tests/MachineLearningTests.csproj | 2 +- Numerics/src/Numerics.csproj | 4 ++-- Numerics/tests/NumericsTests.csproj | 2 +- Standard/src/Standard.csproj | 4 ++-- Standard/tests/Standard.Tests.csproj | 2 +- 9 files changed, 12 insertions(+), 12 deletions(-) diff --git a/Chemistry/src/Runtime/Runtime.csproj b/Chemistry/src/Runtime/Runtime.csproj index 64556d7778d..c62f574a79d 100644 --- a/Chemistry/src/Runtime/Runtime.csproj +++ b/Chemistry/src/Runtime/Runtime.csproj @@ -1,4 +1,4 @@ - + netstandard2.1 @@ -16,7 +16,7 @@ - + diff --git a/Chemistry/tests/ChemistryTests/QSharpTests.csproj b/Chemistry/tests/ChemistryTests/QSharpTests.csproj index a256e822a01..5f67d6eabb3 100644 --- a/Chemistry/tests/ChemistryTests/QSharpTests.csproj +++ b/Chemistry/tests/ChemistryTests/QSharpTests.csproj @@ -1,4 +1,4 @@ - + diff --git a/Chemistry/tests/SystemTests/SystemTests.csproj b/Chemistry/tests/SystemTests/SystemTests.csproj index cdfc411e644..e639c70d365 100644 --- a/Chemistry/tests/SystemTests/SystemTests.csproj +++ b/Chemistry/tests/SystemTests/SystemTests.csproj @@ -1,4 +1,4 @@ - + diff --git a/MachineLearning/src/MachineLearning.csproj b/MachineLearning/src/MachineLearning.csproj index 53baa039f97..ae585755a41 100644 --- a/MachineLearning/src/MachineLearning.csproj +++ b/MachineLearning/src/MachineLearning.csproj @@ -1,4 +1,4 @@ - + netstandard2.1 Microsoft.Quantum.MachineLearning diff --git a/MachineLearning/tests/MachineLearningTests.csproj b/MachineLearning/tests/MachineLearningTests.csproj index 4706dfbb2ae..24e796bf78b 100644 --- a/MachineLearning/tests/MachineLearningTests.csproj +++ b/MachineLearning/tests/MachineLearningTests.csproj @@ -1,4 +1,4 @@ - + diff --git a/Numerics/src/Numerics.csproj b/Numerics/src/Numerics.csproj index 735f2461e48..26e414eab57 100644 --- a/Numerics/src/Numerics.csproj +++ b/Numerics/src/Numerics.csproj @@ -1,4 +1,4 @@ - + netstandard2.1 @@ -37,7 +37,7 @@ - + diff --git a/Numerics/tests/NumericsTests.csproj b/Numerics/tests/NumericsTests.csproj index c443888a7f5..ed5dc9199c6 100644 --- a/Numerics/tests/NumericsTests.csproj +++ b/Numerics/tests/NumericsTests.csproj @@ -1,4 +1,4 @@ - + diff --git a/Standard/src/Standard.csproj b/Standard/src/Standard.csproj index 17a8870da62..c7ac4d458b3 100644 --- a/Standard/src/Standard.csproj +++ b/Standard/src/Standard.csproj @@ -1,4 +1,4 @@ - + netstandard2.1 @@ -30,7 +30,7 @@ - + diff --git a/Standard/tests/Standard.Tests.csproj b/Standard/tests/Standard.Tests.csproj index ba1b31db0f5..1a4ded18c16 100644 --- a/Standard/tests/Standard.Tests.csproj +++ b/Standard/tests/Standard.Tests.csproj @@ -1,4 +1,4 @@ - +