Commit f1ef2f02 authored by Mccaskey, Alex's avatar Mccaskey, Alex
Browse files

adding qcor call qiskit via qir demo example, cleanup on demo files

parent 0f285ba0
Loading
Loading
Loading
Loading
Loading
+15 −0
Original line number Diff line number Diff line
FROM qcor/qcor-alpine
ENV VERSION=3.11.0

RUN apk add nodejs openssh-client gnupg bash && \
   wget https://github.com/cdr/code-server/releases/download/v$VERSION/code-server-$VERSION-linux-amd64.tar.gz && \
   tar x -zf code-server-$VERSION-linux-amd64.tar.gz && \
   rm code-server-$VERSION-linux-amd64.tar.gz && \
   rm code-server-$VERSION-linux-amd64/node && \
   rm code-server-$VERSION-linux-amd64/code-server && \
   rm code-server-$VERSION-linux-amd64/lib/node && \
   mv code-server-$VERSION-linux-amd64 /usr/lib/code-server && \
   sed -i 's/"$ROOT\/lib\/node"/node/g'  /usr/lib/code-server/bin/code-server 

ENTRYPOINT ["/usr/lib/code-server/bin/code-server", "--bind-addr", "0.0.0.0:8080", "--auth", "none", "."]
# CMD ["--bind-addr 0.0.0.0:8080"]
 No newline at end of file
+6 −0
Original line number Diff line number Diff line
from xacc/alpine
run git clone https://github.com/ornl-qci/llvm-project-csp \
   && apk add ninja \
   && cd llvm-project-csp/ && mkdir build && cd build/ \
   && cmake -G Ninja ../llvm -DCMAKE_INSTALL_PREFIX=/usr/local/aideqc/llvm -DBUILD_SHARED_LIBS=TRUE -DLLVM_ENABLE_DUMP=TRUE -DCMAKE_BUILD_TYPE=Release -DLLVM_TARGETS_TO_BUILD="X86" -DLLVM_ENABLE_PROJECTS="clang;mlir" \
   && cmake --build . --target install && cd ../../ && rm -rf llvm-project-csp 
+7 −0
Original line number Diff line number Diff line
FROM qcor/llvm-alpine

RUN apk add libc6-compat && git clone https://github.com/ornl-qci/qcor && cd qcor && mkdir build && cd build \
   && cmake .. -G Ninja -DLLVM_ROOT=/usr/local/aideqc/llvm -DQCOR_EXTRA_COMPILER_FLAGS="-B /usr/lib/gcc/x86_64-alpine-linux-musl/10.3.1 -L /usr/lib/gcc/x86_64-alpine-linux-musl/10.3.1" -DQCOR_EXTRA_HEADERS="/usr/include/c++/10.3.1;/usr/include/c++/10.3.1/x86_64-alpine-linux-musl" \
   && cmake --build . --target install && cd ../.. && rm -rf qcor 
ENV PYTHONPATH "${PYTHONPATH}:/root/.xacc/bin"
ENV PATH "${PATH}:/root/.xacc/bin"
+10 −5
Original line number Diff line number Diff line
// qcor bell.qasm -o bell.x
// ./bell.x -qrt ftqc
// ./bell.x 
//
// qcor -v bell.qasm -o bell.x
// qcor --emit-mlir bell.qasm
// qcor --emit-llvm bell.qasm

OPENQASM 3;

qubit q[2];

const shots = 100;
const shots = 15;
int count = 0;

for i in [0:shots] {
for i in [0:15] {
    
    // Create Bell state
    h q[0];
    ctrl @ x q[0], q[1];
    cnot q[0], q[1];
    
    // Measure and assert both are equal
    bit c[2];
    c = measure q;
    if (c[0] == c[1]) {
        print("iter", i, ": measured =", c[0], c[1]);
        count += 1;
    }

+5 −22
Original line number Diff line number Diff line
// NISQ Mode Execution
//
// Compile and run with 
// qcor ghz.qasm -o ghz.x
// 
// Run on QPP (perfect simulator)
// ./ghz.x -qrt nisq -shots 1000
//
// Kick off Hardware Executions (will have to wait, kick off in parallel)
//
// Show on real hardware (IBM)
// ./ghz.x -qpu ibm:ibmq_sydney -qrt nisq -shots 1000
//
// Show on IonQ QPU
// ./ghz.x -qpu ionq:qpu -qrt nisq -shots 1000
//
// (In meantime, show of execution on simulators)
//
// Show on IonQ remote simulator
// ./ghz.x -qpu ionq -qrt nisq -shots 1000
//
// Show on IBM remote simulator
// ./ghz.x -qpu ibm -qrt nisq -shots 1000
// Compile and run on qpp 
// qcor ghz.qasm -o ghz.x -qrt nisq -shots 1000
// ./ghz.x 
//
// Show on local aer with noisy backend
// ./ghz.x -qpu aer:ibmq_sydney -qrt nisq -shots 100
// qcor ghz.qasm -o ghz.x -qrt nisq -shots 100 -qpu aer:ibmq_sydney
// ./ghz.x 
//
// (Now Show off how this works, MLIR + QIR)
//
Loading