Skip to content

Commit f82f6b8

Browse files
Docs preview for PR #3332.
1 parent 944ca31 commit f82f6b8

File tree

249 files changed

+263325
-1540
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

249 files changed

+263325
-1540
lines changed

pr-3332/_images/qpus.png

77.9 KB
Loading

pr-3332/_sources/applications/python/generate_fermionic_ham.ipynb.txt

Lines changed: 229 additions & 40 deletions
Large diffs are not rendered by default.

pr-3332/_sources/using/backends/hardware/superconducting.rst.txt

Lines changed: 73 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -280,3 +280,76 @@ Submitting
280280
The OQC quantum assembly toolchain (qat) which is used to compile and execute instructions can be found on github as `oqc-community/qat <https://github.com/oqc-community/qat>`__
281281

282282
To see a complete example, take a look at :ref:`OQC examples <oqc-examples>`.
283+
284+
285+
Quantum Circuits, Inc.
286+
+++++++++++++++++++++++
287+
288+
.. _qci-backend:
289+
290+
As part of its first phase of integration with CUDA-Q,
291+
`Quantum Circuits <https://quantumcircuits.com/>`__ offers users the ability to simulate CUDA-Q
292+
programs using its simulator, AquSim. AquSim is the first simulator that models error detection and
293+
real-time control of Quantum Circuits' Dual-Rail Cavity Qubit systems, and uses a Monte Carlo
294+
approach to do so on a shot-by-shot basis.
295+
296+
In this first phase, the supported features include all of the single and two-qubit gates offered by
297+
CUDA-Q, together with real-time conditional logic enabled by feed-forward capability. AquSim is
298+
currently wired to support ideal simulations only and noise models will be added in future
299+
iterations.
300+
301+
With C++ and Python programming supported, users are able to prototype, test and explore quantum
302+
applications in CUDA-Q in preparation for upcoming releases targeting Quantum Circuits QPUs.
303+
Examples are provided to get started.
304+
305+
Users who wish to get started with running CUDA-Q on AquSim should visit our
306+
`Explore <https://quantumcircuits.com/explore/>`__ page to learn more about the Quantum Circuits
307+
Strategic Quantum Release Program.
308+
309+
Submitting
310+
`````````````````````````
311+
312+
Until CUDA-Q release 0.13.0 is available, the integration with Quantum Circuits will be supported
313+
through the nightly build Docker images.
314+
315+
Instructions on how to install and get started with CUDA-Q using Docker can be found :ref:`here <install-docker-image>`.
316+
317+
You may present your user token to Quantum Circuits via CUDA-Q by setting an environment variable
318+
named :code:`QCI_AUTH_TOKEN` before running your CUDA-Q program.
319+
320+
.. code:: bash
321+
322+
export QCI_AUTH_TOKEN="example-token"
323+
324+
325+
.. tab:: Python
326+
327+
To set the target to Quantum Circuits, add the following to your Python
328+
program:
329+
330+
.. code:: python
331+
332+
cudaq.set_target('qci')
333+
[... your Python here]
334+
335+
To run on AquSim, simply execute the script using your Python interpreter.
336+
337+
.. tab:: C++
338+
339+
When executing programs in C++, they must first be compiled using the
340+
CUDA-Q nvq++ compiler, and then submitted to run on AquSim.
341+
342+
Note that your token is fetched from your environment at run time, not at compile time.
343+
344+
In the example below, the compilation step shows two flags being passed to the nvq++
345+
compiler: the Quantum Circuits target :code:`--target qci`, and the output file
346+
:code:`-o example.x`. The second line executes the program against AquSim. Here are the
347+
shell commands in full:
348+
349+
.. code:: bash
350+
351+
nvq++ example.cpp --target qci -o example.x
352+
./example.x
353+
354+
To see a complete example of using Quantum Circuits' backends, please take a look at the
355+
:ref:`Quantum Circuits examples <quantum-circuits-examples>`.

pr-3332/_sources/using/basics/kernel_intro.rst.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ Moreover, since quantum kernels are functions, there is more expressibility avai
1616
standard quantum circuit. We can not only parameterize the kernel, but can also contain classical control
1717
flow statements (`if`, `for`, `while`, etc.), and classical computations such as additions, multiplication, etc.
1818
Conditional statements on quantum memory and qubit measurements can be included in quantum kernels to enable
19-
dynamic circuits and fast feedback, particularly useful for quantum error correction. To learn more about what
19+
dynamic circuits and fast feedback, which are particularly useful for quantum error correction. To learn more about what
2020
language constructs are supported within quantum kernels, take a look at the CUDA-Q
2121
:doc:`specification <../../specification/cudaq/kernels>`.
2222

pr-3332/_sources/using/basics/run_kernel.rst.txt

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -113,28 +113,28 @@ is available, for example, by choosing the target `nvidia-mqpu`:
113113
.. note::
114114

115115
This kind of parallelization is most effective
116-
if you actually have multiple QPU or CPU available. Otherwise, the
116+
if you actually have multiple QPUs or GPUs available. Otherwise, the
117117
sampling will still have to execute sequentially due to resource constraints.
118118

119-
More information about parallelizing execution can be found at :ref:`mqpu-platform` page.
119+
More information about parallelizing execution can be found on the :ref:`mqpu-platform` page.
120120

121121
Run
122122
+++++++++
123123

124124
The `run` method executes a quantum kernel multiple times and returns each individual result. Unlike `sample`,
125-
which collects measurement statistics as counts, `run` preserves each individual return value from every
126-
execution. This is useful when you need to analyze the distribution of returned values rather than just
125+
which collects measurement statistics as counts, `run` preserves each individual return value from each
126+
execution. This is useful when you need to analyze the distribution of returned values which may not be possible from just
127127
aggregated measurement counts. Additionally, the `run` method also supports returning various types of values
128128
from the quantum kernel, including scalar types (bool, int, float and their variants) and user-defined data structures.
129129

130130
.. tab:: Python
131131

132-
The ``cudaq.run`` method takes a kernel and its arguments as inputs, and returns a list containing
132+
The ``cudaq.run`` method takes a kernel and its arguments as inputs and returns a list containing
133133
the result values from each execution. The kernel must return a non-void value.
134134

135135
.. tab:: C++
136136

137-
The ``cudaq::run`` method takes a kernel and its arguments as inputs, and returns a `std::vector` containing
137+
The ``cudaq::run`` method takes a kernel and its arguments as inputs and returns a `std::vector` containing
138138
the result values from each execution. The kernel must return a non-void value.
139139

140140
Below is an example of a quantum kernel that creates a GHZ state, measures all qubits, and returns the total
@@ -231,7 +231,7 @@ The observe function allows us to calculate expectation values for a defined qua
231231

232232
Below is an example of a spin operator object consisting of a `Z(0)` operator, or a Pauli Z-operator on the qubit zero.
233233
This is followed by the construction of a kernel with a single qubit in an equal superposition.
234-
The Hamiltonian is printed to confirm it has been constructed properly.
234+
The Hamiltonian is printed to confirm that it has been constructed properly.
235235

236236
.. tab:: Python
237237

@@ -321,7 +321,7 @@ all of the available targets and ways to accelerate kernel execution, visit the
321321

322322
To compare the performance, we can create a simple timing script that isolates just the call
323323
to `cudaq::sample`. We are still using the same GHZ kernel as earlier, but the following
324-
modification made to the main function:
324+
modification is made to the main function:
325325

326326
.. literalinclude:: ../../snippets/cpp/using/time.cpp
327327
:language: cpp

pr-3332/_sources/using/examples/hardware_providers.rst.txt

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -191,6 +191,23 @@ The following code illustrates how to run kernels on Quantinuum's backends.
191191
:language: cpp
192192

193193

194+
.. _quantum-circuits-examples:
195+
196+
Quantum Circuits, Inc.
197+
========================
198+
199+
The following code illustrates how to run kernels on Quantum Circuits' backends.
200+
201+
.. tab:: Python
202+
203+
.. literalinclude:: ../../targets/python/qci.py
204+
:language: python
205+
206+
.. tab:: C++
207+
208+
.. literalinclude:: ../../targets/cpp/qci.cpp
209+
:language: cpp
210+
194211
.. _quantum-machines-examples:
195212

196213
Quantum Machines

pr-3332/_tags/tagsindex.html

Lines changed: 9 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -211,6 +211,7 @@
211211
<li class="toctree-l3"><a class="reference internal" href="../using/examples/hardware_providers.html#orca-computing">ORCA Computing</a></li>
212212
<li class="toctree-l3"><a class="reference internal" href="../using/examples/hardware_providers.html#pasqal">Pasqal</a></li>
213213
<li class="toctree-l3"><a class="reference internal" href="../using/examples/hardware_providers.html#quantinuum">Quantinuum</a></li>
214+
<li class="toctree-l3"><a class="reference internal" href="../using/examples/hardware_providers.html#quantum-circuits-inc">Quantum Circuits, Inc.</a></li>
214215
<li class="toctree-l3"><a class="reference internal" href="../using/examples/hardware_providers.html#quantum-machines">Quantum Machines</a></li>
215216
<li class="toctree-l3"><a class="reference internal" href="../using/examples/hardware_providers.html#quera-computing">QuEra Computing</a></li>
216217
</ul>
@@ -458,16 +459,13 @@
458459
<li class="toctree-l2"><a class="reference internal" href="../applications/python/generate_fermionic_ham.html">Generating the electronic Hamiltonian</a><ul>
459460
<li class="toctree-l3"><a class="reference internal" href="../applications/python/generate_fermionic_ham.html#Second-Quantized-formulation.">Second Quantized formulation.</a><ul>
460461
<li class="toctree-l4"><a class="reference internal" href="../applications/python/generate_fermionic_ham.html#Computational-Implementation">Computational Implementation</a></li>
461-
</ul>
462-
</li>
463-
<li class="toctree-l3"><a class="reference internal" href="../applications/python/generate_fermionic_ham.html#(a)-Generate-the-molecular-Hamiltonian-using-Hartree-Fock-molecular-orbitals">(a) Generate the molecular Hamiltonian using Hartree Fock molecular orbitals</a><ul>
464-
<li class="toctree-l4"><a class="reference internal" href="../applications/python/generate_fermionic_ham.html#Active-space-Hamiltonian:">Active space Hamiltonian:</a></li>
465-
</ul>
466-
</li>
467-
<li class="toctree-l3"><a class="reference internal" href="../applications/python/generate_fermionic_ham.html#(b)-Generate-the-active-space-hamiltonian-using-HF-molecular-orbitals.">(b) Generate the active space hamiltonian using HF molecular orbitals.</a></li>
468-
<li class="toctree-l3"><a class="reference internal" href="../applications/python/generate_fermionic_ham.html#(c)-Generate-the-active-space-Hamiltonian-using-the-natural-orbitals-computed-from-MP2-simulation">(c) Generate the active space Hamiltonian using the natural orbitals computed from MP2 simulation</a></li>
469-
<li class="toctree-l3"><a class="reference internal" href="../applications/python/generate_fermionic_ham.html#(d)-Generate-the-active-space-Hamiltonian-computed-from-the-CASSCF-molecular-orbitals">(d) Generate the active space Hamiltonian computed from the CASSCF molecular orbitals</a><ul>
470-
<li class="toctree-l4"><a class="reference internal" href="../applications/python/generate_fermionic_ham.html#Generate-the-electronic-Hamiltonian-using-ROHF">Generate the electronic Hamiltonian using ROHF</a></li>
462+
<li class="toctree-l4"><a class="reference internal" href="../applications/python/generate_fermionic_ham.html#(a)-Generate-the-molecular-Hamiltonian-using-Restricted-Hartree-Fock-molecular-orbitals">(a) Generate the molecular Hamiltonian using Restricted Hartree Fock molecular orbitals</a></li>
463+
<li class="toctree-l4"><a class="reference internal" href="../applications/python/generate_fermionic_ham.html#(b)-Generate-the-molecular-Hamiltonian-using-Unrestricted-Hartree-Fock-molecular-orbitals">(b) Generate the molecular Hamiltonian using Unrestricted Hartree Fock molecular orbitals</a></li>
464+
<li class="toctree-l4"><a class="reference internal" href="../applications/python/generate_fermionic_ham.html#(a)-Generate-the-active-space-hamiltonian-using-RHF-molecular-orbitals.">(a) Generate the active space hamiltonian using RHF molecular orbitals.</a></li>
465+
<li class="toctree-l4"><a class="reference internal" href="../applications/python/generate_fermionic_ham.html#(b)-Generate-the-active-space-Hamiltonian-using-the-natural-orbitals-computed-from-MP2-simulation">(b) Generate the active space Hamiltonian using the natural orbitals computed from MP2 simulation</a></li>
466+
<li class="toctree-l4"><a class="reference internal" href="../applications/python/generate_fermionic_ham.html#(c)-Generate-the-active-space-Hamiltonian-computed-from-the-CASSCF-molecular-orbitals">(c) Generate the active space Hamiltonian computed from the CASSCF molecular orbitals</a></li>
467+
<li class="toctree-l4"><a class="reference internal" href="../applications/python/generate_fermionic_ham.html#(d)-Generate-the-electronic-Hamiltonian-using-ROHF">(d) Generate the electronic Hamiltonian using ROHF</a></li>
468+
<li class="toctree-l4"><a class="reference internal" href="../applications/python/generate_fermionic_ham.html#(e)-Generate-electronic-Hamiltonian-using-UHF">(e) Generate electronic Hamiltonian using UHF</a></li>
471469
</ul>
472470
</li>
473471
</ul>
@@ -561,6 +559,7 @@
561559
<li class="toctree-l4"><a class="reference internal" href="../using/backends/hardware/superconducting.html#anyon-technologies-anyon-computing">Anyon Technologies/Anyon Computing</a></li>
562560
<li class="toctree-l4"><a class="reference internal" href="../using/backends/hardware/superconducting.html#iqm">IQM</a></li>
563561
<li class="toctree-l4"><a class="reference internal" href="../using/backends/hardware/superconducting.html#oqc">OQC</a></li>
562+
<li class="toctree-l4"><a class="reference internal" href="../using/backends/hardware/superconducting.html#quantum-circuits-inc">Quantum Circuits, Inc.</a></li>
564563
</ul>
565564
</li>
566565
<li class="toctree-l3"><a class="reference internal" href="../using/backends/hardware/neutralatom.html"> Neutral Atom QPUs</a><ul>

0 commit comments

Comments
 (0)