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

Commit 16962a9

Browse files
author
Cassandra Granade
authored
Merge pull request #979 from microsoft/main
Catch continuous-time rotation feature up to main.
2 parents 0821d65 + 8fb56fc commit 16962a9

File tree

152 files changed

+7731
-1111
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

152 files changed

+7731
-1111
lines changed

.devcontainer/Dockerfile

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -4,21 +4,11 @@ FROM mcr.microsoft.com/vscode/devcontainers/universal:1-linux
44

55
USER root
66

7-
RUN apt update \
8-
&& apt-get install -y --no-install-recommends \
9-
ninja-build \
10-
clang-11 \
11-
clang-tidy-11 \
12-
build-essential \
13-
&& apt-get clean \
14-
&& rm -rf /var/lib/apt/lists/
15-
167
# Install CMake 3.20 (required since apt-get uses 3.16 and repo requires 3.20)
178
RUN curl -SsL https://github.com/Kitware/CMake/releases/download/v3.20.5/cmake-3.20.5-linux-x86_64.sh -o cmakeinstall.sh \
189
&& echo "f582e02696ceee81818dc3378531804b2213ed41c2a8bc566253d16d894cefab cmakeinstall.sh" | sha256sum -c --strict - \
1910
&& chmod +x cmakeinstall.sh \
2011
&& ./cmakeinstall.sh --prefix=/usr/local --exclude-subdir \
2112
&& rm cmakeinstall.sh
2213

23-
2414
USER codespace

.gitignore

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -232,7 +232,7 @@ ClientBin/
232232
*.publishsettings
233233
orleans.codegen.cs
234234

235-
# Including strong name files can present a security risk
235+
# Including strong name files can present a security risk
236236
# (https://github.com/github/gitignore/pull/2483#issue-259490424)
237237
#*.snk
238238

@@ -328,7 +328,7 @@ __pycache__/
328328
# OpenCover UI analysis results
329329
OpenCover/
330330

331-
# Azure Stream Analytics local run output
331+
# Azure Stream Analytics local run output
332332
ASALocalRun/
333333

334334
# MSBuild Binary and Structured Log
@@ -337,7 +337,7 @@ ASALocalRun/
337337
# NVidia Nsight GPU debugger configuration file
338338
*.nvuser
339339

340-
# MFractors (Xamarin productivity tool) working folder
340+
# MFractors (Xamarin productivity tool) working folder
341341
.mfractor/
342342

343343
/src/Simulation/Simulators.Tests/TestProjects/QSharpExe/built
@@ -357,6 +357,13 @@ xplat
357357
src/Simulation/Native/win10/Microsoft.Quantum.Simulator.Runtime.dll
358358
src/Simulation/Native/linux/libMicrosoft.Quantum.Simulator.Runtime.so
359359
src/Simulation/Native/osx/libMicrosoft.Quantum.Simulator.Runtime.dylib
360+
src/Simulation/Native/win10/Microsoft.Quantum.SparseSimulator.Runtime.dll
361+
src/Simulation/Native/linux/libMicrosoft.Quantum.SparseSimulator.Runtime.so
362+
src/Simulation/Native/osx/libMicrosoft.Quantum.SparseSimulator.Runtime.dylib
360363
src/Simulation/Native/win10/Microsoft.Quantum.Experimental.Simulators.Runtime.dll
361364
src/Simulation/Native/linux/Microsoft.Quantum.Experimental.Simulators.Runtime.dll
362365
src/Simulation/Native/osx/Microsoft.Quantum.Experimental.Simulators.Runtime.dll
366+
367+
# Temporary Rust files/dirs.
368+
Cargo.lock
369+
target/

AdvantageBenchmark/privateBuild/host.csproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44

55
<PropertyGroup>
66
<OutputType>Exe</OutputType>
7-
<TargetFramework>netcoreapp3.1</TargetFramework>
7+
<TargetFramework>net6.0</TargetFramework>
88
<IncludeQSharpCorePackages>false</IncludeQSharpCorePackages> <!-- otherwise the standard library is included by the Sdk -->
99
</PropertyGroup>
1010

AdvantageBenchmark/privateBuild/runTest.ps1

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ for ($tst=1; $tst -le 2; $tst++) {
33
for ($span=4; $span -ge 0; $span--) {
44
$env:OMP_NUM_THREADS = $thrd
55
$env:QDK_SIM_FUSESPAN = $span
6-
.\bin\Release\netcoreapp3.1\host.exe $tst $tst 5
6+
.\bin\Release\net6.0\host.exe $tst $tst 5
77
}
88
}
99
}

AdvantageBenchmark/privateBuild/runTest.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ do
88
do
99
export OMP_NUM_THREADS=$thrd
1010
export QDK_SIM_FUSESPAN=$span
11-
./bin/Release/netcoreapp3.1/host $tst $tst 5
11+
./bin/Release/net6.0/host $tst $tst 5
1212
done
1313
done
1414
done

AdvantageBenchmark/readme.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ This benchmark is intended to provide an easy way to verify the performance char
66

77
## Executing the benchmark
88

