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

Removed unused header



Also, rename QFT and IQFT example kernels.

Signed-off-by: default avatarThien Nguyen <nguyentm@ornl.gov>
parent 2f79cda3
Loading
Loading
Loading
Loading
+2 −3
Original line number Diff line number Diff line
#include "qcor.hpp"
// The header file which contains QFT kernel def
#include "qft.hpp"

@@ -9,10 +8,10 @@ __qpu__ void f(qreg q) {
  X(q[1]);

  // Call qft kernel (defined in a separate header file)
  quantumFourierTransform(q, nQubits);  
  qft(q, nQubits);  
  
  // Inverse QFT:
  inverseQuantumFourierTransform(q, nQubits);
  iqft(q, nQubits);
  
  // Measure all qubits
  for (int qIdx = 0; qIdx < nQubits; ++qIdx) {
+2 −2
Original line number Diff line number Diff line
#include "qcor.hpp"
#include "qalloc.hpp"

// Demonstrating Bell Test using multiple kernels

@@ -34,7 +34,7 @@ __qpu__ void bellTest(qreg qBits) {
}

// Compile:
// qcor -o multiple_kernels -qpu qpp -shots 1024 -qrt multiple_kernels.cpp
// qcor -o multiple_kernels -qpu qpp -shots 1024 -qrt multiple_kernels_Bell_test.cpp
int main(int argc, char **argv) {
  // Allocate 7 qubits: 
  // i.e. Hadamard on q[3] and entangle q[3] with other qubits.
+3 −3
Original line number Diff line number Diff line
@@ -3,12 +3,12 @@
// which is compiled by QCOR.
#pragma once

#include "qcor.hpp"
#include "qalloc.hpp"

// QFT kernel:
// Input: Qubit register and the max qubit index for the QFT,
// i.e. allow us to do QFT on a subset of the register [0, maxBitIdx)
__qpu__ void quantumFourierTransform(qreg q, int maxBitIdx) {
__qpu__ void qft(qreg q, int maxBitIdx) {
  // Local Declarations
  const auto nQubits = maxBitIdx;

@@ -28,7 +28,7 @@ __qpu__ void quantumFourierTransform(qreg q, int maxBitIdx) {
}

// Inverse QFT
__qpu__ void inverseQuantumFourierTransform(qreg q, int maxBitIdx) {
__qpu__ void iqft(qreg q, int maxBitIdx) {
  // Local Declarations
  const auto nQubits = maxBitIdx;
  // Swap qubits