CK repository for Quantum Information Software Kit (QISKit)
Switch branches/tags
Nothing to show
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
.cm
package
program
soft
.ckr.json
.gitignore
.travis.yml
README.md
appveyor.yml
requirements.txt

README.md

CK repository for Quantum Information Software Kit (QISKit)

compatibility License Travis Build Status

Install prerequisites (Python, CK, C++ compiler, libraries)

Ubuntu/Debian Linux

$ sudo apt-get install python3 python3-pip python3-tk
$ sudo python3 -m pip install ck

Optional

$ sudo add-apt-repository ppa:ubuntu-toolchain-r/test                   # add newer gcc versions
$ sudo apt-get update
$ sudo apt-get install gcc-7 g++-7
$ sudo apt-get install libblas-dev liblapack-dev                        # add blas and lapack

macOS

$ brew update                                                           # makes python3 the default python
$ brew install freetype                                                 # needed for matplotlib
$ brew reinstall python                                                 # install and link python3 and pip3 to /usr/local/bin
$ export PATH=/usr/local/opt/python/bin:$PATH                           # also append this to $HOME/.bash_profile
$ python3 -m pip install --ignore-installed --verbose pip setuptools    # use its own pip!
$ python3 -m pip install ck                                             # install CK

Optional

$ brew install gcc\@7 || brew link --overwrite gcc\@7                   # to avoid symlink conflict with oclint

Windows

Please see here.

Install QISKit

$ ck pull repo:ck-qiskit
$ ck install package:lib-python-qiskit --force_version=0.5.7

Test QISKit

Run a couple of tests to install some dependencies and test basic workflows.

Local execution

Run the following to install the software dependencies (accept most defaults by pressing Enter/Return) and run a simple QISKit test on a local simulator:

$ ck run program:qiskit-demo --cmd_key=quantum_coin_flip
...
 (printing output files)

    * tmp-stdout.tmp

      -- Ignoring SSL errors.  This is not recommended --

                  WARNING: There's no connection with IBMQuantumExperience servers.
                  cannot test I/O intesive tasks, will only test CPU intensive tasks
                  running the jobs in the local simulator

      The backends available for use are: ['local_qasm_simulator', 'local_statevector_simulator', 'local_unitary_simulator']

      User email: N/A

      COMPLETED
      {'counts': {'00': 4, '11': 6}}


    * tmp-stderr.tmp


Execution time: 0.000 sec.

Remote execution

Please register at IBM Quantum Experience ("IBM QX") and copy your API token from the "Advanced" tab (you may need to click on the "Regenerate" button first).

Now you can run the same test, but this time using the IBM QX remote simulator. When prompted, please provide your API token and the email address you used to register it.

These credentials will be stored on your computer in the form of a "CK environment entry" and automatically used for further experiments.

$ ck run program:qiskit-demo --cmd_key=quantum_coin_flip --env.CK_IBM_BACKEND=ibmq_qasm_simulator
...
 (printing output files)

    * tmp-stdout.tmp

      -- Ignoring SSL errors.  This is not recommended --
      The backends available for use are: ['ibmq_16_melbourne', 'ibmq_qasm_simulator', 'ibmqx2', 'ibmqx4', 'ibmqx5', 'local_qasm_simulator', 'local_statevector_simulator', 'local_unitary_simulator']

      User email: anton@dividiti.com

      COMPLETED
      {'creg_labels': 'cr[2]', 'additionalData': {'seed': 1}, 'time': 0.00023725, 'counts': {'11': 6, '00': 4}, 'date': '2018-09-26T11:40:38.802Z'}


Execution time: 0.000 sec.

You should now be all set to use CK-QISKit, running your quantum code both on the local simulator and on IBM's remote simulator and hardware!

IBM QX documentation

At a lower level, you can use the native QISKit Python API to call OpenQASM.

Real devices

Local simulators

  • local_qasm_simulator
  • local_statevector_simulator
  • local_unitary_simulator