Matrix transform sequences

oracq.algorithms.common.transforms

Assembly of qubitization, explicit QSVT phase sequences and oblivious amplification.

oracq.algorithms.common.transforms.qubitization_walk(a)[source]

Assemble the qubitization walk operation of a block encoding a.

It first invokes a forward, then applies the positive reflection of the signal about the zero subspace, yielding a walk operator of the form (2 P_0 - I) U; the registers follow the target and signal signature of a.

Parameters:

a – The input BlockEncoding.

Returns:

Walk operation that keeps the module call to a.

Return type:

Operation

oracq.algorithms.common.transforms.qsvt_sequence(a, phases)[source]

Assemble a QSVT circuit for a block encoding a from an explicit phase sequence.

The phases are ordered in time, phases[0] acting first; len(phases) phases accompany len(phases) - 1 calls to a, alternating forward and inverse; each phase is composed from a global phase and a controlled phase on the zero subspace of signal. The phase convention matches the phase synthesis of the qsvt module.

Parameters:
  • a – The input BlockEncoding.

  • phases – Phase sequence in radians; elements may be any value convertible to float.

Returns:

QSVT operation whose calls to a are kept as module calls.

Return type:

Operation

oracq.algorithms.common.transforms.oblivious_amplification(a, iterations=1)[source]

Assemble oblivious amplitude amplification for a block encoding a.

It first invokes a forward; each round then performs the zero reflection of signal, the inverse call to a, another zero reflection and the forward call, amplifying the zero-signal projected component.

Parameters:
  • a – The input BlockEncoding.

  • iterations – Number of amplification rounds, one by default.

Returns:

Operation whose iterations are kept in an RIR Repeat.

Return type:

Operation