Skip to content
This repository has been archived by the owner on Jan 23, 2023. It is now read-only.

Native Gateset

Ethan Smith edited this page Mar 21, 2020 · 6 revisions

Building and Installing

There is an experimental gateset that is implemented in native code to be faster. It implements a QubitCNOTLinear gateset. To use it, you must build and install the native library located in the native/ directory. Below are the steps for doing so:

  1. Install openblas. On Debian based distros this is libopenblas-dev. On macOS, you can install it via Homebrew as brew install openblas.

  2. Install rustup via https://rustup.rs. The defaults for platform should be fine.

  3. Switch to the nightly toolchain using rustup default nightly.

  4. Install maturin with cargo install maturin. You may need to do source ~/.cargo/env first.

  5. Run ./scripts/build_rust.sh, and wait. The script should build, package, and install the rust package.

  6. Done! You should now be able to use the COBYLA_SolverNative solver from search_compiler.solver.

Usage

You can use the native gateset in order to achieve significantly faster synthesis speeds. Note that currently, only the default gateset, QubitCNOTLinear, is supported by the rust code.

import search_compiler as sc
# Use with a project (remember to use the default sc.QubitCNOTLinear() gateset)
p = sc.Project("myproject")
p["solver"] = sc.solver.COBYLA_SolverNative()

# Use with SearchCompiler directly
compiler = sc.SearchCompiler(solver=sc.solver.COBYLA_SolverNative())
Clone this wiki locally