Skip to content

C++ compiler for heterogeneous quantum-classical computing built on Clang and XACC

License

Notifications You must be signed in to change notification settings

purva-thakre/qcor

 
 

Repository files navigation

qcor

master
pipeline status

QCOR

QCOR is a C++ language extension and associated compiler implementation for hybrid quantum-classical programming.

Documentation

Install

To install qcor run the following command from your terminal

/bin/bash -c "$(curl -fsSL https://aide-qc.github.io/deploy/install.sh)"

To use the Python API, be sure to set your PYTHONPATH. For more details, see here.

Nightly docker images are also available that serve up a Theia IDE on port 3000. To use this image, run

docker run --security-opt seccomp=unconfined --init -it -p 3000:3000 qcor/qcor

and navigate to https://localhost:3000 in your browser to open the IDE and get started with QCOR.

For any method of installation, a good way to test your install is to copy and paste the following into your terminal

printf "__qpu__ void f(qreg q) {
  H(q[0]);
  Measure(q[0]);
}
int main() {
  auto q = qalloc(1);
  f(q);
  q.print();
}  " | qcor -qpu qpp -shots 1024 -o test -x c++ -

and then run

./test

Cite QCOR

If you use qcor in your research, please use the following citation

@ARTICLE{qcor,
       author = {{Nguyen}, Thien and {Santana}, Anthony and {Kharazi}, Tyler and
         {Claudino}, Daniel and {Finkel}, Hal and {McCaskey}, Alexander},
        title = "{Extending C++ for Heterogeneous Quantum-Classical Computing}",
      journal = {arXiv e-prints},
     keywords = {Quantum Physics, Computer Science - Mathematical Software},
         year = 2020,
        month = oct,
          eid = {arXiv:2010.03935},
        pages = {arXiv:2010.03935},
archivePrefix = {arXiv},
       eprint = {2010.03935},
 primaryClass = {quant-ph},
       adsurl = {https://ui.adsabs.harvard.edu/abs/2020arXiv201003935N},
      adsnote = {Provided by the SAO/NASA Astrophysics Data System}
}

About

C++ compiler for heterogeneous quantum-classical computing built on Clang and XACC

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • C++ 77.6%
  • OpenQASM 12.2%
  • Python 5.4%
  • CMake 2.9%
  • ANTLR 1.4%
  • Dockerfile 0.2%
  • Other 0.3%