Commit eea5b5b2 authored by Nguyen, Thien Minh's avatar Nguyen, Thien Minh
Browse files

Update qcor demo examples



Signed-off-by: default avatarThien Nguyen <nguyentm@ornl.gov>
parent ea272bcb
Loading
Loading
Loading
Loading
+22 −0
Original line number Diff line number Diff line
# QCOR - XACC IR Demo


QCOR IDE set-up: https://aide-qc.github.io/deploy/getting_started/


## Launch QCOR IDE: 

```
aide-qc --start
```

## Access:

```
http://CADES-IP:8080
```


## IDE Docker set-up

- Add `.ibm_config` and `.ionq_config`
 No newline at end of file
+2 −2
Original line number Diff line number Diff line
/// qaoa_placement.cpp: Topology placement example
/// Using the default placement:
/// qcor -qpu aer:ibmq_paris  qaoa_placement.cpp -print-final-submission
/// qcor -qpu aer:ibmq_guadalupe  qaoa_placement.cpp -print-final-submission
/// Change the placement:
/// qcor -qpu aer:ibmq_paris -placement enfield qaoa_placement.cpp -print-final-submission
/// qcor -qpu aer:ibmq_guadalupe -placement enfield qaoa_placement.cpp -print-final-submission
/// Can add -opt 1 to further combine single-qubit gates (mixer terms).
__qpu__ void qaoa_maxcut(qreg q, std::vector<double> gamma,
                  std::vector<double> beta,
+1 −1
Original line number Diff line number Diff line
@@ -11,7 +11,7 @@

- Circuit with an Identity sequence: repeating CNOT gates (no optimization), examining the expectation calculation (theoretical = 1.0) with and without noise mitigation. CLI option to enable noise mitigation on any backend (simulator and IBM)

- Sweeping VQE ansatz: showing the energy values with and without noise mitigation.
- [Skipped] Sweeping VQE ansatz: showing the energy values with and without noise mitigation.

## Notes:

+3 −1
Original line number Diff line number Diff line
@@ -4,10 +4,12 @@
/// Execute: 
/// ./a.out

// To show XACC IR execution (FTQC): add -print-final-submission option


// Iterative Quantum Phase Estimation:
// Only use 2 qubits to achieve 4-bit accuracy (normally require 5 qubits)
// The oracle is a -5*pi/8 pHase rotation;
// The oracle is a -5*pi/8 phase rotation;
__qpu__ void oracle(qubit q) {
  auto angle = -5.0 * M_PI / 8.0;
  U1(q, angle);