This repository was archived by the owner on Jan 12, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 90
Refactor and rename QIR runtime headers and interfaces #553
Merged
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
cesarzc
approved these changes
Mar 11, 2021
Contributor
cesarzc
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good to me! I like that now measurement is part of IQuantumGateSet.
cgranade
added a commit
that referenced
this pull request
Mar 16, 2021
cgranade
pushed a commit
that referenced
this pull request
Jun 9, 2021
* Experiment to hook up Rust crate to cmake. * Add experimental simulator as rlib crate. * Expanded C API, started consolidating Cargo.toml. * Just the one crate will do. * First unit test of QIR ↔ opensim. * Add rust to builds. * Start adding to CI. * Don't set toolchain in CI. * Started building managed interface. * Add System.Text.Json dependency. * Add native opensim sharedlibs to nupkg. * Updated DLL name in NativeInterface. * downgrade s.t.json. * Fix pack.ps1 paths. * Set --release flag in opensim. * Add get_name. * Added rest of c_api to NativeInterface.cs. * Initial attempt at type1 implementation. * Add open systems data model. * Fix null reference exception by adding explicit qubit manager. * Started using QSharpCore interface temporarily. * Begin adding decompositions for opensim. * Expose noise_model::ideal() through c_api. * Fix json serialization of instruments. * More informative exceptions in SetNoiseModel * Pass DumpMachine through OnDisplayableDiagnostic. * Began addressing warnings and adding unit tests. * A couple more tests. * Started enabling doctests for Rust runtime. * Fix new doctest. * Added more API doc comments. * A bit of code cleanup. * Start adding integration tests for experimental simulator in C# runtime. * Fix teleport test. * Attempt at fixing project-based tests. * One more Rust-side unit test. * Added opensim to local dev props, and reverted bad change to unittests.qs. * Undo one other bad change. * Disable test that depends on Rz. * Started adding Rust-language integration tests. * Added more informative error message when R is not supported. * Forgot to add test data to prev commit. * Start enabling performance reporting for opensim. * Adapt opensim / managed interface to #538. * Adapt QIR / opensim interface to #553. * Apply rust-fmt, and reduce extraneous copying in conjugate_by. * Started weakening from owned arrays to views. * Weakened tensor to views by owning views and borrowing owns. * Started adding microbenchmarks. * extend_two_to_n * Clear diskspace and build microbenchmarks in CI. * Clean more aggressively to avoid disk space issues. * Format, fix warnings, simplify Cargo.toml. * Fix choco rustup in prereqs. * Disable choco rustup. * Fix path to Cargo.toml. * Don't check Rust-style names with clang-tidy. * M is no longer overriden. * Temporarily disable QIR / opensim integration. * Clean up extra cargo files after testing opensim. * Work on API docs and refactoring of Rust crate. * Separate out qdk_sim into its own crate. * Work on testing and enforcing rust fmt. * Run clippy in tests as well. * Add code quality checks to build/test. * Ignore jupyter temps and xplat drops. * Begin exposing build metadata through to C# callers. * Start injecting version number from build into Cargo.toml. * Started infrastructure to expose simulation functionality to Python. * Ignore Python temporaries and build artifacts. * More partial progress on exposing to Python. * Add initial precommit config. * Introduce fmt error. * Add new checks to pre-commit. * Continued integrating CHP into simulator API. * Address clippy warnings. * Work on docs. * Separate out paulis.rs. * Expose more simulation functionality to Python. * Generalize C API to allow using other state representations. * Enable CFG for C / Rust boundaries. * Move Cargo.toml injection into bootstrap. * Fix path from bootstrap to Cargo.toml injection, debug injection. * One more path fix. * One more path fix. * Remove --release from cargo package. * Revert CFG change to cmake. * Fix Rust build script. * Debug artifact paths. * Debug drop paths as well. * More path debugging. * Fix build paths. * Don't cargo clean build artifacts away. * Fix one character typo in Simulators.Dev.props. * Fix one more dev props typo. * Eliminate unneeded copy. * Improve naming conventions in processes.rs. * Fix pack.ps1 to include qdk_sim_rs drops. * Expose more information in exceptions. * Fix one more path. * Add links on cargo-clippy. * Fix issues in C API benchmarking. * Improve Python bindings for NoiseModel. * Improve readme for qdk_sim_rs crate. * Improve noise model handling, add test coverage. * Update System.Text.Json to 4.7.2. * Address clippy warnings. * Don't use new C# 9 features. * Don't store cargo lockfile in repo for now. * Remove outdated gitignore. * Fix serialization test, false negatives. * Use +nightly to run doctests. * Allow serializing and deserializing mixed pauli channels. * Expose as_json to more Python classes. * Added ideal_stabilizer noise model, split up processes, and start CHP decomp. * Allow applying CHP decompositions. * Fix clippy warnings. * Check error conditions on get_noise_model. * Allow for getting/setting noise models by name. * Expose as_json for State to Python. * Added stabilizer states to data model for serialization. * Significantly expanded documentation. * Added header explaining how to call cargo doc. * Fix doctest. * Add extra assertions. * Add more debug outputs to assertion failure. * Fixed assertion. * Fixed assert. * Fix clippy warning. * Update src/Simulation/Simulators/OpenSystemsSimulator/NativeInterface.cs Co-authored-by: Robin Kuzmin <kuzmin.robin@gmail.com> * Fixed C# serialization. * Slight comment fixes. * Fix build failure. * Address review comments. * qdk_sim → qdk_sim_experimental,improve Python version handling. * Revert src/Qir to main. QIR integration deferred to #713. * Add prerequisites.ps1. * Finish reverting QIR. * Generate C++ headers as well as C. * Fixed issue building docs locally with python disabled. * Updated link to tracking issue for experimental sims. * Gate `cargo clean` on CI builds. * Addressing feedback. * Force dependency on S.T.Encodings.Web to be >= 4.7.2. * Adding comment to explain serialization field. * Added README link to experimental simulators doc. * Fix typo. * Add stabilizers to state converter. * Move format/linting checks to build from test. * Fix stabilizer noise model serialization, added new test. * Work on docs. * Fixed some slight issues with n_qubits handling. * Update documentation notebook. * Regenerate notebook from latest build. * Fixed some serialization issues. * Fixed some serialization tests. * Expose build info and fix mixed pauli channels. * Updated documentation notebook from latest build. Co-authored-by: Robin Kuzmin <kuzmin.robin@gmail.com>
cgranade
pushed a commit
that referenced
this pull request
Jun 17, 2021
* Start experimental simulators feature (#709) * Experiment to hook up Rust crate to cmake. * Add experimental simulator as rlib crate. * Expanded C API, started consolidating Cargo.toml. * Just the one crate will do. * First unit test of QIR ↔ opensim. * Add rust to builds. * Start adding to CI. * Don't set toolchain in CI. * Started building managed interface. * Add System.Text.Json dependency. * Add native opensim sharedlibs to nupkg. * Updated DLL name in NativeInterface. * downgrade s.t.json. * Fix pack.ps1 paths. * Set --release flag in opensim. * Add get_name. * Added rest of c_api to NativeInterface.cs. * Initial attempt at type1 implementation. * Add open systems data model. * Fix null reference exception by adding explicit qubit manager. * Started using QSharpCore interface temporarily. * Begin adding decompositions for opensim. * Expose noise_model::ideal() through c_api. * Fix json serialization of instruments. * More informative exceptions in SetNoiseModel * Pass DumpMachine through OnDisplayableDiagnostic. * Began addressing warnings and adding unit tests. * A couple more tests. * Started enabling doctests for Rust runtime. * Fix new doctest. * Added more API doc comments. * A bit of code cleanup. * Start adding integration tests for experimental simulator in C# runtime. * Fix teleport test. * Attempt at fixing project-based tests. * One more Rust-side unit test. * Added opensim to local dev props, and reverted bad change to unittests.qs. * Undo one other bad change. * Disable test that depends on Rz. * Started adding Rust-language integration tests. * Added more informative error message when R is not supported. * Forgot to add test data to prev commit. * Start enabling performance reporting for opensim. * Adapt opensim / managed interface to #538. * Adapt QIR / opensim interface to #553. * Apply rust-fmt, and reduce extraneous copying in conjugate_by. * Started weakening from owned arrays to views. * Weakened tensor to views by owning views and borrowing owns. * Started adding microbenchmarks. * extend_two_to_n * Clear diskspace and build microbenchmarks in CI. * Clean more aggressively to avoid disk space issues. * Format, fix warnings, simplify Cargo.toml. * Fix choco rustup in prereqs. * Disable choco rustup. * Fix path to Cargo.toml. * Don't check Rust-style names with clang-tidy. * M is no longer overriden. * Temporarily disable QIR / opensim integration. * Clean up extra cargo files after testing opensim. * Work on API docs and refactoring of Rust crate. * Separate out qdk_sim into its own crate. * Work on testing and enforcing rust fmt. * Run clippy in tests as well. * Add code quality checks to build/test. * Ignore jupyter temps and xplat drops. * Begin exposing build metadata through to C# callers. * Start injecting version number from build into Cargo.toml. * Started infrastructure to expose simulation functionality to Python. * Ignore Python temporaries and build artifacts. * More partial progress on exposing to Python. * Add initial precommit config. * Introduce fmt error. * Add new checks to pre-commit. * Continued integrating CHP into simulator API. * Address clippy warnings. * Work on docs. * Separate out paulis.rs. * Expose more simulation functionality to Python. * Generalize C API to allow using other state representations. * Enable CFG for C / Rust boundaries. * Move Cargo.toml injection into bootstrap. * Fix path from bootstrap to Cargo.toml injection, debug injection. * One more path fix. * One more path fix. * Remove --release from cargo package. * Revert CFG change to cmake. * Fix Rust build script. * Debug artifact paths. * Debug drop paths as well. * More path debugging. * Fix build paths. * Don't cargo clean build artifacts away. * Fix one character typo in Simulators.Dev.props. * Fix one more dev props typo. * Eliminate unneeded copy. * Improve naming conventions in processes.rs. * Fix pack.ps1 to include qdk_sim_rs drops. * Expose more information in exceptions. * Fix one more path. * Add links on cargo-clippy. * Fix issues in C API benchmarking. * Improve Python bindings for NoiseModel. * Improve readme for qdk_sim_rs crate. * Improve noise model handling, add test coverage. * Update System.Text.Json to 4.7.2. * Address clippy warnings. * Don't use new C# 9 features. * Don't store cargo lockfile in repo for now. * Remove outdated gitignore. * Fix serialization test, false negatives. * Use +nightly to run doctests. * Allow serializing and deserializing mixed pauli channels. * Expose as_json to more Python classes. * Added ideal_stabilizer noise model, split up processes, and start CHP decomp. * Allow applying CHP decompositions. * Fix clippy warnings. * Check error conditions on get_noise_model. * Allow for getting/setting noise models by name. * Expose as_json for State to Python. * Added stabilizer states to data model for serialization. * Significantly expanded documentation. * Added header explaining how to call cargo doc. * Fix doctest. * Add extra assertions. * Add more debug outputs to assertion failure. * Fixed assertion. * Fixed assert. * Fix clippy warning. * Update src/Simulation/Simulators/OpenSystemsSimulator/NativeInterface.cs Co-authored-by: Robin Kuzmin <kuzmin.robin@gmail.com> * Fixed C# serialization. * Slight comment fixes. * Fix build failure. * Address review comments. * qdk_sim → qdk_sim_experimental,improve Python version handling. * Revert src/Qir to main. QIR integration deferred to #713. * Add prerequisites.ps1. * Finish reverting QIR. * Generate C++ headers as well as C. * Fixed issue building docs locally with python disabled. * Updated link to tracking issue for experimental sims. * Gate `cargo clean` on CI builds. * Addressing feedback. * Force dependency on S.T.Encodings.Web to be >= 4.7.2. * Adding comment to explain serialization field. * Added README link to experimental simulators doc. * Fix typo. * Add stabilizers to state converter. * Move format/linting checks to build from test. * Fix stabilizer noise model serialization, added new test. * Work on docs. * Fixed some slight issues with n_qubits handling. * Update documentation notebook. * Regenerate notebook from latest build. * Fixed some serialization issues. * Fixed some serialization tests. * Expose build info and fix mixed pauli channels. * Updated documentation notebook from latest build. Co-authored-by: Robin Kuzmin <kuzmin.robin@gmail.com> * Finish remaining decompositions for initial version of experimental simulators. (#724) * Update documentation notebook for latest IQ# bugfix. * Started work on decompositions. * Added more detail to documentation notebook. * Moved all decomposition logic to Q# operations. * Added more decompositions. * Make known limitations more explicit in README.md. * Move known limitations to Markdown documentation./ * Started adding tests of decompositions. * Added missing `open` statement. * Don't mark decompositions as internal. * Fixed build issue (💕 to @swernli for all the help!) * Unit tests now pass. * Address feedback. * Fix two small build issues. * Added comment explaining reset / release. * Remove DLL added by accident. * Removed one more file added by accident. * Revert "Removed one more file added by accident." This reverts commit 1cc67a3. * Added comment explaining vcomp140.dll. * Call cbindgen manually (#730) * Call cbindgen manually instead of in build.rs. * Updated metadata in Cargo.toml. * Addressing feedback from @swernli. * Update src/Simulation/Simulators/OpenSystemsSimulator/README.md Co-authored-by: Robin Kuzmin <kuzmin.robin@gmail.com> * Update src/Simulation/qdk_sim_rs/docs/c-api.md Co-authored-by: Robin Kuzmin <kuzmin.robin@gmail.com> * Update src/Simulation/qdk_sim_rs/docs/c-api.md * Addressing feedback on c-api.md. Co-authored-by: Robin Kuzmin <kuzmin.robin@gmail.com>
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This is the second change that refactors the QIR runtime to split it into clearly divided chunks (see #549 for the first part). For this part, it renames
ISimulatortoIRuntimeDriverand moves gate set and diagnostic interfaces out into their own headers. While this requires users of the interface to usedynamic_castto convert between interfaces on a object that implementsIRuntimeDriverinstead of using access methods, but that is a necessary evil to disentangle types and allow developers building their own intrinsic set (either for Q# or a different language) to take as a dependency just the headers and libs that correspond to the built-in QIR runtime and not any Q#-specific functionality.This resolves #544.