From 551acb8c6c7e6246b1a98db17488144e2709ec8b Mon Sep 17 00:00:00 2001 From: Mariia Mykhailova Date: Tue, 3 Dec 2019 10:04:10 -0800 Subject: [PATCH 1/3] Clarify the restriction on the number of bits for IntAsBoolArray (#171) * Clarify the restriction on the number of bits for IntAsBoolArray This should fix #166 by providing a more specific error message. * Update Standard/src/Convert/Convert.qs Co-Authored-By: Chris Granade * Allow to have bits = 0 Looks like our tests assume that number = 0 with bits = 0 is a valid scenario; updating the change to account for that --- Standard/src/Convert/Convert.qs | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/Standard/src/Convert/Convert.qs b/Standard/src/Convert/Convert.qs index b69b24bd51d..85a89b88367 100644 --- a/Standard/src/Convert/Convert.qs +++ b/Standard/src/Convert/Convert.qs @@ -76,8 +76,10 @@ namespace Microsoft.Quantum.Convert { /// An array of boolean values representing `number`. /// /// # Remarks - /// The input `number` must be at most $2^{\texttt{bits}} - 1$. + /// The input `bits` must be between 0 and 63. + /// The input `number` must be between 0 and $2^{\texttt{bits}} - 1$. function IntAsBoolArray(number : Int, bits : Int) : Bool[] { + Fact(bits >= 0 and bits <= 63, $"`bits` must be between 0 and 63 {2^bits}"); EqualityFactB(number >= 0 and number < 2 ^ bits, true, $"`number` must be between 0 and 2^`bits` - 1"); mutable outputBits = new Bool[bits]; mutable tempInt = number; From d746df20ce7e3673b4c4e7fb66a0e6baa447d5a6 Mon Sep 17 00:00:00 2001 From: bettinaheim <34236215+bettinaheim@users.noreply.github.com> Date: Thu, 12 Dec 2019 20:27:22 -0800 Subject: [PATCH 2/3] Package updates (#188) --- Chemistry/src/DataModel/DataModel.csproj | 8 ++++---- Chemistry/src/Jupyter/Jupyter.csproj | 8 ++++---- Chemistry/src/Runtime/Runtime.csproj | 2 +- Chemistry/tests/ChemistryTests/QSharpTests.csproj | 13 ++++++++----- Chemistry/tests/DataModelTests/CSharpTests.csproj | 15 +++++++++------ Chemistry/tests/JupyterTests/JupyterTests.csproj | 9 ++++++--- Chemistry/tests/SamplesTests/SamplesTests.csproj | 15 +++++++++------ .../SerializationTests/SerializationTests.csproj | 11 +++++++---- Chemistry/tests/SystemTests/SystemTests.csproj | 13 ++++++++----- Numerics/src/Numerics.csproj | 4 ++-- Numerics/tests/NumericsTests.csproj | 13 ++++++++----- Standard/src/Standard.csproj | 7 ++----- Standard/tests/Standard.Tests.csproj | 10 +++++----- 13 files changed, 73 insertions(+), 55 deletions(-) diff --git a/Chemistry/src/DataModel/DataModel.csproj b/Chemistry/src/DataModel/DataModel.csproj index 14086f84be6..6c787137998 100644 --- a/Chemistry/src/DataModel/DataModel.csproj +++ b/Chemistry/src/DataModel/DataModel.csproj @@ -35,9 +35,9 @@ - - - + + + @@ -53,6 +53,6 @@ - + diff --git a/Chemistry/src/Jupyter/Jupyter.csproj b/Chemistry/src/Jupyter/Jupyter.csproj index 57c676d8836..da3e74cc8e6 100644 --- a/Chemistry/src/Jupyter/Jupyter.csproj +++ b/Chemistry/src/Jupyter/Jupyter.csproj @@ -26,9 +26,9 @@ - - - + + + @@ -38,6 +38,6 @@ - + diff --git a/Chemistry/src/Runtime/Runtime.csproj b/Chemistry/src/Runtime/Runtime.csproj index 442a13d14c9..2dfbcf8f9c0 100644 --- a/Chemistry/src/Runtime/Runtime.csproj +++ b/Chemistry/src/Runtime/Runtime.csproj @@ -15,7 +15,7 @@ - + diff --git a/Chemistry/tests/ChemistryTests/QSharpTests.csproj b/Chemistry/tests/ChemistryTests/QSharpTests.csproj index 66e2888e2c0..573b654a2b9 100644 --- a/Chemistry/tests/ChemistryTests/QSharpTests.csproj +++ b/Chemistry/tests/ChemistryTests/QSharpTests.csproj @@ -10,11 +10,14 @@ - - - - - + + + + + + all + runtime; build; native; contentfiles; analyzers; buildtransitive + diff --git a/Chemistry/tests/DataModelTests/CSharpTests.csproj b/Chemistry/tests/DataModelTests/CSharpTests.csproj index 9c3df4a3cce..f8af284a8e0 100644 --- a/Chemistry/tests/DataModelTests/CSharpTests.csproj +++ b/Chemistry/tests/DataModelTests/CSharpTests.csproj @@ -23,12 +23,15 @@ - - - - - - + + + + + + + all + runtime; build; native; contentfiles; analyzers; buildtransitive + diff --git a/Chemistry/tests/JupyterTests/JupyterTests.csproj b/Chemistry/tests/JupyterTests/JupyterTests.csproj index 4b322d832da..bb21b47bf52 100644 --- a/Chemistry/tests/JupyterTests/JupyterTests.csproj +++ b/Chemistry/tests/JupyterTests/JupyterTests.csproj @@ -17,10 +17,13 @@ - + - - + + + all + runtime; build; native; contentfiles; analyzers; buildtransitive + diff --git a/Chemistry/tests/SamplesTests/SamplesTests.csproj b/Chemistry/tests/SamplesTests/SamplesTests.csproj index af9581bbb83..cdbfc4688ae 100644 --- a/Chemistry/tests/SamplesTests/SamplesTests.csproj +++ b/Chemistry/tests/SamplesTests/SamplesTests.csproj @@ -17,12 +17,15 @@ - - - - - - + + + + + + + all + runtime; build; native; contentfiles; analyzers; buildtransitive + diff --git a/Chemistry/tests/SerializationTests/SerializationTests.csproj b/Chemistry/tests/SerializationTests/SerializationTests.csproj index daab1c45c20..ff8ea481ff9 100644 --- a/Chemistry/tests/SerializationTests/SerializationTests.csproj +++ b/Chemistry/tests/SerializationTests/SerializationTests.csproj @@ -16,10 +16,13 @@ - - - - + + + + + all + runtime; build; native; contentfiles; analyzers; buildtransitive + diff --git a/Chemistry/tests/SystemTests/SystemTests.csproj b/Chemistry/tests/SystemTests/SystemTests.csproj index 0da8e8b4d71..f5970bf9457 100644 --- a/Chemistry/tests/SystemTests/SystemTests.csproj +++ b/Chemistry/tests/SystemTests/SystemTests.csproj @@ -17,11 +17,14 @@ - - - - - + + + + + + all + runtime; build; native; contentfiles; analyzers; buildtransitive + diff --git a/Numerics/src/Numerics.csproj b/Numerics/src/Numerics.csproj index fe72ffe01c3..53c33d5ee9c 100644 --- a/Numerics/src/Numerics.csproj +++ b/Numerics/src/Numerics.csproj @@ -30,10 +30,10 @@ - + - + diff --git a/Numerics/tests/NumericsTests.csproj b/Numerics/tests/NumericsTests.csproj index 3f1f62f3317..e8c9b86e785 100644 --- a/Numerics/tests/NumericsTests.csproj +++ b/Numerics/tests/NumericsTests.csproj @@ -15,11 +15,14 @@ - - - - - + + + + + + all + runtime; build; native; contentfiles; analyzers; buildtransitive + diff --git a/Standard/src/Standard.csproj b/Standard/src/Standard.csproj index f32f4c1fdf1..5a44aad43cb 100644 --- a/Standard/src/Standard.csproj +++ b/Standard/src/Standard.csproj @@ -30,10 +30,7 @@ - - - - - + + diff --git a/Standard/tests/Standard.Tests.csproj b/Standard/tests/Standard.Tests.csproj index 771ff3c378a..0be3d1c80a1 100644 --- a/Standard/tests/Standard.Tests.csproj +++ b/Standard/tests/Standard.Tests.csproj @@ -20,11 +20,11 @@ - - - - - + + + + + From 6612ec391b52973040daea7842f59979bae331b5 Mon Sep 17 00:00:00 2001 From: Christopher Granade Date: Mon, 16 Dec 2019 17:51:59 -0800 Subject: [PATCH 3/3] Updated sourcelink on QML to match new version. --- MachineLearning/src/DataModel/DataModel.csproj | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/MachineLearning/src/DataModel/DataModel.csproj b/MachineLearning/src/DataModel/DataModel.csproj index 24297486e72..0b9c2b15adb 100644 --- a/MachineLearning/src/DataModel/DataModel.csproj +++ b/MachineLearning/src/DataModel/DataModel.csproj @@ -42,6 +42,6 @@ - +