Skip to content

workbench_algorithms.subroutines.phase_gradient_unified

.. Copyright © 2024-2026 PsiQuantum Corp. All rights reserved. PSIQUANTUM CORP. CONFIDENTIAL This file includes unpublished proprietary source code of PsiQuantum Corp. The copyright notice above does not evidence any actual or intended publication of such source code. Disclosure of this source code or any related proprietary information is strictly prohibited without the express written permission of PsiQuantum Corp.

Module containing Qubricks for phase gradient functionality (NaivePhaseGradient, PhaseGradientViaPhaseCatalystState).

NaivePhaseGradient

NaivePhaseGradient(**kwargs)

Bases: Qubrick

Implement a phase gradient with a specified base angle.

This naive version simply applies a sequence of phase gates with angles that are halved for each subsequent qubit in the target register.

Note
  • For definition of a phase gradient, refer to Craig Gidney's blog post: https://algassert.com/post/1708

compute

compute(
    target_reg: Qubits,
    base_angle: float | RotationAngle = ...,
    error_param: float = 0,
    ctrl: Qubits | int = 0,
)

Compute phase gradient circuit.

The default base angle is 180 degrees, which corresponds to a Z gate.

Parameters:

Name Type Description Default
target_reg Qubits

Target register upon which to apply rotations (a gradient of rotations).

required
base_angle float | RotationAngle

Base angle from which subsequent angles are divided by 2^k where k iterates over the target register.

...
error_param float

Precision of each angle in phase gradient, not overall error.

0
ctrl Qubits | int

Quantum control.

0