# Microsoft Quantum Development Kit: Q# runtime #
Welcome to the Microsoft Quantum Development Kit!
This repository contains the runtime components for the [Quantum Development Kit](https://docs.microsoft.com/azure/quantum/).
It consists of the libraries and packages needed to create and simulate quantum applications using Q#.
- **[Azure/](./src/Azure/)**: Source for client package to create and manage jobs in Azure Quantum.
- **[Simulation/](./src/Simulation/)**: Source for Q# simulation. Includes code generation, full-state and other simulators.
- **[xUnit/](./src/Xunit/)**: Source for the xUnit's Q# test-case discoverer.
## New to Quantum? ##
See the [introduction to quantum computing](https://docs.microsoft.com/azure/quantum/concepts-overview) provided with the Quantum Development Kit.
## Installing the Quantum Development Kit
**If you're looking to use Q# to write quantum applications, please see the instructions on how to get started with using the [Quantum Development Kit](https://docs.microsoft.com/azure/quantum/install-overview-qdk) including the Q# compiler, language server, and development environment extensions.**
Please see the [installation guide](https://docs.microsoft.com/azure/quantum/install-overview-qdk) for further information on how to get started using the Quantum Development Kit to develop quantum applications.
You may also visit our [Quantum](https://github.com/microsoft/quantum) repository, which offers a wide variety of samples on how to write quantum based programs.
## Building from Source ##
[![Build Status](https://dev.azure.com/ms-quantum-public/Microsoft%20Quantum%20(public)/_apis/build/status/microsoft.qsharp-runtime?branchName=main)](https://dev.azure.com/ms-quantum-public/Microsoft%20Quantum%20(public)/_build/latest?definitionId=15&branchName=main)
Note that when building from source, this repository is configured so that .NET will automatically look at the [Quantum Development Kit prerelease feed](https://dev.azure.com/ms-quantum-public/Microsoft%20Quantum%20(public)/_packaging?_a=feed&feed=alpha) in addition to any other feeds you may have configured.
### All platforms ###
1. Install the pre-reqs:
* Install [PowerShell](https://docs.microsoft.com/en-us/powershell/scripting/install/installing-powershell).
* Install [CMake](https://cmake.org/install/) 3.20 or newer.
### Windows ###
To build on Windows:
1. Install the pre-reqs:
* Install [Visual Studio 2022](https://visualstudio.microsoft.com/downloads/). Make sure you install the following workloads:
* **Desktop development with C++**
* **Spectre-mitigated libraries. Once Visual Studio has been installed, using the installer for the VS version of interest,
click the"Modify" button, go to the "Individual Components" tab, search for "spectre", select the latest version of "MSVC v143 - VS 2022 C++ x64/x86 Spectre-mitigated libs", and click the "Modify" button to install the selected components**
* **.NET 6.0 Runtime**
* Install [Chocolately](https://chocolatey.org/install). This is required to download other prerequisites if not already installed, such
as LLVM, CMake, Ninja, and Rust. (If these are already installed and on your PATH, then Chocolately may not be needed).
2. Run [bootstrap.ps1](bootstrap.ps1) from PowerShell
* pre-req (in PowerShell): `Set-ExecutionPolicy -ExecutionPolicy RemoteSigned -Scope CurrentUser`
* The script might install additional tools (a specific compiler, build tools, etc)
* Then it builds release flavor of the native (C++) full-state simulator and debug flavor of the Simulation solution.
* You only need to run it once.
3. Open and build the [`Simulation.sln`](./Simulation.sln) solution in Visual Studio.
The `Simulation.sln` solution does not include the full-state quantum simulator. To change it, you can open the `quantum-simulator.sln` solution created during bootstrap in the `src\Simulation\Native\build`. To integrate your changes with the rest of the simulation components, you must manually build it.
### macOS/Linux ###
To build on other platforms:
1. Install the pre-reqs:
* Install [.NET 6.0](https://dotnet.microsoft.com/download) (version lower than 6.0.300 is recommended)
* Install [Homebrew](https://brew.sh/). This is needed to install other prerequisites such as Ninja and LLVM.
* On [WSL](https://docs.microsoft.com/en-us/windows/wsl/)/Linux:
* .NET 6.0: `sudo apt install dotnet-sdk-6.0 dotnet-runtime-6.0`. The possible result can be as in listing B below.
See also other ways [here](https://docs.microsoft.com/en-us/dotnet/core/install/linux) or [here](https://dotnet.microsoft.com/en-us/download).
* Install [`libomp`](https://openmp.llvm.org) needed for the native (C++) full-state simulator.
`sudo apt install libomp-14-dev`. The possible result can be as in listing A below.
Listing A.
```bash
# In an empty directory:
dpkg -l *libomp*
# Desired=Unknown/Install/Remove/Purge/Hold
# | Status=Not/Inst/Conf-files/Unpacked/halF-conf/Half-inst/trig-aWait/Trig-pend
# |/ Err?=(none)/Reinst-required (Status,Err: uppercase=bad)
# ||/ Name Version Architecture Description
# +++-================-=================-============-=================================
# ii libomp-14-dev 1:14.0.0-1ubuntu1 amd64 LLVM OpenMP runtime - dev package
# un libomp-14-doc <none> <none> (no description available)
# un libomp-dev <none> <none> (no description available)
# un libomp-x.y <none> <none> (no description available)
# un libomp-x.y-dev <none> <none> (no description available)
# un libomp5 <none> <none> (no description available)
# ii libomp5-14:amd64 1:14.0.0-1ubuntu1 amd64 LLVM OpenMP runtime
```
Listing B.
```bash
# In an empty directory:
dpkg -l *dotnet*
# Desired=Unknown/Install/Remove/Purge/Hold
# | Status=Not/Inst/Conf-files/Unpacked/halF-conf/Half-inst/trig-aWait/Trig-pend
# |/ Err?=(none)/Reinst-required (Status,Err: uppercase=bad)
# ||/ Name Version Architecture Description
# +++-=========================-============-============-=======================================
# un dotnet <none> <none> (no description available)
# ii dotnet-apphost-pack-6.0 6.0.5-1 amd64 Microsoft.NETCore.App.Host 6.0.5
# ii dotnet-host 6.0.5-1 amd64 Microsoft .NET Host - 6.0.5
# ii dotnet-hostfxr-6.0 6.0.5-1 amd64 Microsoft .NET Host FX Resolver - 6.0.5
# un dotnet-nightly <none> <none> (no description available)
# ii dotnet-runtime-6.0 6.0.5-1 amd64 Microsoft.NETCore.App.Runtime 6.0.5
# ii dotnet-runtime-deps-6.0 6.0.5-1 amd64 dotnet-runtime-deps-debian 6.0.5
# ii dotnet-sdk-6.0 6.0.300-1 amd64 Microsoft .NET SDK 6.0.300
# ii dotnet-targeting-pack-6.0 6.0.5-1 amd64 Microsoft.NETCore.App.Ref 6.0.5
```
2. Run [bootstrap.ps1](./bootstrap.ps1)
* The script might install additional tools (a specific compiler, build tools, etc)
* Then it builds release flavor of the native (C++) full-state simulator and debug flavor of the Simulation solution.
* You only need to run it once.
3. From the command line, run:
* `dotnet build Simulation.sln`
The `Simulation.sln` solution does not include the full-state simulator. To integrate any changes with the rest of the simulation components, you need to manually build it using `make` in the `src\Simulation\Native\build` folder.
## Testing ##
All unit tests are part of the `Simulation.sln` solution. To run the tests:
* From [Visual Studio](https://docs.microsoft.com/en-us/visualstudio/test/getti
没有合适的资源?快使用搜索试试~ 我知道了~
Q#的运行时组件_C#_C++_下载.zip
共1138个文件
cs:399个
qs:344个
hpp:69个
1.该资源内容由用户上传,如若侵权请联系客服进行举报
2.虚拟产品一经售出概不退款(资源遇到问题,请及时私信上传者)
2.虚拟产品一经售出概不退款(资源遇到问题,请及时私信上传者)
版权申诉
0 下载量 166 浏览量
2023-04-21
10:26:36
上传
评论
收藏 10.69MB ZIP 举报
温馨提示
Q#的运行时组件_C#_C++_下载.zip
资源推荐
资源详情
资源评论
收起资源包目录
Q#的运行时组件_C#_C++_下载.zip (1138个子文件)
libomp.so.5 1.08MB
argmaxnrm2_test 98KB
bititerator_test 91KB
bitops_test 17KB
capi_test 67KB
.clang-format 4KB
.clang-format 938B
.clang-tidy 1KB
.clang-tidy 105B
qir_cmake_include.cmake 11KB
secure_dependencies.cmake 4KB
unit_test_include.cmake 1016B
CODEOWNERS 3KB
NuGet.Config 908B
NuGet.Config 488B
App.config 160B
App.config 157B
App.config 157B
App.config 157B
App.config 157B
App.config 157B
SparseSimulatorTests.cpp 35KB
local_test.cpp 30KB
qir.cpp 18KB
capi.cpp 11KB
CSharpIntegrationTests.cpp 11KB
capi_test.cpp 10KB
qir-driver.cpp 9KB
capi.cpp 8KB
dbw_test.cpp 6KB
qir-test-math.cpp 4KB
UseMiscArgs.cpp 4KB
qir-driver.cpp 4KB
qir-driver.cpp 4KB
TestHelpers.cpp 3KB
codegen_test.cpp 3KB
UseRangeArrayArg.cpp 3KB
UseResultArrayArg.cpp 3KB
UseBoolArrayArg.cpp 3KB
UsePauliArrayArg.cpp 2KB
UseIntegerArrayArg.cpp 2KB
UseDoubleArrayArg.cpp 2KB
factory.cpp 2KB
UseRangeArg.cpp 2KB
tinymatrix_test.cpp 2KB
UseResultArg.cpp 2KB
diagmatrix_test.cpp 2KB
UseBoolArg.cpp 2KB
UsePauliArg.cpp 2KB
factory.cpp 2KB
UseStringArg.cpp 2KB
bititerator_test.cpp 2KB
UseIntegerArg.cpp 1KB
UseDoubleArg.cpp 1KB
kernels.cpp 1KB
UseNoArgs.cpp 1KB
argmaxnrm2_test.cpp 1004B
FullstateSimulatorTests.cpp 844B
qir-test-other.cpp 633B
factory_test.cpp 548B
cpuid_test.cpp 499B
openmp_test.cpp 433B
openmp.cpp 418B
simulatoravx512.cpp 412B
simulatoravx2.cpp 390B
qir-test-strings.cpp 372B
simulatoravx.cpp 372B
simulator.cpp 344B
bitops_test.cpp 337B
catch_driver.cpp 288B
cpuid_test 17KB
IQuantumProcessor.cs 47KB
GenericsTests.cs 45KB
RuntimeMetadataTests.cs 41KB
Driver.cs 27KB
SimulatorBase.cs 24KB
QubitManager.cs 24KB
QirCppDriver.cs 23KB
VerifyGates.cs 22KB
QubitManagerRestrictedReuse.cs 22KB
QArray.cs 21KB
BasicTests.cs 20KB
QCTraceSimulator.cs 20KB
Azure.cs 18KB
ToffoliSimulator.cs 18KB
QCTraceSimulatorCore.cs 18KB
PortablePDBReader.cs 18KB
CoreTests.cs 17KB
SimulatorBaseTests.cs 16KB
GetQubitsTests.cs 16KB
DebuggingToolsTests.cs 16KB
SortedQubitPool.cs 16KB
WorkspaceTest.cs 16KB
QubitManagerTests.cs 15KB
StackTrace.cs 15KB
DepthCounter.cs 15KB
StackTraceTests.cs 14KB
TypeExtensions.cs 14KB
CodeGenerator.cs 14KB
IQuantumMachine.cs 12KB
共 1138 条
- 1
- 2
- 3
- 4
- 5
- 6
- 12
资源评论
快撑死的鱼
- 粉丝: 1w+
- 资源: 9154
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功