guppyalgos.algorithms.block_encoding.qubitization

Qubitization walk operator.

Classes

Qubitization()

Guppy struct representing the qubitization walk operator.

QubitizationCntrl()

Externally controlled qubitization walk operator.

class guppyalgos.algorithms.block_encoding.qubitization.Qubitization

Guppy struct representing the qubitization walk operator.

The walk operator is

\[ W = R L, \]

where \(L\) is an LCU block encoding and \(R\) is a reflection about the all-zero state of the PREPARE register. compose applies \(L\) first and then \(R\), matching the right-to-left operator ordering above. The target registers are acted on by \(L\), while \(R\) acts only on the PREPARE register.

For a Hermitian operator \(H\) block encoded as \(H / \lambda\), projecting the PREPARE register of \(W^k\) onto the all-zero state gives the Chebyshev polynomial \(T_k(H / \lambda)\).

Currently, block_encoding must be an LCU block encoding. This constraint should be relaxed in the future to support arbitrary block encodings.

Type Parameters:

n_prep_q: Number of qubits in the PREPARE register. n_ctrl_q: Number of controls used by the reflection implementation. TargetRegs: Type of the target registers accepted by the block encoding.

Variables:
  • block_encoding – LCU block encoding \(L\).

  • reflection – Reflection \(R\) acting on the PREPARE register.

block_encoding
compose(prep_register, target_registers)

Apply the qubitization walk operator \(W = R L\).

Parameters:
  • prep_register – The PREPARE register.

  • target_registers – The target registers acted on by SELECT.

power(prep_register, target_registers, power)

Apply \(W^k\), where \(k\) is the given power.

Parameters:
  • prep_register – The PREPARE register.

  • target_registers – The target registers acted on by SELECT.

  • power – The power to which the walk operator is raised.

reflection
class guppyalgos.algorithms.block_encoding.qubitization.QubitizationCntrl

Externally controlled qubitization walk operator.

PREPARE and UNPREPARE are applied unconditionally, while SELECT and the reflection are controlled. Thus the operation is the identity when the external control is zero and applies \(W = RL\) when it is one.

The reflection convention used here is \(R = I - 2\lvert 0\rangle\!\langle 0\rvert\). Consequently, projecting the PREPARE register of \(W^k\) onto zero gives \((-1)^k T_k(H / \lambda)\). Unlike for uncontrolled qubitization, this factor is a relative phase between the external-control branches and is therefore observable.

cntrl_block_encoding
compose(control, prep_register, target_registers)

Apply one controlled qubitization walk step.

controlled_reflection
power(control, prep_register, target_registers, power)

Apply a positive power of the controlled walk operator.