Fast Approximate BLock Encodings (FABLE)
FABLE can synthesize quantum circuits for approximate block-encodings of matrices. A block-encoding is the embedding of a matrix in the leading block of of a larger unitary matrix.
FABLE is a quantum representation for dense, unstructured matrices. The gate complexity of FABLE circuits scales linear in the number of matrix elements, which is optimal for the unstructured case. FABLE includes a circuit compression algorithm that can significantly reduce the gate complexity and works particularly well if there is certain structure available in the matrix to be block encoded.
We provide two reference implementations of the FABLE algorithm:
Qiskit - Python Implementation
FABLE can be installed from PyPI as follows:
pip install fable-circuits
After installation, it can be loaded and used as follows:
from fable import fable
import numpy as np
from qiskit import Aer
simulator = Aer.get_backend("unitary_simulator")
# generate a random matrix and block encode it
n = 3
N = 2**n
A = np.random.randn(N, N)
circ, alpha = fable(A, 0)
result = simulator.run(circ).result()
unitary = result.get_unitary(circ)
np.linalg.norm(alpha * N * unitary.data[0:N, 0:N] - A)/np.linalg.norm(A)
QCLAB - MATLAB Implementation
In order to run the MATLAB implementation of FABLE:
- Install QCLAB
- Clone FABLE and add
fable-qclabdirectory to your MATLAB path.
After installation, FABLE can be run for a target matrix A as either:
logging = true ;
[circuit, OA, alpha, info] = fable( A, 'cutoff', 1e-4, logging ) ;
[circuit, OA, alpha, info] = fable( A, 'percentage', 80, logging ) ;
The first option ('cutoff') ignores coefficients smaller than 1e-4 in absolute value, the second option
('percentage') applies an 80% compression and only retains the 20% largest coefficients. The 'percentage' and logging options are only available in the MATLAB version of FABLE.
Reference
Cite the following reference for FABLE:
FABLE: Fast Approximate Quantum Circuits for Block-Encodings, Daan Camps, Roel Van Beeumen, 2022 2022 IEEE International Conference on Quantum Computing and Engineering (QCE), arXiv:2205.00081.
Developers - Lawrence Berkeley National Laboratory
About
FABLE Copyright (c) 2022, 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). 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 IPO@lbl.gov.
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.
Metadata
Release files for fable-circuits 1.0.2
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| fable_circuits-1.0.2.tar.gz | 5.0 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| fable_circuits-1.0.2-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 10.6 kB
Release files / fable_circuits-1.0.2.tar.gz
| Download URL | fable_circuits-1.0.2.tar.gz |
|---|---|
| Size | 5.0 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
0f1806385457ee9bae87fe14a540cad84a969a04f18ed52ccc3dce73ee2aadc3
|
|
BLAKE2b-256 checksum How to use checksums |
cc0c45f3ee2ac83a38b21610b6133e8f666de6b0fff10f3a4649d6bad9f075ee
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.0.1 CPython/3.9.13
|
Release files / fable_circuits-1.0.2-py3-none-any.whl
| Download URL | fable_circuits-1.0.2-py3-none-any.whl |
|---|---|
| Size | 5.6 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
54aa33bc1042cdea42bcff333e8f3cb12a3b3a49a6259e2807096ef7bc1c36ad
|
|
BLAKE2b-256 checksum How to use checksums |
454655921ee669dd6a25d942c323867665afac8a0dc2f952c72b58a2af44efb9
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.0.1 CPython/3.9.13
|