Unverified Commit 21e2236b authored by Mccaskey, Alex's avatar Mccaskey, Alex Committed by GitHub
Browse files

Merge pull request #192 from vm6502q/qrack_plugin_squash

Qrack accelerator docs
parents 19ce40eb d8da3087
Pipeline #102747 passed with stage
in 10 minutes and 37 seconds
......@@ -509,6 +509,32 @@ To use automatic gate-to-pulse functionality, we need to load a pulse library to
For more information, please check out these `examples <https://github.com/ORNL-QCI/QuaC/tree/xacc-integration/xacc_examples/python>`_.
Qrack
+++++
The `vm6502q/qrack <https://github.com/vm6502q/qrack>`_ simulator-based accelerator provides optional OpenCL-based GPU acceleration, as well as a novel simulator optimization layer.
.. code:: cpp
auto qrk = xacc::getAccelerator("qrack", {std::make_pair("shots", 2048)});
By default, it selects initialization parameters that are commonly best for a wide range of use cases. However, it is highly configurable through a number of exposed parameters:
+-----------------------------+------------------------------------------------------------------------+-------------+--------------------------+
| Initialization Parameter | Parameter Description | type | default |
+=============================+========================================================================+=============+==========================+
| shots | Number of iterations to repeat the circuit for | int | -1 (Z-expectation only) |
+-----------------------------+------------------------------------------------------------------------+-------------+--------------------------+
| use_opencl | Use OpenCL acceleration if available, (otherwise native C++11) | bool | true |
+-----------------------------+------------------------------------------------------------------------+-------------+--------------------------+
| use_qunit | Turn on the novel optimization layer, (otherwise "Schrödinger method") | bool | true |
+-----------------------------+------------------------------------------------------------------------+-------------+--------------------------+
| device_id | The (Qrack) device ID number of the OpenCL accelerator to use | int | -1 (auto-select) |
+-----------------------------+------------------------------------------------------------------------+-------------+--------------------------+
| do_normalize | Enable small norm probability amplitude flooring and normalization | bool | true |
+-----------------------------+------------------------------------------------------------------------+-------------+--------------------------+
| zero_threshold | Norm threshold for clamping probability amplitudes to 0 | double | 1e-14/1e-30 float/double |
+-----------------------------+------------------------------------------------------------------------+-------------+--------------------------+
Algorithms
----------
XACC exposes hybrid quantum-classical Algorithm implementations for the variational quantum eigensolver (VQE), data-driven
......@@ -1267,4 +1293,4 @@ Example:
vqe->execute(buffer);
// Expected result: -1.74886
std::cout << "Energy: " << (*buffer)["opt-val"].as<double>() << "\n";
}
\ No newline at end of file
}
......@@ -13,3 +13,5 @@ mkdir _build && cd _build && cmake .. && make all install
XACC looks for the Qrack library with "find_library(NAMES qrack)," so it will find it for example as "libqrack.a" in /usr/local/lib.
If your installation is a non-system-standard path, "CMAKE_PREFIX_PATH" should tell CMake where it can find the library.
Qrack OpenCL kernels can be precompiled through the "qrack_cl_precompile" command line utility in the base Qrack library.
When switching between float and double build accuracy, you MUST recompile (or delete) any precompiled kernels.
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment