Unverified Commit 6f1048f9 authored by Mccaskey, Alex's avatar Mccaskey, Alex Committed by GitHub
Browse files

Merge pull request #54 from kharazit/examples_readme

added README file for qcor/examples
parents a9346e55 6177a16e
Loading
Loading
Loading
Loading
Loading

examples/README.md

0 → 100644
+35 −0
Original line number Diff line number Diff line
Here we show a few examples of QCOR programs. These exampls highlight many aspects of the API and show how typical QCOR programs are formed. To run these, simply navigate to the desired directory and execute the `in_file.cpp` with `qcor -o out_file -qpu [qpu-name] in_file.cpp`.

`adapt/` examples using the [adaptive VQE algorithm](https://arxiv.org/abs/1911.10205).

`adder/` implementations for addition of classical numbers on QPUs.

`adjoint_test/` showcases QCOR's `adjoint` functionality, which maps a quantum kernel to its Hermitian conjugate. 

`bell/` contains examples generating the bell state on quantum computer. Highlights multi-kernel, multi-qreg use cases. 

`deuteron/` contains examples solving the ground state of the Deuteron Hamiltonian using hybrid, variational methods. Contains example for operator exponentiation.

`error_mitigation/` examples employing error mitigation strategies.

`ftqc_qrt/` contains various fault tolerant quantum computation routines employing error correction methods. Replies on QCOR quantum runtime (qrt) library. Compile with `qcor -qpu aer[noise-model:<noise.json>] -qrt ftqc [ftqc_qrt_file].cpp `. 

`grover/` contains an implementation of [Grover's algorithm](https://en.wikipedia.org/wiki/Grover%27s_algorithm) and a `.qasm` file for the Grover 5 qubit kernel. 

`hadamard_test/` shows examples of kernel composition with 'Hadamard' and 'X' gate kernels.

`hybrid/` highlights quantum-classical computation tasks in QCOR, such as VQE, QAOA, and ADAPT.

`placement/` contains examples highlighting user controls for mapping logical qubits to physical qubits on an accelerator.

`qaoa/` examples for the [Quantum Approximate Optimization Algorithm](https://arxiv.org/abs/1411.4028). Includes an example for the `arg_translation` functor for mapping results from an optimizer to the arguments for the kernel function.

`qjit/` highlights "just in time" compilation capabilities of QCOR. 

`qpe/` showcases examples for [quantum phase estimation](https://en.wikipedia.org/wiki/Quantum_phase_estimation_algorithm) algorithm. Files Requiring quantum runtime library (qrt), compile with: `qcor -o qpe -qpu qpp -shots 1024 -qrt qpe_example_qrt.cpp`

`qsim/` a suite of examples employing the "Quantum Simulation Model" with qcor.  

`simple/` highlights core features and functionality of QCOR programs running straightforward quantum computing schemes. Reccomended starting point for new users. 

`unitary/` examples mapping a unitary matrix to its quantum circuit representation. 
 No newline at end of file
+17 −0
Original line number Diff line number Diff line
Employing the QCOR just-in-time (qjit) compilation features, we can wrap QCOR in Python bindings. Here we give examples of how this is used.

`bell.py` gives a straightforward implementation of the bell state on a quantum computer. A good first example for new users.

`exp_i_theta.py` highlights operator exponentiation in qcor.

`multiple_kernel.py` shows how one might solve a problem using multiple quantum kernels. Shows kernel composition functionality.
 
`openfermion_integration.py` shows interop capabilities of [openFermion](https://github.com/quantumlib/OpenFermion) with QCOR. Shows how an `openFermion` `FermionOperator` can be used as a `qcor` `Operator` for variational problems.   

`qaoa_circuit.py` shows an implementation of the Quantum Approximate Eigensolver circuit and args translation functor in Python.

`qsim_example.py`shows workflow of quantum simulation (qsim) routines in qcor.

`qsim_vqe.py` qsim example of VQE routine for Deuteron Hamiltonian.

`vqe_qcor_spec.py` example of VQE using `taskInitiate` for asynchronous execution of quantum-classical hybrid computations. 
 No newline at end of file