From 25aa5c141dd1e5543115efdbb6616692ef295f2c Mon Sep 17 00:00:00 2001 From: Robin Kuzmin <9372582+kuzminrobin@users.noreply.github.com> Date: Fri, 11 Feb 2022 00:27:02 -0800 Subject: [PATCH 1/2] Adapting for the QuantumSimulator change (#521) * Adapting for a callback signature change in QuantumSimulator. * Switched to BigInteger index. --- Chemistry/src/Runtime/Runtime.csproj | 4 ++-- .../tests/ChemistryTests/QSharpTests.csproj | 2 +- .../tests/SystemTests/SystemTests.csproj | 2 +- MachineLearning/src/MachineLearning.csproj | 2 +- .../tests/MachineLearningTests.csproj | 2 +- NOTICE.txt | 20 +++++++++---------- Numerics/src/Numerics.csproj | 4 ++-- Numerics/tests/NumericsTests.csproj | 2 +- .../src/Diagnostics/Emulation/Internal.cs | 9 ++++++--- Standard/src/Standard.csproj | 6 +++--- Standard/tests/Standard.Tests.csproj | 2 +- Visualization/src/Visualization.csproj | 4 ++-- 12 files changed, 31 insertions(+), 28 deletions(-) diff --git a/Chemistry/src/Runtime/Runtime.csproj b/Chemistry/src/Runtime/Runtime.csproj index 5cc426c73d3..4822fafd9e7 100644 --- a/Chemistry/src/Runtime/Runtime.csproj +++ b/Chemistry/src/Runtime/Runtime.csproj @@ -1,4 +1,4 @@ - + netstandard2.1 @@ -40,7 +40,7 @@ - + diff --git a/Chemistry/tests/ChemistryTests/QSharpTests.csproj b/Chemistry/tests/ChemistryTests/QSharpTests.csproj index f860c297636..6d2636c9795 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 de158b3f50a..d4bfa3ccba9 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 3ee2e00dd68..adcb5683acd 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 9cf50a1bd25..45c3aa884e3 100644 --- a/MachineLearning/tests/MachineLearningTests.csproj +++ b/MachineLearning/tests/MachineLearningTests.csproj @@ -1,4 +1,4 @@ - + diff --git a/NOTICE.txt b/NOTICE.txt index 0529c888dc0..26a8ab826b0 100644 --- a/NOTICE.txt +++ b/NOTICE.txt @@ -5293,7 +5293,7 @@ Copyright (c) Microsoft Corporation. --------------------------------------------------------- -Microsoft.Quantum.Compiler 0.22.187631 - MIT +Microsoft.Quantum.Compiler 0.22.191200-beta - MIT (c) 2008 VeriSign, Inc. @@ -5313,7 +5313,7 @@ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLI --------------------------------------------------------- -Microsoft.Quantum.CSharpGeneration 0.22.187631 - MIT +Microsoft.Quantum.CSharpGeneration 0.22.191200-beta - MIT (c) 2008 VeriSign, Inc. @@ -5333,7 +5333,7 @@ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLI --------------------------------------------------------- -Microsoft.Quantum.DocumentationGenerator 0.22.187631 - MIT +Microsoft.Quantum.DocumentationGenerator 0.22.191200-beta - MIT (c) 2008 VeriSign, Inc. @@ -5353,7 +5353,7 @@ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLI --------------------------------------------------------- -Microsoft.Quantum.IQSharp.Core 0.22.187631 - MIT +Microsoft.Quantum.IQSharp.Core 0.22.191200-beta - MIT (c) by W3C @@ -5760,7 +5760,7 @@ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLI --------------------------------------------------------- -Microsoft.Quantum.IQSharp.Jupyter 0.22.187631 - MIT +Microsoft.Quantum.IQSharp.Jupyter 0.22.191200-beta - MIT (c) 2008 VeriSign, Inc. @@ -5780,7 +5780,7 @@ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLI --------------------------------------------------------- -Microsoft.Quantum.QSharp.Core 0.22.187631 - MIT +Microsoft.Quantum.QSharp.Core 0.22.191200-beta - MIT (c) 2008 VeriSign, Inc. @@ -5800,7 +5800,7 @@ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLI --------------------------------------------------------- -Microsoft.Quantum.QSharp.Foundation 0.22.187631 - MIT +Microsoft.Quantum.QSharp.Foundation 0.22.191200-beta - MIT (c) 2008 VeriSign, Inc. @@ -5820,7 +5820,7 @@ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLI --------------------------------------------------------- -Microsoft.Quantum.Runtime.Core 0.22.187631 - MIT +Microsoft.Quantum.Runtime.Core 0.22.191200-beta - MIT (c) 2008 VeriSign, Inc. @@ -5840,7 +5840,7 @@ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLI --------------------------------------------------------- -Microsoft.Quantum.Simulators 0.22.187631 - MIT +Microsoft.Quantum.Simulators 0.22.191200-beta - MIT (c) 2008 VeriSign, Inc. @@ -5860,7 +5860,7 @@ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLI --------------------------------------------------------- -Microsoft.Quantum.Targets.Interfaces 0.22.187631 - MIT +Microsoft.Quantum.Targets.Interfaces 0.22.191200-beta - MIT (c) 2008 VeriSign, Inc. diff --git a/Numerics/src/Numerics.csproj b/Numerics/src/Numerics.csproj index 6ae2742f83f..e7930e6df17 100644 --- a/Numerics/src/Numerics.csproj +++ b/Numerics/src/Numerics.csproj @@ -1,4 +1,4 @@ - + netstandard2.1 @@ -41,7 +41,7 @@ - + diff --git a/Numerics/tests/NumericsTests.csproj b/Numerics/tests/NumericsTests.csproj index e32c2b8c9b7..c62cc6449c5 100644 --- a/Numerics/tests/NumericsTests.csproj +++ b/Numerics/tests/NumericsTests.csproj @@ -1,4 +1,4 @@ - + diff --git a/Standard/src/Diagnostics/Emulation/Internal.cs b/Standard/src/Diagnostics/Emulation/Internal.cs index 1480f962e37..cb8ff06c480 100644 --- a/Standard/src/Diagnostics/Emulation/Internal.cs +++ b/Standard/src/Diagnostics/Emulation/Internal.cs @@ -4,7 +4,9 @@ #nullable enable using System; +using System.Numerics; using System.Linq; +using System.Runtime.InteropServices; using Microsoft.Quantum.Diagnostics.Emulation; using Microsoft.Quantum.Simulation.Common; using Microsoft.Quantum.Simulation.Core; @@ -23,11 +25,12 @@ public ArrayDumper(QuantumSimulator sim) : base(sim) { } - public override bool Callback(uint idx, double real, double img) + public override bool Callback([MarshalAs(UnmanagedType.LPStr)] string idx, double real, double img) { if (Data == null) throw new Exception("Expected data buffer to be initialized before callback, but it was null."); - Data![(int)idx, 0] = real; - Data![(int)idx, 1] = img; + Data![(int)(CommonNativeSimulator.DisplayableState.BasisStateLabelToBigInt(idx)), 0] = real; + Data![(int)(CommonNativeSimulator.DisplayableState.BasisStateLabelToBigInt(idx)), 1] = img; + return true; } diff --git a/Standard/src/Standard.csproj b/Standard/src/Standard.csproj index 48781a61777..aacaf4ebbeb 100644 --- a/Standard/src/Standard.csproj +++ b/Standard/src/Standard.csproj @@ -1,4 +1,4 @@ - + netstandard2.1 @@ -38,8 +38,8 @@ - - + + diff --git a/Standard/tests/Standard.Tests.csproj b/Standard/tests/Standard.Tests.csproj index 89f1522fc7a..9d47d421b39 100644 --- a/Standard/tests/Standard.Tests.csproj +++ b/Standard/tests/Standard.Tests.csproj @@ -1,4 +1,4 @@ - + diff --git a/Visualization/src/Visualization.csproj b/Visualization/src/Visualization.csproj index 45733ad52d6..b386823d3a7 100644 --- a/Visualization/src/Visualization.csproj +++ b/Visualization/src/Visualization.csproj @@ -32,9 +32,9 @@ - + - + From ee99f1e2b41f484865fcd144da421db3cf983305 Mon Sep 17 00:00:00 2001 From: Robin Kuzmin Date: Wed, 16 Feb 2022 16:24:24 -0800 Subject: [PATCH 2/2] Fake commit to kick off the CI build.