Граф коммитов

576 Коммитов

Автор SHA1 Сообщение Дата
XField 85190d2bec
Azure Quantum client: Add environment variable to set User-Agent prefix (#805)
* Add environment variable to set User-Agent prefix

* Reuse QuantumJobClientOptions to pass the user-agent prefix
2021-08-25 06:54:49 -07:00
Robin Kuzmin 7bf27f0b3b
Fixed the yml file. (#803) 2021-08-20 23:39:21 +00:00
Robin Kuzmin 262e7bd7fc
Optimizing the `microsoft.qsharp-runtime.sanitized` pipeline (#802)
Made the microsoft.qsharp-runtime.sanitized pipeline minimalistic.
2021-08-20 02:33:24 +00:00
César Zaragoza Cortés 487c143169
Add Validate method to the IQirSubmitter interface (#799)
* Create Validate member for IQirSubmitter interface.
* Use Validate for --dry-run option when submitting QIR.
* Removed extra blank line.
2021-08-18 20:42:19 -07:00
Robin Kuzmin 9f35c0b162
Enabled the clang-format check (#794)
* Added `check-sources-formatted.ps1`
* Enabled the format checking.
* Build QIR RT first.
* Renamed src/Qir/Common/externals to src/Qir/Common/Externals
* Excluded FullStateDriverGenerator.
* Excluded Mac from clang-formatting.
2021-08-18 07:22:52 +00:00
Stefan J. Wernli b57d34d5d4
Linux development fixes (#770)
* Fixes for Linux devcontainer development

This includes a mix of fixes for successful development within the devcontianer:

 - Update Dockerfile to include updated version of CMake.
 - Update prerequisites.ps1 to actually call experimental simlator prereq script.
 - Update experimental sim prereq script to include nightly toolchain.
 - Remove explicit sudo from QIR prereq script.
 - Use correct environment vars for experimental sim in build script output.
 - Fix native sim OMP thread count set to only occur if OMP is enabled.

* Use 'su -c' instead of 'sudo' for better compatibility

* Adjust `su` usage

* Explicitly check for presence of `sudo`

* Use specific CMake version, skip jq install

* Moving to universal dev container used by the other Azure SDKs

* Moving to universal dev container used by the other Azure SDKs

* Update gitignore for python .venv folder

Co-authored-by: bettinaheim <34236215+bettinaheim@users.noreply.github.com>
Co-authored-by: Ian Davis <Ian.F.Davis@microsoft.com>
2021-08-18 01:11:38 +00:00
Stefan J. Wernli ec491fee57
Check qubit release/measurement status on release (#796)
* Check qubit release/measurement status on release

This mimics the same behavior in the QIR Runtime wrapper for the fullstate simulator as what we have for C#, namely that a qubit is valid for release if and only if it is either in the ground state or the last operation on that qubit was measure.

This fixes #552, and supersedes #710.

* CR feedback

* Revert mutex change
2021-08-17 14:17:19 -07:00
Stefan J. Wernli 292976c8b9
Fixing use of `mutex()` to avoid subtle bug (#798)
* Fixing use of `mutex()` to avoid subtle bug

This change fixes what seems to be a subtle bug in the syncrhonization mechanisms for the simulator. In particular, we have seen intermediate failures in the simulator tests that seem to be the result of a simulator thread stepping on another thread. As @kuzminrobin pointed out in https://github.com/microsoft/qsharp-runtime/pull/710#discussion_r646051059, this could be due to the fact that the mutex access method, `mutex()` has the same signature as the standard constructor for mutex. This could mean that if the compilation environment has a `using namespace std;` anwhere in it that the calls to `mutex()` would allocate a fresh mutex rather than access the member mutex, meaning none of the threads are synchronized as expected. This avoid the problem by renaming the accessor to `getmutex()`.

* Update calls in macro
2021-08-17 10:19:34 -07:00
Stefan J. Wernli 904a9422f3
Update target package intrinsic names (#789)
This updates the custom instruction names set by the `TargetInstruction` attribute in the Type1, Type2, and Type3 target packages so that they match the naming conventions in the QIR spec. This will avoid unnecessary duplication of instructions, such as `__quantum__qis__x__body` vs `__quantum__qis__x`.
2021-08-17 04:09:11 +00:00
Sarah Marshall fafc45414a
Build QIR entry points in series instead of in parallel (#797) 2021-08-16 23:32:23 +00:00
Chris Granade f6d9cf0292
Only pack crate file, not entire package directory. (#777)
* Only pack crate file, not entire package directory.

* Revert +nightly, as that toolchain is not available in e2e pack steps.
2021-08-16 21:52:02 +00:00
Sonia Lopez d2be3edc80
Updating deprecated code snippet (#775)
Co-authored-by: Chris Granade <chgranad@microsoft.com>
2021-08-16 20:01:02 +00:00
DmitryVasilevsky 2f6fa50fa7
Updated comment on qubit representation (#791)
Co-authored-by: Dmitry Vasilevsky <dmitryv@microsoft.com>
2021-08-13 10:10:37 -07:00
Xinyi Joffre b19ecbb0de
Add support for custom TokenFileCredential (#792)
* Add TokenFileCredential to DefaultQuantumCredential

* Add xml documentation

* Fix spelling error in comment

Co-authored-by: Zander Chocron <alchocro@microsoft.com>

* Apply comment and header fixes from code review

Co-authored-by: Chris Granade <chgranad@microsoft.com>

* Combine constructors

* Add missing file header

Co-authored-by: Zander Chocron <alchocro@microsoft.com>
Co-authored-by: Chris Granade <chgranad@microsoft.com>
2021-08-12 18:53:39 +00:00
César Zaragoza Cortés 8c1d27f07c
Remove dependency to Microsoft.Quantum.Simulation.Common from Microsoft.Quantum.Qir.Runtime package (#786)
* Remove references that are not needed.

* Fix externals not copying to output directory.

* Changes to Microsoft.Quantum.Simulators package.

* Change the assumed directory where simulator libraries are placed.

* Add native simulator libraries using native default names as content files.

* Add corresponding content files to be copied to the output folder.

* Use wildcard instead of hardcoded files.

* Use the original platform names in the runtimes folder.

* Rename quantum simulator library name to use automatic search.

* Update Simulators.Dev.props to use the correct library name depending on the platform.

* Use filename and extension instead of duplicating logic.
2021-08-12 00:39:53 -07:00
Sarah Marshall 7afd4952eb
Fix parse error in CMake command-line arguments (#793) 2021-08-12 01:49:25 +00:00
Robin Kuzmin f76ca96d38
Reformatted the C++ sources according to clang-format rules. (#788)
* Reformatted the C++ sources according to clang-format rules.
2021-08-11 15:26:20 -07:00
Robin Kuzmin 59b10b8f64
Updated the .clang-format file (#787) 2021-08-06 14:15:26 -07:00
Robin Kuzmin ee79198788
Sanitizing CI (#776)
* Tested the new (sanitized) pipeline
2021-08-05 20:24:55 -07:00
Robin Kuzmin 6de48c8f21
Preparing for the new pipeline (#785)
* Preparing for the new pipeline
* Increased the Build job timeout.
2021-08-04 15:54:13 -07:00
Mathias Soeken 6958841109
Make step run before syntax tree trimming. (#752) 2021-08-04 17:26:53 +02:00
Stefan J. Wernli 85b62b2319
Use Directory.Build.props to suppress test docgen (#784)
We incorrectly generate documentation for a couple of test projects that we forgot to add `<QSharpDocsGeneration>false</QSharpDocsGeneration>` to. So that we don't have to rely on remembering to include this in each new project, we can use a Directory.Build.props to enforce this setting in the whole test directory.
2021-08-02 13:14:46 -07:00
Stefan J. Wernli 6dd7b75061
Update target packages for QIR emission (#773) 2021-07-24 20:36:50 +00:00
bettinaheim f3b25549cc
Combining QIR build tools and runtime into one package (#782) 2021-07-22 15:24:46 +00:00
Andres Paz 4a5678a9ab
Truncate user-agent (#781) 2021-07-22 08:37:34 +00:00
Andres Paz 9203c00a5e
Adding option to provider UserAgent when submitting jobs to Azure Quantum. (#774) 2021-07-20 17:49:02 +00:00
Robin Kuzmin 1f4f5f5f4d
Added user provided seed to CFullStateSinulator (#780) 2021-07-19 16:54:09 +00:00
Stefan J. Wernli 497a2f58d2
Update Simulator default random seed (#779)
* Update QIR Fullstate Simulator wrapper RNG

This updates the QIR wrapper around the fullstate simulator to explicitly set the seed in order to ensure that measurement sequences are not deterministic.

* Push fix into simulator itself
2021-07-17 01:17:09 +00:00
Andres Paz 4c05032aef
Tweak env variables for Live tests (#756)
* Change prefix of Live test env variable

* Change subscription
2021-07-16 00:58:08 -07:00
Andres Paz 18243ccde0
Rename environment variables for Live tests. (#778) 2021-07-16 00:54:51 +00:00
Scott Carda abf94c5ab2
Add a Test Project for Microsoft.Simulator (#771) 2021-07-14 10:19:06 -07:00
Robin Kuzmin d48a6cccb1
Added Undefined Behavior Sanitizer, fixed a few issues. (#765)
* Added UBSan and ASan.
* Updated the `catch2/catch.hpp`.
2021-07-13 09:57:16 -07:00
Scott Carda bf88f7d307
Changed location of copied QSimDll. (#763) 2021-07-08 14:21:07 -07:00
César Zaragoza Cortés 9fa45deda6
Merge feature/azure-quantum-simulator to main (#761)
* Setup controller project (#597)
* Implement dependencies and tests (#626)
* Refactor controller into library (#642)
* Move QIR driver generator (#660)
* Ignore line breaks for testing purposes. (#671)
* Microsoft.Quantum.Qir.Tools package (#670)
* QIR Build From Q# DLL (#658)
* Add test for test.submitter.noop with Q#
* Command-Line Compiler (#681)
* QIR Command Line Tool - Automatically Use Required Resources (#704)
* QIR Command Line Tool - Packaging Fixes (#723)
* Update QIR submitter factory regex. (#728)`
Co-authored-by: Bettina Heim <beheim@microsoft.com>
* Fix QIR Simulator dll load (#760)
* Fix QIR Simulator dll load
* Fixing link (#762)
* Adding entry point operation loader (#766)
Co-authored-by: Zander Chocron <alchocro@microsoft.com>
Co-authored-by: Sarah Marshall <sarah.marshall@microsoft.com>
Co-authored-by: Sarah Marshall <33814365+samarsha@users.noreply.github.com>
Co-authored-by: Scott Carda <55811729+ScottCarda-MS@users.noreply.github.com>
Co-authored-by: Scott Carda <sccarda@microsoft.com>
Co-authored-by: Bettina Heim <beheim@microsoft.com>
Co-authored-by: bettinaheim <34236215+bettinaheim@users.noreply.github.com>
Co-authored-by: Stefan J. Wernli <swernli@microsoft.com>
2021-07-08 11:41:56 -07:00
Stefan J. Wernli d39722a888
Enable Speculative Load Hardening and Retpoline (#768) 2021-07-07 17:34:31 -07:00
Stefan J. Wernli a4893d898d
Add required props files for target packages (#715)
This adds the props files needed so that the target packages produced can be loaded with `IsTargetPackage="true"` in a consumers csproj file.
2021-06-28 20:13:27 +00:00
Robin Kuzmin 0dd317f83c
Resolved some more compiler warnings. (#753)
* Added "-Wshadow-all"
* Added "-Wmissing-prototypes"
* Added "-Weverything"
2021-06-28 10:38:53 -07:00
Stefan J. Wernli 4f32b5bbd6
Remove CSharpGeneration package (#722) 2021-06-26 04:11:20 +00:00
Angela Burton b3a3349ea7
Fix broken link (#754) 2021-06-25 15:32:25 -07:00
Angela Burton 0826903c08
Fix broken links (#737) 2021-06-23 20:47:00 +00:00
Chris Granade 7be564b5d0
New example notebook with conceptual overview of open quantum systems. (#750)
* New example notebook with conceptual overview of open quantum systems.

* Clarify that open systems simulators are preview.

* One more "experimental" → "preview."
2021-06-23 19:14:54 +00:00
Andres Paz e63c06bfd0
Make sure AAD token is passed down. (#751) 2021-06-23 02:29:52 +00:00
Robin Kuzmin ce8c50ffc7
Cleaned up the "-Wshorten-64-to-32" and "-Wsign-conversion" warnings. (#735)
* Cleaned up the "-Wshorten-64-to-32" warnings.
* Resolved the "-Wconversion" warnings.
2021-06-22 15:51:12 -07:00
Andres Paz 45d5ae0d46
Support to automatically check for device code if all other auth sources failed. (#746) 2021-06-22 07:51:00 +00:00
bettinaheim 9aa9e47013
Release/v0.18.2106 including fixes for AutoSubstitution (#748) 2021-06-21 22:34:48 -07:00
Chris Granade 37f2dbec54
Fix #744. (#745) 2021-06-21 17:42:07 +00:00
Chris Granade 785b0d38d2
Warn when qdk_sim is missing instead of failing outright. (#739) 2021-06-18 20:16:30 -07:00
DmitryVasilevsky 6d83bfa319
Qubit manager optimizations (#712)
Optimized computation complexity of allocate() to be O(1) amortized (worst case of a single call is still O(number of nested areas)).
Removed support for EncourageReuse. This is always assumed to be true.
Added more unit tests.

* Allocate is O(1) amortized, EncourageReuse=false not supported.
* Removed mayReuseQubits, added tests
* Added comments to prevAreaWithFreeQubits

Co-authored-by: Dmitry Vasilevsky <dmitryv@microsoft.com>
2021-06-18 12:46:34 -07:00
Andres Paz f576afb5c7
Removing AssemblyInfo as internals are not needed (#734) 2021-06-17 19:04:20 +00:00
Andres Paz ea1cfec13a
Migration of Azure Quantum .NET components to track2 (#716)
* Replace generated files in Quantum.Client with reference to the Azure.QuantumJobs package (#697)

* Changes to enable Mocks for iq# and integrate with Live tests (#707)

* Credentials parameter (#721)

* Move to CredentialFactory.

* Adding support for DeviceCode

* Merge main (#731)

* Update API docs with more examples. (#701)

Co-authored-by: Stefan J. Wernli <swernli@microsoft.com>

* QIR runtime heap alloc and heap free functions removed (#703)

* QIR runtime heap alloc and heap free functions removed

* Implement Feedback

Co-authored-by: Stefan J. Wernli <swernli@microsoft.com>

* Add QIR Runtime to bootstrap script (#706)

* Increasing the CMAKE required version for QIR (#708)

This updates the required version for CMAKE in the CMakeLists.txt files for QIR, since we are now using features not correctly supported on older versions.

* Added first version of Qubit manager to QIR (#696)

This is the first version of the native Qubit Manager for QIR. Initial unit tests are included.

Qubit Manager supports

* Allocation and release of qubits including arrays of qubits.
* Reuse encouraged/discouraged. Extending capacity enabled/disabled.
* Restricted reuse areas and segments to support low-depth circuits.

Qubit manager builds and tests are run as part of the qir-runtime-unittests. It is used in the bridge to the full state simulator.

Commits:
* Added first draft version of Qubit manager to QIR
* Review feedback. Rearranged functions, QubitIdType, consts, etc.
* include cstring for memcpy
* Renamed QubitManager
* Adjustment after QubitManager rename
* Moved QubitManager.h to public
* Using QubitManager, adjusted defaults, minor fixes
* Removed unused comment
* CR feedback: fixes to types, failures, braces, etc.
* CR feedback - updated types, unique_ptr, etc.
* Auxilliary stuff is now nested in CQubitmanager
* Initializer lists
* Updated CRestrictedReuseAreaStack and used iterator.
* int32_t, more checks, some refactoring
* Refactoring: marking and counting is done in allocate/release qubit id
* Deletion of qubit object, protected members for overrides, Is...Qubit renames
* Moved allocated marking to listQubitListInSharedArray class
* Added comments, mostly status array
* Tests, refactoring, replaced IsFreeQubit with IsFreeQubitId

Co-authored-by: Dmitry Vasilevsky <dmitryv@microsoft.com>

* Added treating warnings as errors (#718)

* Added "QIR Runtime API Design Guidelines" (#711)

* Initial add of QIR-RT-API-Design-Guidelines.md
* Use of exceptions recommendation (#719)
* Co-authored-by: Mathias Soeken
* Co-authored-by: DmitryVasilevsky

* Auto emulation rewrite step (#514)

* First proposal for auto emulation feature.

* Deprecation.

* Update to newer version.

* Successful tests.

* Compatibility checks.

* Do not change this file.

* Signature checking too restrictive.

* Add integration test.

* Update QDK version.

* Incorporate Microsoft/QuantumLibraries#426.

* Rename emulation to substitution.

* Rename projects and directories.

* Packaging.

* Fix line-feed problems.

* Fix LF.

* Adressing reviewer feedback.

* Update Sdk version.

* Fixes dependency error.

Co-authored-by: Mathias Soeken <masoeken@microsoft.com>
Co-authored-by: Chris Granade <chgranad@microsoft.com>
Co-authored-by: Stefan J. Wernli <swernli@microsoft.com>

* Added compiler warning flags -Wall, -Wextra (#725)

* Added -Wall, -Wextra

* Add DelaySign.cs to AutoSubstitution project. (#729)

* extra sln

Co-authored-by: Chris Granade <chgranad@microsoft.com>
Co-authored-by: Stefan J. Wernli <swernli@microsoft.com>
Co-authored-by: Pankaj Patil <pankaj.patil2099@hotmail.com>
Co-authored-by: DmitryVasilevsky <60718360+DmitryVasilevsky@users.noreply.github.com>
Co-authored-by: Dmitry Vasilevsky <dmitryv@microsoft.com>
Co-authored-by: Robin Kuzmin <kuzmin.robin@gmail.com>
Co-authored-by: Mathias Soeken <mathias.soeken@microsoft.com>
Co-authored-by: Mathias Soeken <masoeken@microsoft.com>

* Apply suggestions from code review

Co-authored-by: Chris Granade <chgranad@microsoft.com>

* Incorporating feedback.

* Build 0.17.2106.147878.

Co-authored-by: Chris Granade <chgranad@microsoft.com>
Co-authored-by: Stefan J. Wernli <swernli@microsoft.com>
Co-authored-by: Pankaj Patil <pankaj.patil2099@hotmail.com>
Co-authored-by: DmitryVasilevsky <60718360+DmitryVasilevsky@users.noreply.github.com>
Co-authored-by: Dmitry Vasilevsky <dmitryv@microsoft.com>
Co-authored-by: Robin Kuzmin <kuzmin.robin@gmail.com>
Co-authored-by: Mathias Soeken <mathias.soeken@microsoft.com>
Co-authored-by: Mathias Soeken <masoeken@microsoft.com>
2021-06-17 09:57:27 -07:00