BlockEncoding.chebyshev#

BlockEncoding.chebyshev(k: int, rescale: bool = True) BlockEncoding[source]#

Returns a BlockEncoding representing \(k\)-th Chebyshev polynomial of the first kind applied to the operator.

For a block-encoded Hermitian operator \(A\) with normalization factor \(\alpha\), this method returns a BlockEncoding of the rescaled operator \(T_k(A)\) if rescale=True, or \(T_k(A/\alpha)\) if rescale=False.

Parameters:
kint

The order of the Chebyshev polynomial. Must be a non-negative integer.

rescalebool, optional

If True (default), the method returns the a block-encoding of \(T_k(A)\), If False, the method returns a block-encoding of \(T_k(A/\alpha)\).

Returns:
BlockEncoding

A new BlockEncoding instance representing the Chebyshev polynomial transformation.

Notes

  • The Chebyshev polynomial approach is useful for polynomial approximations and spectral methods.

  • Should be used sparingly, primarily to combine a few block encodings. For larger-scale polynomial transformations, Quantum Signal Processing (QSP) is the superior method (see poly()).

  • Normalization:
    • rescale=True: The normalization factor is determined by the Quantum Eigenvalue Transform (QET).

    • rescale=False: If \(k=1\), the resulting block-encoding maintains the same scaling factor \(\alpha\) as the original. Otherwise, the scaling factor is \(1\).

Examples

Define a block-encoding and apply the Chebyshev polynomial transformation.

from qrisp import *
from qrisp.block_encodings import BlockEncoding
from qrisp.operators import X, Y, Z

H = X(0)*X(1) + 0.5*Z(0)*Z(1)
BE = BlockEncoding.from_operator(H)

# Apply Chebyshev polynomial of order 2
BE_cheb = BE.chebyshev(2)

def operand_prep():
    qv = QuantumFloat(2)
    return qv

@terminal_sampling
def main(BE):
    qv = BE.apply_rus(operand_prep)()
    return qv

main(BE_cheb)