Skip to content

Commit

Permalink
Update README.md
Browse files Browse the repository at this point in the history
  • Loading branch information
mtkgv authored Dec 11, 2024
1 parent 54c55aa commit 3d26dab
Showing 1 changed file with 40 additions and 51 deletions.
91 changes: 40 additions & 51 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,75 +1,64 @@
# Berkeley Quantum Synthesis Toolkit (BQSKit)
# Berkeley Quantum Synthesis Toolkit (BQSKit) PAM Variants

The Berkeley Quantum Synthesis Toolkit (BQSKit) \[bis • kit\] is a powerful
and portable quantum compiler framework. It can be used with ease to compile
quantum programs to efficient physical circuits for any QPU.
This fork of BQSKit implements variants of Permutation-Aware Mapping (PAM [1].

[1] J. Liu, E. Younis, M. Weiden, P. Hovland, J. Kubiatowicz and C. Iancu,
"Tackling the Qubit Mapping Problem with Permutation-Aware Synthesis," 2023 IEEE
International Conference on Quantum Computing and Engineering (QCE), Bellevue, WA,
USA, 2023, pp. 745-756, doi: 10.1109/QCE57702.2023.00090.

## Installation

BQSKit is available for Python 3.8+ on Linux, macOS, and Windows. BQSKit
and its dependencies are listed on the [Python Package Index](https://pypi.org),
and as such, pip can easily install it:
1. Set up a python virtual environment.
2. Install BQSKit using the [Github instructions](https://github.com/BQSKit/bqskit),
to get its dependencies.
3. Clone this repo and perform an editable install of it.

```sh
python -m venv /path/to/venv

source /path/to/venv/bin/activate

pip install bqskit

git clone [email protected]:m-tremba/bqskit.git

pip install -e /path/to/repo
```

## Basic Usage

A standard BQSKit workflow loads a program into the framework, models the
target QPU, compiles the program, and exports the resulting circuit. The
below example uses BQSKit to optimize an input circuit provided by a qasm
file:
Variants are implemented in different branches of the repo. To change variants, change
branches using git.

```sh
git checkout branch_name
```

To compile circuits using the variants, try building a workflow using the default
PAM workflow builder function included in `bqskit.compiler.compile`{:python}.

```python
from bqskit import compile, Circuit
from bqskit import Circuit
from bqskit.compiler.compiler import Compiler
from bqskit.compiler.workflow import Workflow
from bqskit.compiler.compile import build_seqpam_mapping_optimization_workflow

# Load a circuit from QASM
circuit = Circuit.from_file("input.qasm")

# Create PAM variant workflow
workflow = build_seqpam_mapping_optimization_workflow()

# Compile the circuit
compiled_circuit = compile(circuit)
with Compiler() as compiler:
compiled_circuit = compiler.compile(circuit.copy(), workflow)

# Save output as QASM
compiled_circuit.save("output.qasm")
```

To learn more about BQSKit, follow the
[tutorial series](https://github.com/BQSKit/bqskit-tutorial/) or refer to
the [documentation](https://bqskit.readthedocs.io/en/latest/).

## How to Cite

You can use the [software disclosure](https://www.osti.gov/biblio/1785933)
to cite the BQSKit package.

Additionally, if you used or extended a specific algorithm, you should cite
that individually. BQSKit passes will include a relevant reference in
their documentation.

## License

The software in this repository is licensed under a **BSD free software
license** and can be used in source or binary form for any purpose as long
as the simple licensing requirements are followed. See the
**[LICENSE](https://github.com/BQSKit/bqskit/blob/master/LICENSE)** file
for more information.

## Copyright

Berkeley Quantum Synthesis Toolkit (BQSKit) Copyright (c) 2021,
The Regents of the University of California, through Lawrence
Berkeley National Laboratory (subject to receipt of any required
approvals from the U.S. Dept. of Energy) and Massachusetts
Institute of Technology (MIT). All rights reserved.

If you have questions about your rights to use or distribute this software,
please contact Berkeley Lab's Intellectual Property Office at [email protected].
## Other Information

NOTICE. This Software was developed under funding from the U.S. Department
of Energy and the U.S. Government consequently retains certain rights. As
such, the U.S. Government has been granted for itself and others acting on
its behalf a paid-up, nonexclusive, irrevocable, worldwide license in the
Software to reproduce, distribute copies to the public, prepare derivative
works, and perform publicly and display publicly, and to permit others to
do so.
For all other information, including citations, licenses, and copyright,
see the parent BQSKit repo.

0 comments on commit 3d26dab

Please sign in to comment.