Runtime components for Q#
Перейти к файлу
Stefan J. Wernli da1872db68
Readme updates (#1164)
* Update readme

* Update readme

* use https
2024-01-12 09:45:21 -08:00
.cargo Remove unused Rust sys crate, minor clean up (#1077) 2022-08-25 08:40:28 +00:00
.devcontainer Migrate toolchain to LLVM 13 (#924) 2022-02-03 09:11:59 +00:00
.github Adding secondary owner for CODEOWNERS (#1088) 2022-09-16 23:31:54 +00:00
AdvantageBenchmark Adopt .NET6 + VS2022 in Quantum Development Kit (#966) 2022-03-17 15:28:38 -07:00
build Stopped creation of qdk_sim_rs rust crate (#1154) 2023-09-12 17:12:01 -07:00
documentation New example notebook with conceptual overview of open quantum systems. (#750) 2021-06-23 19:14:54 +00:00
src Updated Azure Identity from 1.5.0 to 1.10.4 (#1163) 2023-11-29 13:02:40 -08:00
.gitattributes Prevent GitHub from excluding the build/ directory (#1141) 2023-04-05 15:11:23 -07:00
.gitignore Fixing piplines (cargo.lock, clang 16, ubuntu 20.04, CLI11, etc.) (#1151) 2023-08-31 00:39:50 +00:00
.pre-commit-config.yaml Experimental simulators feature (#720) 2021-06-16 18:19:58 -07:00
.sscignore Add exemption file for Central Feed Services onboarding (#1084) 2022-09-01 14:52:47 -07:00
CONTRIBUTING.md Fix broken documentation links (#584) 2021-03-25 02:12:35 +00:00
Cargo.lock Fixing piplines (cargo.lock, clang 16, ubuntu 20.04, CLI11, etc.) (#1151) 2023-08-31 00:39:50 +00:00
Cargo.toml Replace C++ QIR Runtime with Rust QIR stdlib (#1087) 2022-09-16 11:43:00 -07:00
LICENSE Initial commit 2019-06-06 10:20:50 -07:00
NOTICE.txt Add support for target packages (merge from feature/decomp) (#476) 2021-01-28 19:06:27 -08:00
NuGet.Config Fixing CI (#1148) 2023-07-26 09:55:03 -07:00
README.md Readme updates (#1164) 2024-01-12 09:45:21 -08:00
SECURITY.md Adding Microsoft SECURITY.MD (#1017) 2022-07-26 21:04:49 +00:00
Simulation.sln Remove references to Microsoft.Simulator target (#1144) 2023-05-01 22:19:28 +00:00
bootstrap.ps1 Disable criterion to avoid dependency issue (#1161) 2023-10-26 19:29:15 +00:00
cspell.json Support for continuous-angle rotations in Rust and C# layers of open systems simulator. (#1009) 2022-06-04 14:02:12 -07:00
global.json Update version to 0.28.302812 (#1155) 2023-09-19 09:29:45 -07:00
omnisharp.json Support for continuous-angle rotations in Rust and C# layers of open systems simulator. (#1009) 2022-06-04 14:02:12 -07:00
rust-toolchain Replace C++ QIR Runtime with Rust QIR stdlib (#1087) 2022-09-16 11:43:00 -07:00

README.md

DEPRECATION NOTICE

This repository is deprecated.

For the Modern QDK repository, please visit Microsoft/qsharp.

You can also try out the Modern QDK in VS Code for Web at vscode.dev/quantum.

For more information about the Modern QDK and Azure Quantum, visit https://aka.ms/AQ/Documentation.

Classic QDK

This repository contains the runtime components for the Quantum Development Kit. It consists of the libraries and packages needed to create and simulate quantum applications using Q#.

  • Azure/: Source for client package to create and manage jobs in Azure Quantum.
  • Simulation/: Source for Q# simulation. Includes code generation, full-state and other simulators.
  • xUnit/: Source for the xUnit's Q# test-case discoverer.

New to Quantum?

See the introduction to quantum computing 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 including the Q# compiler, language server, and development environment extensions.

Please see the installation guide for further information on how to get started using the Quantum Development Kit to develop quantum applications. You may also visit our Quantum repository, which offers a wide variety of samples on how to write quantum based programs.

Building from Source

Build Status

Note that when building from source, this repository is configured so that .NET will automatically look at the Quantum Development Kit prerelease feed in addition to any other feeds you may have configured.

All platforms

  1. Install the pre-reqs:

Windows

To build on Windows:

  1. Install the pre-reqs:

    • Install Visual Studio 2022. 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. 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 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 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 (version lower than 6.0.300 is recommended)
    • Install Homebrew. This is needed to install other prerequisites such as Ninja and LLVM.
    • On 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 or here.
      • Install libomp 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.

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

# 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
  1. Run 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.
  2. 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:
    • Open Test Explorer by choosing Test > Windows > Test Explorer from the top menu bar.
    • Run your unit tests by clicking Run All.
  • From the command line, run:
    • dotnet test Simulation.sln

Feedback

If you have feedback about the Q# simulators or any other runtime component, please let us know by filing a new issue! If you have feedback about some other part of the Microsoft Quantum Development Kit, please see the contribution guide for more information.

Reporting Security Issues

For information on how to report a security issue on this repository, please review the guidance in SECURITY.md.

Contributing

This project welcomes contributions and suggestions. Most contributions require you to agree to a Contributor License Agreement (CLA) declaring that you have the right to, and actually do, grant us the rights to use your contribution. For details, visit https://cla.microsoft.com.

When you submit a pull request, a CLA-bot will automatically determine whether you need to provide a CLA and decorate the PR appropriately (e.g., label, comment). Simply follow the instructions provided by the bot. You will only need to do this once across all repos using our CLA.

This project has adopted the Microsoft Open Source Code of Conduct. For more information see the Code of Conduct FAQ or contact opencode@microsoft.com with any additional questions or comments.

For more details, please see CONTRIBUTING.md, or the contribution guide.