Skip to content

Commit

Permalink
v3.1 methods; copyright; introduction; build instructions
Browse files Browse the repository at this point in the history
  • Loading branch information
WrathfulSpatula committed Feb 5, 2019
1 parent 4f88d52 commit ca5006f
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 8 deletions.
4 changes: 4 additions & 0 deletions docs/api/qinterface.rst
Original file line number Diff line number Diff line change
Expand Up @@ -139,6 +139,10 @@ Single Gates
.. doxygenfunction:: Qrack::QInterface::Exp(bitLenInt *, bitLenInt, bitLenInt, complex *, bool)
.. doxygenfunction:: Qrack::QInterface::Log(bitLenInt *, bitLenInt, bitLenInt, complex *, bool)

.. doxygenfunction:: Qrack::QInterface::UniformlyControlledSingleBit(const bitLenInt*, const bitLenInt&, bitLenInt, const complex*)
.. doxygenfunction:: Qrack::QInterface::UniformlyControlledRY(const bitLenInt*, const bitLenInt&, bitLenInt, const real1*)
.. doxygenfunction:: Qrack::QInterface::UniformlyControlledRZ(const bitLenInt*, const bitLenInt&, bitLenInt, const real1*)

Register-wide Gates
~~~~~~~~~~~~~~~~~~~

Expand Down
8 changes: 5 additions & 3 deletions docs/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -24,16 +24,18 @@ Build Status
Introduction
------------

`Qrack <https://github.com/vm6502q/qrack>`_ is a C++ quantum bit simulator, with the ability to support arbitrary numbers of entangled qubits - up to system limitations. Suitable for embedding in other projects, the :cpp:class:`Qrack::QInterface` contains a full and performant collection of standard quantum gates, as well as variations suitable for register operations and arbitrary rotations.
`Qrack <https://github.com/vm6502q/qrack>`_ is a C++ quantum bit and gate simulator, with the ability to support arbitrary numbers of entangled qubits - up to system limitations. Suitable for embedding in other projects, the :cpp:class:`Qrack::QInterface` contains a full and performant collection of standard quantum gates, as well as variations suitable for register operations and arbitrary rotations.

The developers of Qrack maintain a `fork <https://github.com/vm6502q/ProjectQ>`_ of the `ProjectQ <https://github.com/ProjectQ-Framework/ProjectQ>`_ quantum computer compiler which can use Qrack as the simulator, generally. This stack is also compatible with the `SimulaQron <https://github.com/SoftwareQuTech/SimulaQron>`_ quantum network simulator. (Qrack's developers are not directly affiliated with either of those projects, but we thank them for their contribution to the open source quantum computing community!)

As a demonstration of the :cpp:class:`Qrack::QInterface` implementation, a MOS-6502 microprocessor [MOS-6502]_ virtual machine has been modified with a set of new opcodes (:ref:`mos-6502q-opcodes`) supporting quantum operations. The `vm6502q <https://github.com/vm6502q/vm6502q>`_ virtual machine exposes new integrated quantum opcodes such as Hadamard transforms and an X-indexed LDA, with the X register in superposition, across a page of memory. An assembly example of a Grover's search with a simple oracle function is demonstrated in the `examples <https://github.com/vm6502q/examples>`_ repository.

Finally, a `6502 toolchain <https://github.com/vm6502q/cc65>`_ - based on `CC65 <http://cc65.github.io/doc/>`_ - has been modified and enhanced to support both the new opcodes - for the assembler - as well as :ref:`c-syntax-enhancements-ref`. This is performed primarily as sandbox/exploratory work to help clarify what quantum computational software engineering might look like as the hardware reaches commoditization.
Finally, a `6502 toolchain <https://github.com/vm6502q/cc65>`_ - based on `CC65 <http://cc65.github.io/doc/>`_ - has been modified and enhanced to support both the new opcodes for the assembler. We have discussed potential :ref:`c-syntax-enhancements-ref`. This is performed primarily as sandbox/exploratory work to help clarify what quantum computational software engineering might look like as the hardware reaches commoditization.

Copyright
---------

Copyright (c) Daniel Strano 2017 and the Qrack contributors. All rights reserved.
Copyright (c) Daniel Strano 2017-2019 and the Qrack contributors. All rights reserved.

Daniel Strano would like to specifically note that Benn Bollay is almost entirely responsible for the implementation of QUnit and tooling, including unit tests, in addition to large amounts of work on the documentation and many other various contributions in intensive reviews. Also, thank you to Marek Karcz for supplying an awesome base classical 6502 emulator for proof-of-concept.

Expand Down
12 changes: 7 additions & 5 deletions docs/start.rst
Original file line number Diff line number Diff line change
Expand Up @@ -37,15 +37,17 @@ Check out each of the major repositories into a project branch:
Compiling
~~~~~~~~~

The ``qrack`` project supports two primary implementations: OpenCL-optimized and software-only. See :doc:`opencl` for details on installing OpenCL on some platforms, or your appropriate OS documentation. If you do not have OpenCL or do not wish to use it, supply the ``USE_OPENCL=OFF`` environment to ``cmake`` when building qrack the first time.
The ``qrack`` project supports two primary implementations: OpenCL-optimized and software-only. See :doc:`opencl` for details on installing OpenCL on some platforms, or your appropriate OS documentation. If you do not have OpenCL or do not wish to use it, supply the ``ENABLE_OPENCL=OFF`` environment to ``cmake`` when building qrack the first time.

Qrack compiles with either double or single accuracy complex numbers. Doubles are used by default. Single float accuracy uses almost exactly half as much RAM, allowing one additional qubit. Single accuracy may also be faster or the only compatible option for certain OpenCL devices, such as accelerators. Double vectorization uses AVX, while single vectorization uses SSE 1.0.
.. code-block:: bash
To enable float accuracy as opposed to double, run CMake with the appropriate flag:
qc/ $ cd qrack/build && cmake [-DENABLE_OPENCL=OFF] [-DENABLE_COMPLEX8=ON] [-DENABLE_COMPLEX_X2=OFF] [-DENABLE_PURE32=ON] [-DENABLE_VC4CL=ON] ..
.. code-block:: bash
Qrack compiles with either double (``ENABLE_COMPLEX8=OFF``) or single (``ENABLE_COMPLEX8=ON``) accuracy complex numbers. Single float accuracy is used by default. Single float accuracy uses almost exactly half as much RAM, allowing one additional qubit. Single accuracy may also be faster or the only compatible option for certain OpenCL devices.

Vectorization (``ENABLE_COMPLEX_X2=ON``) of doubles uses AVX, while single accuracy vectorization uses SSE 1.0. Turning vectorization off at compile time removes all SIMD vectorization.

qc/ $ cd qrack/build && cmake -DENABLE_COMPLEX8=ON ..
Many OpenCL devices that don't support double accuracy floating point operations still support 64-bit integer types. If a device doesn't support 64-bit integer types, ``ENABLE_PURE32=OFF`` will disable all 64-bit types in OpenCL kernels, as well as SIMD. This theoretically supports the OpenCL standard on a device such as a Raspberry Pi 3. However, the VC4CL OpenCL compiler for the Raspberry Pi is still under active development and does not yet fully support trigonometry needed for Qrack. ``ENABLE_VC4CL=ON`` will enable "pure 32-bit" compilation and branch code that relies on OpenCL trigonometry, to support Qrack on the Raspberry Pi 3, but this flag will probably no longer be necessary once trigonometry is supported, at which point ``ENABLE_PURE32=ON`` should suffice instead.

Using the API
~~~~~~~~~~~~~
Expand Down

0 comments on commit ca5006f

Please sign in to comment.