Skip to content

workbench_algorithms.subroutines.phase_gradient_adder

Qubrick for phase gradient adder.

PhaseGradientAdder

PhaseGradientAdder(**kwargs)

Bases: Qubrick

Optimized adder for use in phase gradient addition.

Parameters:

Name Type Description Default
**kwargs dict[str, Any]

Keyword arguments

{}

compute

compute(lhs: QUInt, rhs: QUInt, ctrl: Qubits | None = None)

Circuit for optimized phase gradient adder.

This construction comes from Fig. 13 in arXiv:2007.07391.

Parameters:

Name Type Description Default
lhs QUInt | None

The register with the phase gradient catalyst state. May be None when rhs is a single qubit and the implicit one-qubit catalyst is dropped.

required
rhs QUInt

The register we are adding into the phase gradient register.

required
ctrl (Optional, int | Qubits)

Control register. Defaults to 0 (i.e. no control).

None
Note
  • The phase gradient register is usually one qubit smaller than the rhs.
  • However, there exists at least one known case where they are equal in size (ex. when using GivensRotationTwoAdders).
  • When they are the same size, we can actually drop a CZ, and so, we distinguish these cases.
  • For rhs two qubits and lhs one qubit shorter than rhs, the Fig.~13 chain collapses to three bilinear gates (no temporary elbow). With no adder control, those are lhs.z(rhs[0]), lhs.x(rhs[0]), rhs[1].z(). With a control register ctrl (e.g. bidirectional rotation tests), merge ctrl into each gate as lhs[0].z(rhs[0] | ctrl), lhs[0].x(rhs[0] | ctrl), rhs[1].z(cond=ctrl).
  • For lhs and rhs both a single qubit, only the closing segment remains (matching GidneyAdd on one-qubit lhs).