-
Notifications
You must be signed in to change notification settings - Fork 156
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Updating experimental/python with updates from main #944
Merged
bettinaheim
merged 43 commits into
NVIDIA:experimental/python
from
bettinaheim:experimental/python
Nov 28, 2023
Merged
Updating experimental/python with updates from main #944
bettinaheim
merged 43 commits into
NVIDIA:experimental/python
from
bettinaheim:experimental/python
Nov 28, 2023
Conversation
This file contains 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
* Add cutensornet-based simulator backends * Fix code format * Missing Python cuquantum dependency version bump * Update code comments * Update runtime/nvqir/cutensornet/tensornet_state.cpp Co-authored-by: Ben Howe <141149032+bmhowe23@users.noreply.github.com> * Address code review comments * Address code review comments * Address PR comments: cmake and comments for external plugin interface * updates to tensornet mpi * Update runtime/nvqir/cutensornet/tensornet_state.cpp Co-authored-by: Ben Howe <141149032+bmhowe23@users.noreply.github.com> * Refactor MPI support code in tensornet backend * update a code comment for clarity * Update unittests/integration/ghz_nisq_tester.cpp * Fix a couple of compiler warnings on Clang Thanks @bmhowe23 for spotting them. - Dead `default` switch case. Clang doesn't like it. - Missing a default virtual destructor and one inconsistent declaration. - Update the example to be generic with/without cutensornet MPI support. * escape code comments from spell checking --------- Co-authored-by: Ben Howe <141149032+bmhowe23@users.noreply.github.com> Co-authored-by: Bettina Heim <heimb@outlook.com>
…ckends (NVIDIA#901) * Missing GPU_REQUIREMENTS field in the config file An oversight of not having this field caused problems in the validation. Previously, tensornet backend was pulled in after deployment hence no problem. * Skipped some tests in publishing validation step (GPU backends) for MPS
…#877) * * Allow the environment variable to override the default target -- Added an environment variable - CUDAQ_DEFAULT_SIMULATOR -- Check value against valid simulators -- Added basic tests * Update tools/nvqpp/nvq++.in Co-authored-by: Eric Schweitz <eschweitz@nvidia.com> * * Check environment variable and GPU availability in the LinkedLibraryHolder constructor. * * Clean up code from Python cudaq module (moved to LinkedLibraryHolder) * Update python/utils/LinkedLibraryHolder.cpp Co-authored-by: Ben Howe <141149032+bmhowe23@users.noreply.github.com> * * Addressing review comments - enhanced tests * * Explicitly set simulator along with target * * Addressing review comments - Python tests modified for clarity * Initializing current target to default in Python * Update python/utils/LinkedLibraryHolder.cpp Co-authored-by: Eric Schweitz <eschweitz@nvidia.com> * Update python/utils/LinkedLibraryHolder.h Co-authored-by: Eric Schweitz <eschweitz@nvidia.com> * Update python/utils/LinkedLibraryHolder.h Co-authored-by: Eric Schweitz <eschweitz@nvidia.com> * * Removing 'NULL' check --------- Co-authored-by: Eric Schweitz <eschweitz@nvidia.com> Co-authored-by: Ben Howe <141149032+bmhowe23@users.noreply.github.com>
This PR - Revises the install guide, and thereby fixes NVIDIA#849, NVIDIA#748, NVIDIA#513, and NVIDIA#353, as well as covers the two items with a checkmark in NVIDIA#845 - Removes the section about logging in to NGC, and (validating this) updates integration tests to use the NGC image - Fixes various typos in the tutorials
* QuantinuumTester: allow a little bit more tolerance * Change OQC port to unique number to allow it to run in parallel with other tests * Update py_testing_utils.cpp to use the correct simulator, which is now required because the default is no longer purely qpp * Sleep for 3 seconds instead of 1 during tests to allow test initialization to complete. (It's longer for GPU backend than CPU backend.)
* Reduce test time, especially for tensornet backends (1) Some VQE tests/examples need L-BFGS e.g., H2 example: 36 params => ~ 72 evals needed per iteration We don't expose L-BFGS's maxLineSearchTrials (inner loop of the search); hence were not able to limit the number of runs (knowing that it has converged). Add this params and set them accordingly. (2) The gate_library_tester.cpp did lots of simulation (small circuits) to verify the unitary matrices of these kernels. Reduced the load on tensornet backends (not very efficient for these super small circuits). (3) Lower the number of shots in case where we are expecting certain bitstrings, i.e., no need to get a large number of shots. * fix clang compiler warnings: unused variables * Fix a bad merge conflict * Update docs/sphinx/examples/cpp/basics/cuquantum_backends.cpp Co-authored-by: Eric Schweitz <eschweitz@nvidia.com> * Address CR: simplify type casting in bernstein_vazirani.cpp example --------- Co-authored-by: Bettina Heim <heimb@outlook.com> Co-authored-by: Eric Schweitz <eschweitz@nvidia.com>
…e to override it (NVIDIA#899) * * 📝 Adding documentation about default target and the environment variable to override it. * Update docs/sphinx/using/simulators.rst Co-authored-by: Bettina Heim <heimb@outlook.com> * Update docs/sphinx/using/simulators.rst Co-authored-by: Bettina Heim <heimb@outlook.com> * * Applied clang formatting on the modified source file. * * Added a clarifying statement about Python API (from PR#877). * * Added explicit targets to reference specific simulators. --------- Co-authored-by: Bettina Heim <heimb@outlook.com>
* [NFC] Move a transformation pass. Moves the transformation pass, ref to veq, from the CodeGen directory to the Transforms directory. This puts it the same place as related passes like factor quantum alloc and combine quantum alloc. * clang-format
Minor code maintenance to update factory functions and uses of same. These changes do not change behavior, but make uses more uniform.
This pass converts the "value semantics" form of the quake dialect from the "pruned control relations" form to the "linear control relations" form. The pruned form is the less constrained IR representation while the latter is overly constrained. The following examples illustrate the distinction. This is a sequence of ctrl-x ops in pruned form: %10 = quake.to_ctrl %0 : (!quake.wire) -> !quake.control %11 = quake.x [%10] %1 : (!quake.control, !quake.wire) -> !quake.wire %12 = quake.x [%10] %2 : (!quake.control, !quake.wire) -> !quake.wire %13 = quake.x [%10] %3 : (!quake.control, !quake.wire) -> !quake.wire %14 = quake.x [%10] %4 : (!quake.control, !quake.wire) -> !quake.wire %15 = quake.x [%10] %5 : (!quake.control, !quake.wire) -> !quake.wire %16 = quake.x [%10] %6 : (!quake.control, !quake.wire) -> !quake.wire %17 = quake.x [%10] %7 : (!quake.control, !quake.wire) -> !quake.wire %18 = quake.x [%10] %8 : (!quake.control, !quake.wire) -> !quake.wire %19 = quake.x [%10] %9 : (!quake.control, !quake.wire) -> !quake.wire %20 = quake.from_ctrl %10 : (!quake.control) -> !quake.wire This is the same sequence in linear form: %10:2 = quake.x [%0] %1 : (!quake.wire, !quake.wire) -> (!quake.wire, !quake.wire) %11:2 = quake.x [%10#0] %2 : (!quake.wire, !quake.wire) -> (!quake.wire, !quake.wire) %12:2 = quake.x [%11#0] %3 : (!quake.wire, !quake.wire) -> (!quake.wire, !quake.wire) %13:2 = quake.x [%12#0] %4 : (!quake.wire, !quake.wire) -> (!quake.wire, !quake.wire) %14:2 = quake.x [%13#0] %5 : (!quake.wire, !quake.wire) -> (!quake.wire, !quake.wire) %15:2 = quake.x [%14#0] %6 : (!quake.wire, !quake.wire) -> (!quake.wire, !quake.wire) %16:2 = quake.x [%15#0] %7 : (!quake.wire, !quake.wire) -> (!quake.wire, !quake.wire) %17:2 = quake.x [%16#0] %8 : (!quake.wire, !quake.wire) -> (!quake.wire, !quake.wire) %18:2 = quake.x [%17#0] %9 : (!quake.wire, !quake.wire) -> (!quake.wire, !quake.wire) Notice that the pruned form makes it apparent that any permutation for scheduling these operations is legal and should give the same result. The linear form does not. Reorganize the passes in the tablegen file, putting them back in alphabetical order. Add test. Review comments.
…NVIDIA#889) * Remove negative control handling from LowerToQIR to a standalone pass --------- Signed-off-by: Alex McCaskey <amccaskey@nvidia.com>
Closes NVIDIA#845 Partially addresses NVIDIA#704 (does not add chemistry/hardware efficient ansatz docs)
Adding/updating docs for tensor network backends. Related to: NVIDIA#863 Resolved: NVIDIA#753
…v and release containers (NVIDIA#922)
* Code block updated to use tabs for C++ and Python for sake of consistency with the rest of documentation. * Fixed the link from 'Next Steps' section to 'Default Simulator'.
Fixing links in docs such that the link always point to the same version of the docs that someone is currently browsing Fixing a minor typo in the workflow when launching deployment manually Installing the iqm client for testing such that iqm server helper tests are not skipped.
Adds a new type for the result of a measurement operation. A value of type `!quake.measurement` must be post-processed by the new operation `quake.discriminate` to convert that value to a classical integer value. `quake.discriminate`, like the previous measurement ops, can produce either a single integer (bit) or a `std::vector` of integers (bits). This splits the measurement operation into two steps: - acquiring the measurement on a qubit(s) - converting the measurement results to a classical value(s). Fix all the tests and passes to accept the new representation. Add verifier for DiscriminateOp. Update the python tests.
This fixes a bug in the newly added linear-ctrl-form pass. The index of the operand to be replaced was being miscomputed which was producing incorrect results. Corrects the test.
* Lower the ctrl-swap operations to QIR. Extend and generalize the invoke* code. Closes NVIDIA#806 * Add tests. Update signature if two target qubits. * Fix test.
…#909) * Try reproduce CI error to find a way to move applyExpPauli to base class * Fix a info log
... and test tolerances
Signed-off-by: A.M. Santana <anthonys@nvidia.com> With (PR NVIDIA#876), we are now enforcing the use of cudaq::ctrl when a programmer intends to run a control gate. This behavior must be matched in the kernel builder to remain specification compliant. As is, this deprecates the old functions with a stern warning, and replaces them with new templated versions. Depending on when this PR is merged, the deprecated functions should be removed for the following release cycle. Note: this has no impact on the Python API, only the C++ kernel builder. Old behavior that will now show a deprecation notice: auto [kernel, value] = cudaq::make_kernel<float>(); std::vector<cudaq::QuakeValue> ctrls{kernel.qalloc(), kernel.qalloc()}; auto target = kernel.qalloc(); // Now deprecated: kernel.x(ctrls, target); kernel.x(value, ctrls, target); kernel.rx(3.14, ctrls, target); The preferred method moving forward is kernel.x<cudaq::ctrl>(ctrls, target); kernel.x<cudaq::ctrl>(value, ctrls, target); kernel.rx<cudaq::ctrl>(3.14, ctrls, target);
Signed-off-by: Jordan Jacobelli <jjacobelli@nvidia.com> Co-authored-by: Bettina Heim <heimb@outlook.com>
* Fix library build dependence issues with tests. * Use the include directories gathered by cmake to config the nvq++ driver. * Remove cudaq-em-photonics per review comment.
5dc8ca8
to
179aa21
Compare
Collaborator
Author
Command Bot: Processing... |
aecdb2a
to
3db74c6
Compare
Collaborator
Author
Command Bot: Processing... |
3db74c6
to
109ae34
Compare
109ae34
to
7884e9e
Compare
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.
There are changes necessary to restore the build and tests for the experimental/python branch.
However, I'll put them into their own PR.