Skip to content

Commit

Permalink
Docs preview for PR #2168.
Browse files Browse the repository at this point in the history
  • Loading branch information
cuda-quantum-bot committed Sep 18, 2024
1 parent a2c6f22 commit a3d3c2d
Show file tree
Hide file tree
Showing 98 changed files with 2,284 additions and 817 deletions.
Empty file removed pr-2168/.nojekyll
Empty file.
83 changes: 83 additions & 0 deletions pr-2168/_sources/api/default_ops.rst.txt
Original file line number Diff line number Diff line change
Expand Up @@ -633,3 +633,86 @@ operations, each operating on 2 qubits.

Custom operations are currently supported only on :doc:`../using/backends/simulators`.
Attempt to use with a hardware backend will result in runtime error.


Photonic Operations on Qudits
=============================

These operations are valid only on the `photonics` target which does not support the quantum operations above.

:code:`plus`
---------------------

This is a place-holder, to be updated later.

.. tab:: Python

.. code-block:: python
q = qudit(3)
plus(q)
.. tab:: C++

.. code-block:: cpp
cudaq::qvector<3> q(1);
plus(q[0]);
:code:`phase_shift`
---------------------

This is a place-holder, to be updated later.

.. tab:: Python

.. code-block:: python
q = qudit(4)
phase_shift(q, 0.17)
.. tab:: C++

.. code-block:: cpp
cudaq::qvector<4> q(1);
phase_shift(q[0], 0.17);
:code:`beam_splitter`
---------------------

This is a place-holder, to be updated later.

.. tab:: Python

.. code-block:: python
q = [qudit(3) for _ in range(2)]
beam_splitter(q[0], q[1], 0.34)
.. tab:: C++

.. code-block:: cpp
cudaq::qvector<3> q(2);
beam_splitter(q[0], q[1], 0.34);
:code:`mz`
---------------------

This operation returns the measurement results of the input qudit(s).

.. tab:: Python

.. code-block:: python
qutrits = [qudit(3) for _ in range(2)]
mz(qutrits)
.. tab:: C++

.. code-block:: cpp
cudaq::qvector<3> qutrits(2);
mz(qutrits);
6 changes: 6 additions & 0 deletions pr-2168/_sources/api/languages/cpp_api.rst.txt
Original file line number Diff line number Diff line change
Expand Up @@ -225,3 +225,9 @@ Namespaces
.. doxygenfunction:: cudaq::mpi::all_reduce(const T &localValue, const BinaryFunction &function)
.. doxygenfunction:: cudaq::mpi::broadcast(std::vector<double> &data, int rootRank)
.. doxygenfunction:: cudaq::mpi::broadcast(std::string &data, int rootRank)

.. doxygennamespace:: cudaq::orca
:desc-only:

.. doxygenfunction:: cudaq::orca::sample(std::vector<std::size_t> &input_state, std::vector<std::size_t> &loop_lengths, std::vector<double> &bs_angles, int n_samples = 10000)
.. doxygenfunction:: cudaq::orca::sample(std::vector<std::size_t> &input_state, std::vector<std::size_t> &loop_lengths, std::vector<double> &bs_angles, std::vector<double> &ps_angles, int n_samples = 10000)
7 changes: 6 additions & 1 deletion pr-2168/_sources/api/languages/python_api.rst.txt
Original file line number Diff line number Diff line change
Expand Up @@ -227,4 +227,9 @@ MPI Submodule
.. automethod:: cudaq.mpi::all_gather
.. automethod:: cudaq.mpi::broadcast
.. automethod:: cudaq.mpi::is_initialized
.. automethod:: cudaq.mpi::finalize
.. automethod:: cudaq.mpi::finalize

ORCA Submodule
=============================

.. automethod:: cudaq.orca::sample
38 changes: 25 additions & 13 deletions pr-2168/_sources/examples/python/tutorials/H2-MRQKS.ipynb.txt
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,19 @@
},
{
"cell_type": "code",
"execution_count": 1,
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
"# Package installs\n",
"!pip install pyscf==2.6.2\n",
"!pip install openfermionpyscf==0.5\n",
"!pip install openfermion==1.6.1"
]
},
{
"cell_type": "code",
"execution_count": 2,
"metadata": {},
"outputs": [],
"source": [
Expand All @@ -28,14 +40,14 @@
},
{
"cell_type": "code",
"execution_count": 2,
"execution_count": 3,
"metadata": {},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"Ground state energy (classical simulation)= (-1.1371757102406848+0j) , index= 3\n"
"Ground state energy (classical simulation)= (-1.1371757102406843+0j) , index= 3\n"
]
}
],
Expand Down Expand Up @@ -63,7 +75,7 @@
},
{
"cell_type": "code",
"execution_count": 3,
"execution_count": 4,
"metadata": {},
"outputs": [],
"source": [
Expand All @@ -87,7 +99,7 @@
},
{
"cell_type": "code",
"execution_count": 4,
"execution_count": 5,
"metadata": {},
"outputs": [],
"source": [
Expand Down Expand Up @@ -140,7 +152,7 @@
},
{
"cell_type": "code",
"execution_count": 5,
"execution_count": 6,
"metadata": {},
"outputs": [],
"source": [
Expand All @@ -161,7 +173,7 @@
},
{
"cell_type": "code",
"execution_count": 6,
"execution_count": 7,
"metadata": {},
"outputs": [],
"source": [
Expand All @@ -173,7 +185,7 @@
},
{
"cell_type": "code",
"execution_count": 7,
"execution_count": 8,
"metadata": {},
"outputs": [],
"source": [
Expand All @@ -187,7 +199,7 @@
},
{
"cell_type": "code",
"execution_count": 8,
"execution_count": 9,
"metadata": {},
"outputs": [],
"source": [
Expand Down Expand Up @@ -277,7 +289,7 @@
},
{
"cell_type": "code",
"execution_count": 9,
"execution_count": 10,
"metadata": {},
"outputs": [],
"source": [
Expand Down Expand Up @@ -365,7 +377,7 @@
},
{
"cell_type": "code",
"execution_count": 10,
"execution_count": 11,
"metadata": {},
"outputs": [],
"source": [
Expand Down Expand Up @@ -402,15 +414,15 @@
},
{
"cell_type": "code",
"execution_count": 11,
"execution_count": 12,
"metadata": {},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"Energy from QFD:\n",
"(-1.136755471242475-1.63528910693825e-20j)\n"
"(-1.1367554712424826+3.373828079812224e-20j)\n"
]
}
],
Expand Down
Loading

0 comments on commit a3d3c2d

Please sign in to comment.