-
Notifications
You must be signed in to change notification settings - Fork 9
Native Gateset
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:
-
Install openblas. On Debian based distros this is
libopenblas-dev
. On macOS, you can install it via Homebrew asbrew install openblas
. -
Install rustup via https://rustup.rs. The defaults for platform should be fine.
-
Switch to the nightly toolchain using
rustup default nightly
. -
Install maturin with
cargo install maturin
. You may need to dosource ~/.cargo/env
first. -
Run
./scripts/build_rust.sh
, and wait. The script should build, package, and install the rust package. -
Done! You should now be able to use the
COBYLA_SolverNative
solver fromsearch_compiler.solver
.
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())