Quantum circuit simulator in Swift

SwiftQuantumComputing

Quantum circuit simulator in Swift.

Usage

Check code in Circuit.playground.

Algorithms

  • Use a genetic algorithm to automatically generate a quantum circuit - Check example in Genetic.playground.
  • Two-level decomposition: Decompose any gate into an equivalent sequence of not gates and fully controlled phase shifts, z-rotations, y-rotations & not gates - Check example in TwoLevelDecomposition.playground.

Other algorithms

More examples

Linux

This package depends on BLAS if running on Linux, more exactly, Ubuntu.

This dependency is reflected in Package.swift with CBLAS-Linux, which in turn expects to find the following file: /usr/include/x86_64-linux-gnu/cblas-netlib.h. So, after installing BLAS (in case it is not already there):

sudo apt-get install libblas-dev

Check cblas-netlib.h is in the expected location.

GitHub

https://github.com/indisoluble/SwiftQuantumComputing