9-
To execute the benchmark, compile each version of advantage.sln using `dotnet build .\advantage.sln -c Release` from their respective folders. Then the executable to run will be either `bin\Release\netcoreapp3.1\host.exe` in the privateBuild folder or `host\bin\Release\netcoreapp3.1\host.exe` in the releaseBuild folder. This executable takes parameters describing which test circuits to execute and how many loops to perform as integer arguments, such that `host.exe 1 1 5` will run 5 loops of test 1 and `host.exe 0 3 100` will run 100 loops of tests 0 through 3. Check the contents of `privateBuild\Program.cs` to see the tests that correspond to each identifier; for most machines, test 1 aka advantage 4x4 circuit is the best choice for benchmarking.
9+
To execute the benchmark, compile each version of advantage.sln using `dotnet build .\advantage.sln -c Release` from their respective folders. Then the executable to run will be either `bin\Release\net6.0\host.exe` in the privateBuild folder or `host\bin\Release\net6.0\host.exe` in the releaseBuild folder. This executable takes parameters describing which test circuits to execute and how many loops to perform as integer arguments, such that `host.exe 1 1 5` will run 5 loops of test 1 and `host.exe 0 3 100` will run 100 loops of tests 0 through 3. Check the contents of `privateBuild\Program.cs` to see the tests that correspond to each identifier; for most machines, test 1 aka advantage 4x4 circuit is the best choice for benchmarking.
1010

1111
The benchmark can also be run via runTest.ps1 or runTest.sh, which performs a sweep across configured environment variables that adjust the number of threads used and gates fused in simulating the circuit. See the definition of the script used on your platform to understand how it configures the `OMP_NUM_THREADS` and `QDK_SIM_FUSESPAN` environment variables.
1212

AdvantageBenchmark/releasedBuild/host/host.csproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010

1111
<PropertyGroup>
1212
<OutputType>Exe</OutputType>
13-
<TargetFramework>netcoreapp3.1</TargetFramework>
13+
<TargetFramework>net6.0</TargetFramework>
1414
</PropertyGroup>
1515

1616
</Project>

Simulation.sln

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -855,7 +855,7 @@ Global
855855
{EB6E3DBD-C884-4241-9BC4-8281191D1F53} = {34D419E9-CCF1-4E48-9FA4-3AD4B86BEEB4}
856856
{E1A463D7-2E23-4134-BE04-1EFF7A546813} = {93409CC3-8DF9-45FA-AE21-16A19FDEF650}
857857
{789C86D9-CE77-40DA-BDDD-979436952512} = {93409CC3-8DF9-45FA-AE21-16A19FDEF650}
858-
{7E24885B-D86D-477E-A840-06FA53C33FE1} = {34D419E9-CCF1-4E48-9FA4-3AD4B86BEEB4}
858+
{7E24885B-D86D-477E-A840-06FA53C33FE1} = {93409CC3-8DF9-45FA-AE21-16A19FDEF650}
859859
{7F80466B-A6B5-4EF1-A9E9-22ABAE3C20C1} = {34D419E9-CCF1-4E48-9FA4-3AD4B86BEEB4}
860860
{7F7BB60A-5DCB-469E-8546-1BE9E3CAC833} = {F6C2D4C0-12DC-40E3-9C86-FA5308D9B567}
861861
{EAC5EAE7-D1B3-4726-AFDB-73000E62176A} = {7F7BB60A-5DCB-469E-8546-1BE9E3CAC833}

bootstrap.ps1

Lines changed: 7 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -7,25 +7,22 @@ Push-Location (Join-Path $PSScriptRoot "build")
77
.\prerequisites.ps1
88
Pop-Location
99

10+
cargo install cargo-edit
1011
Push-Location (Join-Path $PSScriptRoot "./src/Simulation/qdk_sim_rs")
11-
# We use dotnet-script to inject the version number into Cargo.toml,
12-
# so we go on ahead here and restore any missing tools.
13-
# Since that Cargo.toml is referenced by CMake lists in the QIR
14-
# runtime, this injection has to be the first thing we do.
15-
dotnet tool restore
16-
dotnet script inject-version.csx -- `
17-
--template Cargo.toml.template `
18-
--out-path Cargo.toml `
19-
--version $Env:NUGET_VERSION;
12+
cargo set-version $Env:NUGET_VERSION;
2013
Pop-Location
2114

2215
if (-not (Test-Path Env:/AGENT_OS)) { # If not CI build, i.e. local build (if AGENT_OS envvar is not defined)
2316
if ($Env:ENABLE_NATIVE -ne "false") {
24-
Write-Host "Build release flavor of the native simulator"
2517
$Env:BUILD_CONFIGURATION = "Release"
18+
Write-Host "Build release flavor of the full state simulator"
2619
Push-Location (Join-Path $PSScriptRoot "src/Simulation/Native")
2720
.\build-native-simulator.ps1
2821
Pop-Location
22+
23+
Write-Host "Build release flavor of the Sparse Simulator"
24+
Invoke-Expression (Join-Path $PSScriptRoot "src" "Simulation" "NativeSparseSimulator" "build.ps1")
25+
2926
Push-Location (Join-Path $PSScriptRoot "src/Simulation/qdk_sim_rs")
3027
# Don't run the experimental simulator build if we're local
3128
# and prerequisites are missing.

build/build.ps1

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,8 @@ if ($Env:ENABLE_NATIVE -ne "false") {
2222
if ($LastExitCode -ne 0) {
2323
$script:all_ok = $False
2424
}
25+
26+
( & (Join-Path $PSScriptRoot .. src Simulation NativeSparseSimulator build.ps1) ) || ( $script:all_ok = $False )
2527
} else {
2628
Write-Host "Skipping build of native simulator because ENABLE_NATIVE variable is set to: $Env:ENABLE_NATIVE."
2729
}

0 commit comments

Comments
 (0)