Tutorials
qcr:2607.55672.1

Block Encoding with Matrix Access Oracles

This PennyLane demo explains how to block encode a non-unitary matrix, embedding it as a sub-block of a larger unitary so that algorithms such as quantum phase estimation and the quantum singular value transformation can act on it even though quantum computers only perform unitary evolutions. It focuses on the matrix access oracle framework, in which a Hadamard transform, an oracle U_A that encodes matrix entries into an ancilla amplitude, and an oracle U_B that handles indexing combine to place the target matrix in the top-left block of the circuit unitary. The tutorial first builds the Fast Approximate BLock Encodings (FABLE) method of Camps and Van Beeumen, which replaces multi-controlled rotations with a sequence of single Ry rotations and CNOTs using a transformation of the matrix elements, and shows that small rotation angles can be pruned and redundant CNOTs cancelled to compress the circuit without losing accuracy for structured matrices. It then presents a second construction for sparse matrices following Camps, Lin, Van Beeumen, and Yang, encoding only the non-zero entries and implementing U_B with left and right shift operators. Both circuits are verified by comparing the encoded block against the original matrix. Block encoding is a foundational primitive underlying much of modern quantum algorithm design.
Linear Algebra
Qubit
Circuit-based
Uploaded 4 weeks ago
9
Views
GitHub675
Citing this entry? Use this QCR ID
Uploaded by
QL
QCR Librarian

Overview

PennyLaneAI/demos
675242
README.md

Block Encoding with Matrix Access Oracles

This PennyLane demo explains how to block encode a non-unitary matrix, embedding it as a sub-block of a larger unitary so that algorithms such as quantum phase estimation and the quantum singular value transformation can act on it even though quantum computers only perform unitary evolutions. It focuses on the matrix access oracle framework, in which a Hadamard transform, an oracle U_A that encodes matrix entries into an ancilla amplitude, and an oracle U_B that handles indexing combine to place the target matrix in the top-left block of the circuit unitary. The tutorial first builds the Fast Approximate BLock Encodings (FABLE) method of Camps and Van Beeumen, which replaces multi-controlled rotations with a sequence of single Ry rotations and CNOTs using a transformation of the matrix elements, and shows that small rotation angles can be pruned and redundant CNOTs cancelled to compress the circuit without losing accuracy for structured matrices. It then presents a second construction for sparse matrices following Camps, Lin, Van Beeumen, and Yang, encoding only the non-zero entries and implementing U_B with left and right shift operators. Both circuits are verified by comparing the encoded block against the original matrix. Block encoding is a foundational primitive underlying much of modern quantum algorithm design.

Run it

pip install -r requirements.txt
python demo.py

Source and license

Imported from demonstrations_v2/tutorial_block_encoding/demo.py in PennyLaneAI/demos at c52c0abeb5122218aa96b38eea848864cce7323f, under the Apache License 2.0. Original authors: Xanadu and the PennyLane community. The upstream LICENSE is included alongside this example.

Join the Discussion

Comments (0)

No comments yet. Be the first to share your thoughts!

Indexed by QCR Librarian

This entry was created automatically from publicly available records. QCR links to public sources and only stores repository content where the license permits redistribution.

Versions

v1 Latest
Jul 14, 2026
qcr:2607.55672.1

Cite all versions? Use the base QCR ID to always reference the latest version of this entry.

Tools used

PennyLane

Keywords

pennylane
block-encoding
fable
sparse-matrices
matrix-oracles
qsvt

You may also like5