Skip to content
This repository was archived by the owner on Jan 12, 2024. It is now read-only.

Commit 25aa5c1

Browse files
authored
Adapting for the QuantumSimulator change (#521)
* Adapting for a callback signature change in QuantumSimulator. * Switched to BigInteger index.
1 parent 767e91c commit 25aa5c1

File tree

12 files changed

+31
-28
lines changed

12 files changed

+31
-28
lines changed

Chemistry/src/Runtime/Runtime.csproj

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
<Project Sdk="Microsoft.Quantum.Sdk/0.22.187631">
1+
<Project Sdk="Microsoft.Quantum.Sdk/0.22.191200-beta">
22

33
<PropertyGroup>
44
<TargetFramework>netstandard2.1</TargetFramework>
@@ -40,7 +40,7 @@
4040
</ItemGroup>
4141

4242
<ItemGroup>
43-
<PackageReference Include="Microsoft.Quantum.Simulators" Version="0.22.187631" />
43+
<PackageReference Include="Microsoft.Quantum.Simulators" Version="0.22.191200-beta" />
4444
</ItemGroup>
4545

4646
<ItemGroup>

Chemistry/tests/ChemistryTests/QSharpTests.csproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
<Project Sdk="Microsoft.Quantum.Sdk/0.22.187631">
1+
<Project Sdk="Microsoft.Quantum.Sdk/0.22.191200-beta">
22

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

Chemistry/tests/SystemTests/SystemTests.csproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
<Project Sdk="Microsoft.Quantum.Sdk/0.22.187631">
1+
<Project Sdk="Microsoft.Quantum.Sdk/0.22.191200-beta">
22

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

MachineLearning/src/MachineLearning.csproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
<Project Sdk="Microsoft.Quantum.Sdk/0.22.187631">
1+
<Project Sdk="Microsoft.Quantum.Sdk/0.22.191200-beta">
22
<PropertyGroup>
33
<TargetFramework>netstandard2.1</TargetFramework>
44
<AssemblyName>Microsoft.Quantum.MachineLearning</AssemblyName>

MachineLearning/tests/MachineLearningTests.csproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
<Project Sdk="Microsoft.Quantum.Sdk/0.22.187631">
1+
<Project Sdk="Microsoft.Quantum.Sdk/0.22.191200-beta">
22

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

NOTICE.txt

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -5293,7 +5293,7 @@ Copyright (c) Microsoft Corporation.
52935293

52945294
---------------------------------------------------------
52955295

5296-
Microsoft.Quantum.Compiler 0.22.187631 - MIT
5296+
Microsoft.Quantum.Compiler 0.22.191200-beta - MIT
52975297

52985298

52995299
(c) 2008 VeriSign, Inc.
@@ -5313,7 +5313,7 @@ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLI
53135313

53145314
---------------------------------------------------------
53155315

5316-
Microsoft.Quantum.CSharpGeneration 0.22.187631 - MIT
5316+
Microsoft.Quantum.CSharpGeneration 0.22.191200-beta - MIT
53175317

53185318

53195319
(c) 2008 VeriSign, Inc.
@@ -5333,7 +5333,7 @@ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLI
53335333

53345334
---------------------------------------------------------
53355335

5336-
Microsoft.Quantum.DocumentationGenerator 0.22.187631 - MIT
5336+
Microsoft.Quantum.DocumentationGenerator 0.22.191200-beta - MIT
53375337

53385338

53395339
(c) 2008 VeriSign, Inc.
@@ -5353,7 +5353,7 @@ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLI
53535353

53545354
---------------------------------------------------------
53555355

5356-
Microsoft.Quantum.IQSharp.Core 0.22.187631 - MIT
5356+
Microsoft.Quantum.IQSharp.Core 0.22.191200-beta - MIT
53575357

53585358

53595359
(c) by W3C
@@ -5760,7 +5760,7 @@ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLI
57605760

57615761
---------------------------------------------------------
57625762

5763-
Microsoft.Quantum.IQSharp.Jupyter 0.22.187631 - MIT
5763+
Microsoft.Quantum.IQSharp.Jupyter 0.22.191200-beta - MIT
57645764

57655765

57665766
(c) 2008 VeriSign, Inc.
@@ -5780,7 +5780,7 @@ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLI
57805780

57815781
---------------------------------------------------------
57825782

5783-
Microsoft.Quantum.QSharp.Core 0.22.187631 - MIT
5783+
Microsoft.Quantum.QSharp.Core 0.22.191200-beta - MIT
57845784

57855785

57865786
(c) 2008 VeriSign, Inc.
@@ -5800,7 +5800,7 @@ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLI
58005800

58015801
---------------------------------------------------------
58025802

5803-
Microsoft.Quantum.QSharp.Foundation 0.22.187631 - MIT
5803+
Microsoft.Quantum.QSharp.Foundation 0.22.191200-beta - MIT
58045804

58055805

58065806
(c) 2008 VeriSign, Inc.
@@ -5820,7 +5820,7 @@ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLI
58205820

58215821
---------------------------------------------------------
58225822

5823-
Microsoft.Quantum.Runtime.Core 0.22.187631 - MIT
5823+
Microsoft.Quantum.Runtime.Core 0.22.191200-beta - MIT
58245824

58255825

58265826
(c) 2008 VeriSign, Inc.
@@ -5840,7 +5840,7 @@ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLI
58405840

58415841
---------------------------------------------------------
58425842

5843-
Microsoft.Quantum.Simulators 0.22.187631 - MIT
5843+
Microsoft.Quantum.Simulators 0.22.191200-beta - MIT
58445844

58455845

58465846
(c) 2008 VeriSign, Inc.
@@ -5860,7 +5860,7 @@ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLI
58605860

58615861
---------------------------------------------------------
58625862

5863-
Microsoft.Quantum.Targets.Interfaces 0.22.187631 - MIT
5863+
Microsoft.Quantum.Targets.Interfaces 0.22.191200-beta - MIT
58645864

58655865

58665866
(c) 2008 VeriSign, Inc.

Numerics/src/Numerics.csproj

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
<Project Sdk="Microsoft.Quantum.Sdk/0.22.187631">
1+
<Project Sdk="Microsoft.Quantum.Sdk/0.22.191200-beta">
22

33
<PropertyGroup>
44
<TargetFramework>netstandard2.1</TargetFramework>
@@ -41,7 +41,7 @@
4141
</ItemGroup>
4242

4343
<ItemGroup>
44-
<PackageReference Include="Microsoft.Quantum.Simulators" Version="0.22.187631" />
44+
<PackageReference Include="Microsoft.Quantum.Simulators" Version="0.22.191200-beta" />
4545
<PackageReference Include="Microsoft.SourceLink.GitHub" Version="1.0.0" PrivateAssets="All" />
4646
</ItemGroup>
4747

Numerics/tests/NumericsTests.csproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
<Project Sdk="Microsoft.Quantum.Sdk/0.22.187631">
1+
<Project Sdk="Microsoft.Quantum.Sdk/0.22.191200-beta">
22

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

Standard/src/Diagnostics/Emulation/Internal.cs

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,9 @@
44
#nullable enable
55

66
using System;
7+
using System.Numerics;
78
using System.Linq;
9+
using System.Runtime.InteropServices;
810
using Microsoft.Quantum.Diagnostics.Emulation;
911
using Microsoft.Quantum.Simulation.Common;
1012
using Microsoft.Quantum.Simulation.Core;
@@ -23,11 +25,12 @@ public ArrayDumper(QuantumSimulator sim) : base(sim)
2325
{
2426
}
2527

26-
public override bool Callback(uint idx, double real, double img)
28+
public override bool Callback([MarshalAs(UnmanagedType.LPStr)] string idx, double real, double img)
2729
{
2830
if (Data == null) throw new Exception("Expected data buffer to be initialized before callback, but it was null.");
29-
Data![(int)idx, 0] = real;
30-
Data![(int)idx, 1] = img;
31+
Data![(int)(CommonNativeSimulator.DisplayableState.BasisStateLabelToBigInt(idx)), 0] = real;
32+
Data![(int)(CommonNativeSimulator.DisplayableState.BasisStateLabelToBigInt(idx)), 1] = img;
33+
3134
return true;
3235
}
3336

Standard/src/Standard.csproj

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
<Project Sdk="Microsoft.Quantum.Sdk/0.22.187631">
1+
<Project Sdk="Microsoft.Quantum.Sdk/0.22.191200-beta">
22

33
<PropertyGroup>
44
<TargetFramework>netstandard2.1</TargetFramework>
@@ -38,8 +38,8 @@
3838
</ItemGroup>
3939

4040
<ItemGroup>
41-
<PackageReference Include="Microsoft.Quantum.Simulators" Version="0.22.187631" />
42-
<PackageReference Include="Microsoft.Quantum.QSharp.Core" Version="0.22.187631" />
41+
<PackageReference Include="Microsoft.Quantum.Simulators" Version="0.22.191200-beta" />
42+
<PackageReference Include="Microsoft.Quantum.QSharp.Core" Version="0.22.191200-beta" />
4343
<PackageReference Include="Microsoft.SourceLink.GitHub" Version="1.0.0" PrivateAssets="All" />
4444
<PackageReference Include="NumSharp" Version="0.20.5" />
4545
</ItemGroup>

0 commit comments

Comments
 (0)