LibKet

LibKet - Kwantum Expression Template Library

The open-source expression template library LibKet makes it possible to develop quantum-accelerated scientific applications and test them on different gate-based quantum computing platforms like Quantum Inspire, IBM's Quantum Experience and Rigetti's Quantum Cloud Services without the need to reimplement quantum algorithms in vendor-specific SDKs like Qiskit and PyQuil. LibKet is designed as C++14 expression template library that allows to formulate quantum algorithms as generic expressions, which are synthesized to backend-optimized quantum kernels that can be executed in quantum simulators and cloud-based quantum computers. Next to the basic quantum gates, LibKet comes with a growing collection of customizable quantum algorithms and building blocks like the Quantum Fourier transformation that simplify the development of quantum-accelerated applications.

The following code snippet shows how to generate the quantum kernel for an n-qubit QFT and execute it first on the Quantum Inspire simulator platform using 6-qubits and then on IBM's Quantum Experience cloud service using one of the 5-qubit quantum processors. Beneath it the generated cQASM code and circuit is shown.

q[0]
 
1.57
 
0.79
 
0.39
 
0.2
 
0.1
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
q[1]
 
1.57
 
 
 
 
 
 
1.57
 
0.79
 
0.39
 
0.2
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
q[2]
 
 
0.79
 
 
 
 
 
1.57
 
 
 
 
 
1.57
 
0.79
 
0.39
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
q[3]
 
 
 
0.39
 
 
 
 
 
0.79
 
 
 
 
1.57
 
 
 
 
1.57
 
0.79
 
 
 
 
 
 
 
 
 
 
 
 
 
q[4]
 
 
 
 
0.2
 
 
 
 
 
0.39
 
 
 
 
0.79
 
 
 
1.57
 
 
 
1.57
 
 
 
 
 
 
 
 
 
 
 
q[5]
 
 
 
 
 
0.1
 
 
 
 
 
0.2
 
 
 
 
0.39
 
 
 
0.79
 
 
1.57