Skip to content
This repository was archived by the owner on Jan 12, 2024. It is now read-only.
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
20 commits
Select commit Hold shift + click to select a range
46b4247
Migrate toolchain to LLVM 13 (#924)
swernli Feb 3, 2022
64240b2
Update QDK versions (#932)
swernli Feb 10, 2022
f4528aa
Update namespace summaries and descriptions (#935)
tcNickolas Feb 16, 2022
cf7fcc4
Clarify API docs for Fact and Contradiction (#941)
tcNickolas Feb 16, 2022
d217856
Updated LocalVariableDeclaraion to use Two Type Arguments (#934)
ScottCarda-MS Feb 16, 2022
2e9962e
remove yy:MM from name field (#931)
IsraelMiles Feb 17, 2022
e5be79b
Sparse simulator (core components) (#939)
bettinaheim Feb 17, 2022
5c9b991
Excluded the temporary Rust files in .gitignore. (#937)
kuzminrobin Feb 17, 2022
10cc399
Renamed SparseQuantumSimulator.dll. (#946)
kuzminrobin Feb 18, 2022
221644f
Fixed the SparseSimulator tests. (#945)
kuzminrobin Feb 18, 2022
c0227a7
Fix to known QuantumProcessorTranslationException not being handled c…
cesarzc Feb 19, 2022
836b2cb
Enabled listing the sparse simulator in the command line help. (#952)
kuzminrobin Feb 23, 2022
ea32879
Update wording for Azure submission errors (#957)
swernli Feb 25, 2022
0412d08
update version to 0.23.195983 (#963)
ScottCarda-MS Mar 4, 2022
ebaad05
Runtime support for Quantinuum targets. (#943) (#953) (#960)
cesarzc Mar 8, 2022
5be21f5
Clarify BoolArrayAsBigInt behavior for negative numbers (#965)
tcNickolas Mar 10, 2022
1e387fa
Adopt .NET6 + VS2022 in Quantum Development Kit (#966)
ricardo-espinoza Mar 17, 2022
0eaf0c1
Minor improvement for task #969. (#970)
kuzminrobin Mar 20, 2022
499c068
Fix `Exp` decomposition to Ising gates (#971)
swernli Mar 23, 2022
8fb56fc
Build 0.24.201332. (#978)
ricardo-espinoza Mar 31, 2022
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 0 additions & 10 deletions .devcontainer/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -4,21 +4,11 @@ FROM mcr.microsoft.com/vscode/devcontainers/universal:1-linux

USER root

RUN apt update \
&& apt-get install -y --no-install-recommends \
ninja-build \
clang-11 \
clang-tidy-11 \
build-essential \
&& apt-get clean \
&& rm -rf /var/lib/apt/lists/

# Install CMake 3.20 (required since apt-get uses 3.16 and repo requires 3.20)
RUN curl -SsL https://github.com/Kitware/CMake/releases/download/v3.20.5/cmake-3.20.5-linux-x86_64.sh -o cmakeinstall.sh \
&& echo "f582e02696ceee81818dc3378531804b2213ed41c2a8bc566253d16d894cefab cmakeinstall.sh" | sha256sum -c --strict - \
&& chmod +x cmakeinstall.sh \
&& ./cmakeinstall.sh --prefix=/usr/local --exclude-subdir \
&& rm cmakeinstall.sh


USER codespace
13 changes: 10 additions & 3 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -232,7 +232,7 @@ ClientBin/
*.publishsettings
orleans.codegen.cs

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

Expand Down Expand Up @@ -328,7 +328,7 @@ __pycache__/
# OpenCover UI analysis results
OpenCover/

# Azure Stream Analytics local run output
# Azure Stream Analytics local run output
ASALocalRun/

# MSBuild Binary and Structured Log
Expand All @@ -337,7 +337,7 @@ ASALocalRun/
# NVidia Nsight GPU debugger configuration file
*.nvuser

# MFractors (Xamarin productivity tool) working folder
# MFractors (Xamarin productivity tool) working folder
.mfractor/

/src/Simulation/Simulators.Tests/TestProjects/QSharpExe/built
Expand All @@ -357,6 +357,13 @@ xplat
src/Simulation/Native/win10/Microsoft.Quantum.Simulator.Runtime.dll
src/Simulation/Native/linux/libMicrosoft.Quantum.Simulator.Runtime.so
src/Simulation/Native/osx/libMicrosoft.Quantum.Simulator.Runtime.dylib
src/Simulation/Native/win10/Microsoft.Quantum.SparseSimulator.Runtime.dll
src/Simulation/Native/linux/libMicrosoft.Quantum.SparseSimulator.Runtime.so
src/Simulation/Native/osx/libMicrosoft.Quantum.SparseSimulator.Runtime.dylib
src/Simulation/Native/win10/Microsoft.Quantum.Experimental.Simulators.Runtime.dll
src/Simulation/Native/linux/Microsoft.Quantum.Experimental.Simulators.Runtime.dll
src/Simulation/Native/osx/Microsoft.Quantum.Experimental.Simulators.Runtime.dll

# Temporary Rust files/dirs.
Cargo.lock
target/
2 changes: 1 addition & 1 deletion AdvantageBenchmark/privateBuild/host.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

<PropertyGroup>
<OutputType>Exe</OutputType>
<TargetFramework>netcoreapp3.1</TargetFramework>
<TargetFramework>net6.0</TargetFramework>
<IncludeQSharpCorePackages>false</IncludeQSharpCorePackages> <!-- otherwise the standard library is included by the Sdk -->
</PropertyGroup>

Expand Down
2 changes: 1 addition & 1 deletion AdvantageBenchmark/privateBuild/runTest.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ for ($tst=1; $tst -le 2; $tst++) {
for ($span=4; $span -ge 0; $span--) {
$env:OMP_NUM_THREADS = $thrd
$env:QDK_SIM_FUSESPAN = $span
.\bin\Release\netcoreapp3.1\host.exe $tst $tst 5
.\bin\Release\net6.0\host.exe $tst $tst 5
}
}
}
2 changes: 1 addition & 1 deletion AdvantageBenchmark/privateBuild/runTest.sh
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ do
do
export OMP_NUM_THREADS=$thrd
export QDK_SIM_FUSESPAN=$span
./bin/Release/netcoreapp3.1/host $tst $tst 5
./bin/Release/net6.0/host $tst $tst 5
done
done
done
2 changes: 1 addition & 1 deletion AdvantageBenchmark/readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ This benchmark is intended to provide an easy way to verify the performance char

## Executing the benchmark

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.
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.

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.

Expand Down
2 changes: 1 addition & 1 deletion AdvantageBenchmark/releasedBuild/host/host.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@

<PropertyGroup>
<OutputType>Exe</OutputType>
<TargetFramework>netcoreapp3.1</TargetFramework>
<TargetFramework>net6.0</TargetFramework>
</PropertyGroup>

</Project>
2 changes: 1 addition & 1 deletion Simulation.sln
Original file line number Diff line number Diff line change
Expand Up @@ -855,7 +855,7 @@ Global
{EB6E3DBD-C884-4241-9BC4-8281191D1F53} = {34D419E9-CCF1-4E48-9FA4-3AD4B86BEEB4}
{E1A463D7-2E23-4134-BE04-1EFF7A546813} = {93409CC3-8DF9-45FA-AE21-16A19FDEF650}
{789C86D9-CE77-40DA-BDDD-979436952512} = {93409CC3-8DF9-45FA-AE21-16A19FDEF650}
{7E24885B-D86D-477E-A840-06FA53C33FE1} = {34D419E9-CCF1-4E48-9FA4-3AD4B86BEEB4}
{7E24885B-D86D-477E-A840-06FA53C33FE1} = {93409CC3-8DF9-45FA-AE21-16A19FDEF650}
{7F80466B-A6B5-4EF1-A9E9-22ABAE3C20C1} = {34D419E9-CCF1-4E48-9FA4-3AD4B86BEEB4}
{7F7BB60A-5DCB-469E-8546-1BE9E3CAC833} = {F6C2D4C0-12DC-40E3-9C86-FA5308D9B567}
{EAC5EAE7-D1B3-4726-AFDB-73000E62176A} = {7F7BB60A-5DCB-469E-8546-1BE9E3CAC833}
Expand Down
17 changes: 7 additions & 10 deletions bootstrap.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -7,25 +7,22 @@ Push-Location (Join-Path $PSScriptRoot "build")
.\prerequisites.ps1
Pop-Location

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

if (-not (Test-Path Env:/AGENT_OS)) { # If not CI build, i.e. local build (if AGENT_OS envvar is not defined)
if ($Env:ENABLE_NATIVE -ne "false") {
Write-Host "Build release flavor of the native simulator"
$Env:BUILD_CONFIGURATION = "Release"
Write-Host "Build release flavor of the full state simulator"
Push-Location (Join-Path $PSScriptRoot "src/Simulation/Native")
.\build-native-simulator.ps1
Pop-Location

Write-Host "Build release flavor of the Sparse Simulator"
Invoke-Expression (Join-Path $PSScriptRoot "src" "Simulation" "NativeSparseSimulator" "build.ps1")

Push-Location (Join-Path $PSScriptRoot "src/Simulation/qdk_sim_rs")
# Don't run the experimental simulator build if we're local
# and prerequisites are missing.
Expand Down
2 changes: 2 additions & 0 deletions build/build.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,8 @@ if ($Env:ENABLE_NATIVE -ne "false") {
if ($LastExitCode -ne 0) {
$script:all_ok = $False
}

( & (Join-Path $PSScriptRoot .. src Simulation NativeSparseSimulator build.ps1) ) || ( $script:all_ok = $False )
} else {
Write-Host "Skipping build of native simulator because ENABLE_NATIVE variable is set to: $Env:ENABLE_NATIVE."
}
Expand Down
2 changes: 1 addition & 1 deletion build/ci.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: $(Build.Major).$(Build.Minor).$(date:yyMM).$(DayOfMonth)$(rev:rr)
name: $(Build.Major).$(Build.Minor).$(DayOfMonth)$(rev:rr)

trigger: none

Expand Down
17 changes: 14 additions & 3 deletions build/pack.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,17 @@ Push-Location (Join-Path $PSScriptRoot ../src/Simulation/Native)
Copy-Item -Verbose "$DROP/Microsoft.Quantum.Simulator.Runtime.dll" "win10/Microsoft.Quantum.Simulator.Runtime.dll"
}

$DROP = "$Env:DROP_NATIVE/src/Simulation/NativeSparseSimulator/build"
Write-Host "##[info]Copying NativeSparseSimulator files from $DROP...";
If (Test-Path "$DROP/libMicrosoft.Quantum.SparseSimulator.Runtime.dylib") {
Copy-Item -Verbose "$DROP/libMicrosoft.Quantum.SparseSimulator.Runtime.dylib" "osx/libMicrosoft.Quantum.SparseSimulator.Runtime.dylib"
}
If (Test-Path "$DROP/libMicrosoft.Quantum.SparseSimulator.Runtime.so") {
Copy-Item -Verbose "$DROP/libMicrosoft.Quantum.SparseSimulator.Runtime.so" "linux/libMicrosoft.Quantum.SparseSimulator.Runtime.so"
}
If (Test-Path "$DROP/Microsoft.Quantum.SparseSimulator.Runtime.dll") {
Copy-Item -Verbose "$DROP/Microsoft.Quantum.SparseSimulator.Runtime.dll" "win10/Microsoft.Quantum.SparseSimulator.Runtime.dll"
}

$DROP = "$Env:DROP_NATIVE/src/Simulation/qdk_sim_rs/drop";
Write-Host "##[info]Copying qdk_sim_rs files from $DROP...";
Expand All @@ -43,7 +54,7 @@ Pop-Location

function Pack-One() {
Param(
$project,
$project,
$option1 = "",
$option2 = "",
$option3 = "",
Expand Down Expand Up @@ -74,7 +85,7 @@ function Pack-One() {

function Pack-Dotnet() {
Param(
$project,
$project,
$option1 = "",
$option2 = "",
$option3 = "",
Expand Down Expand Up @@ -129,7 +140,7 @@ function Pack-Crate() {
$OutPath = Resolve-Path (Join-Path $PSScriptRoot $OutPath);
}
Push-Location (Join-Path $PSScriptRoot $PackageDirectory)
cargo package;
cargo package --allow-dirty;
# Copy only the .crate file, since we don't need all the intermediate
# artifacts brought in by the full folder under target/package.
Copy-Item -Force (Join-Path $PSScriptRoot .. "target" "package" "*.crate") $OutPath;
Expand Down
6 changes: 6 additions & 0 deletions build/steps-codecheck.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,12 @@ steps:
inputs:
versionSpec: '5.6.0'

- task: UseDotNet@2
displayName: 'Use .NET Core SDK 6.0.x'
inputs:
packageType: sdk
version: '6.0.x'

# QIR Runtime:
- pwsh: src/Qir/Runtime/prerequisites.ps1
displayName: "Install QIR Runtime Prerequisites"
Expand Down
4 changes: 2 additions & 2 deletions build/steps-init.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,10 @@ steps:
versionSpec: '5.6.0'

- task: UseDotNet@2
displayName: 'Use .NET Core SDK 3.1.300'
displayName: 'Use .NET Core SDK 6.0.x'
inputs:
packageType: sdk
version: '3.1.300'
version: '6.0.x'

- script: |
curl https://sh.rustup.rs -sSf | sh -s -- -y
Expand Down
2 changes: 2 additions & 0 deletions build/test.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@
$all_ok = $True

if ($Env:ENABLE_NATIVE -ne "false") {
( & (Join-Path $PSScriptRoot .. src Simulation NativeSparseSimulator test.ps1 ) ) || ( $script:all_ok = $False )

$nativeSimulator = (Join-Path $PSScriptRoot "../src/Simulation/Native")
& "$nativeSimulator/test-native-simulator.ps1"
if ($LastExitCode -ne 0) {
Expand Down
2 changes: 1 addition & 1 deletion global.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"msbuild-sdks": {
"Microsoft.Quantum.Sdk": "0.18.2109163417-beta"
"Microsoft.Quantum.Sdk": "0.24.201332"
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ public T GetFileContent<T>(string path)
public async Task<T> GetFileContentAsync<T>(string path, CancellationToken cancellationToken)
{
using var stream = new MemoryStream(Encoding.UTF8.GetBytes(_fileContent));
return await JsonSerializer.DeserializeAsync<T>(stream, null, cancellationToken);
return await JsonSerializer.DeserializeAsync<T>(stream, options: null, cancellationToken);
}
}

Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFramework>netcoreapp3.1</TargetFramework>
<TargetFramework>net6.0</TargetFramework>
<PlatformTarget>x64</PlatformTarget>
<IsPackable>false</IsPackable>
</PropertyGroup>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,8 @@ public static class QuantumMachineFactory
var machineName =
targetNameNormalized is null
? null
: targetNameNormalized.StartsWith("quantinuum.")
? "Microsoft.Quantum.Providers.Quantinuum.Targets.QuantinuumQuantumMachine, Microsoft.Quantum.Providers.Honeywell"
: targetNameNormalized.StartsWith("qci.")
? "Microsoft.Quantum.Providers.QCI.Targets.QCIQuantumMachine, Microsoft.Quantum.Providers.QCI"
: targetNameNormalized.StartsWith("ionq.")
Expand Down
2 changes: 1 addition & 1 deletion src/Azure/Azure.Quantum.Client/Utility/FileSystem.cs
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ public T GetFileContent<T>(string path)
public async Task<T> GetFileContentAsync<T>(string path, CancellationToken cancellationToken)
{
using FileStream stream = File.OpenRead(path);
return await JsonSerializer.DeserializeAsync<T>(stream, null, cancellationToken);
return await JsonSerializer.DeserializeAsync<T>(stream, options: null, cancellationToken);
}
}
}
3 changes: 2 additions & 1 deletion src/Qir/.clang-tidy
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,8 @@
# https://clang.llvm.org/extra/clang-tidy/checks/list.html

Checks:
'bugprone-*,readability-identifier-*,readability-braces-around-statements,cert*,\
'bugprone-*,-bugprone-easily-swappable-parameters,\
readability-identifier-*,readability-braces-around-statements,cert*,\
-llvmlibc-callee-namespace,-llvmlibc-implementation-in-namespace,\
-llvmlibc-restrict-system-libc-headers,-modernize-use-trailing-return-type,\
-fuchsia-default-arguments-calls,-fuchsia-default-arguments-declarations,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
<PropertyGroup>
<OutputType>Exe</OutputType>
<PlatformTarget>x64</PlatformTarget>
<TargetFramework>netcoreapp3.1</TargetFramework>
<TargetFramework>net6.0</TargetFramework>
</PropertyGroup>

<PropertyGroup>
Expand Down
7 changes: 7 additions & 0 deletions src/Qir/Common/cmake/qir_cmake_include.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,13 @@ set(WARNING_FLAGS "${WARNING_FLAGS} -Weverything")
# -Wpre-c++20-compat.
# -Wpre-c++2b-compat-pedantic (= -Wpre-c++2b-compat).

include(CheckCCompilerFlag)
check_c_compiler_flag(-Wreserved-identifier HAVE_RESERVED_IDENTIFIER_WARNING)
if(HAVE_RESERVED_IDENTIFIER_WARNING)
# We need to be able to use `__` prefix for QIR names like `__quantum__rt__*` and `__quantum__qis__*`.
set(WARNING_FLAGS "${WARNING_FLAGS} -Wno-reserved-identifier")
endif()

# https://clang.llvm.org/docs/DiagnosticsReference.html#wc-98-compat-pedantic
set(WARNING_FLAGS "${WARNING_FLAGS} -Wno-c++98-compat-pedantic")

Expand Down
10 changes: 5 additions & 5 deletions src/Qir/Runtime/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ while on macOS, `prerequisites.ps1` relies on the [`brew` package manager](https

#### Windows pre-reqs

1. Install Clang 11, Ninja and CMake from the public distros.
1. Install Clang 13, Ninja and CMake from the public distros.
1. Add all three to your/system `%PATH%`.
1. Install VS 2019 and enable "Desktop development with C++" component (Clang uses MSVC's standard library on Windows).
1. Install clang-tidy and clang-format if your Clang/LLVM packages didn't include the tools.
Expand All @@ -42,11 +42,11 @@ Running cmake from the editors will likely default to MSVC or clang-cl and fail.
1. In the Ubuntu's terminal:
1. `$ sudo apt install cmake` (`$ cmake --version` should return 3.16.3)
1. `$ sudo apt-get install ninja-build` (`$ ninja --version` should return 1.10.0)
1. `$ sudo apt install clang-11` (`$ clang++-11 --version` should return 11.0.0)
1. `$ sudo apt install clang-13` (`$ clang++-13 --version` should return 13.0.0)
1. Set Clang as the preferred C/C++ compiler:
- $ export CC=/usr/bin/clang-11
- $ export CXX=/usr/bin/clang++-11
1. `$ sudo apt install clang-tidy-11` (`$ clang-tidy-11 --version` should return 'LLVM version 11.0.0')
- $ export CC=/usr/bin/clang-13
- $ export CXX=/usr/bin/clang++-13
1. `$ sudo apt install clang-tidy-13` (`$ clang-tidy-13 --version` should return 'LLVM version 13.0.0')
1. Install the same version of dotnet as specified by qsharp-runtime [README](../../../README.md)

See [https://code.visualstudio.com/docs/remote/wsl] on how to use VS Code with WSL.
Expand Down
2 changes: 1 addition & 1 deletion src/Qir/Runtime/lib/QIR/QubitManager.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -423,7 +423,7 @@ namespace Quantum
{
areaIndex = freeQubitsInAreas[(size_t)areaIndex].prevAreaWithFreeQubits;
id = freeQubitsInAreas[(size_t)areaIndex].FreeQubitsReuseAllowed.TakeQubitFromFront(
sharedQubitStatusArray);
sharedQubitStatusArray);
} while ((areaIndex != 0) && (id == NoneMarker));

// We remember previous area where a free qubit was found or 0 if none were found.
Expand Down
Loading