[![PyPI](https://img.shields.io/pypi/v/kbw.svg)](https://pypi.org/project/kbw/)
[![AppImage](https://gitlab.com/quantum-ket/kbw/badges/master/pipeline.svg)](https://gitlab.com/quantum-ket/kbw/-/jobs)

# Ket Bitwise Simulator

Ket Bitwise Simulator (KBW) server is the quantum computer simulator of the Ket
Quantum Programming. The simulator executes Ket Quantum Assembly (.kqasm)
generated by the libket (and the Ket quantum programming language), using the
bitwise representation [[arxiv:2004.03560](https://arxiv.org/abs/2004.03560)]. 

### Table of contents:

* [Usage](#usage)  
* [Installation](#installation)
* [Ket Bitwise Plugins](#ket-bitwise-plugins)

## Usage

```console
$ kbw -h
usage: kbw [-h] [--version] [-b] [-p] [-l]

Ket Bitwise Simulator server

optional arguments:
  -h, --help  show this help message and exit
  --version   show program's version number and exit
  -b          Server bind
  -p          Server port
  -l          Extra plugin path
```
## Installation

Available installation methods:

* [pip](#install-using-pip)
* [Source](#install-from-source)

### Install using pip

To install using pip runs:
```console
$ pip install kbw
```

### Install from source 

Install requirements:

* C/C++ compiler
* CMake 
* Java
* Ninja or GNU Make
* SWIG
* cURL
* unzip

To install from source runs:
```console
$ git clone https://gitlab.com/quantum-ket/kbw.git
$ cd kbw
$ python setup.py install
```

## Ket Bitwise Plugins

To get start developing you own plugin for KBW we recommend modify the example
plugin: [example.cpp](plugin/example.cpp).  See
https://quantum-ket.gitlab.io/kbw/namespaceket.html for the Ket Bitwise API documentation.

To use your plugin you can re[install KBW from source](#install-from-source)
or add the compiled plugin to the extra plugin path.

### Compile example plugin

```console
$ git clone https://gitlab.com/quantum-ket/kbw.git
$ cd kbw
$ mkdir build
$ cd build 
$ cmake -GNinja ..
$ ninja example
```

### Add plugin to path

```console
$ kbw -l kbw/build/lib
```

> Do not execute KBW inside the project directory or subdirectories.  

-----------

This project is part of the Ket Quantum Programming, see the documentation for
more information https://quantum-ket.gitlab.io.

