Skip to content

workbench_algorithms.experimental.subroutines.multiplexed_rotations

Submodule imports for experimental multiplexed rotations.

GrayCodeMultiplexedSingleQubitRotation

GrayCodeMultiplexedSingleQubitRotation(**kwargs)

Bases: Qubrick

Decomposition of uniformly controlled rotations to single qubit rotation + CNOTs.

Figure 2 in arXiv:0407010.

compute

compute(
    index_reg: Qubits,
    target_reg: Qubits,
    rot_data: MultiplexedRotationDataInterface,
    ctrl: Qubits | int = 0,
)

Compute the multiplexed rotation.

Parameters:

Name Type Description Default
index_reg Qubits

Index qubits.

required
target_reg Qubits

Target qubit.

required
rot_data MultiplexedRotationDataInterface

Encodes the data needed to implement the uniformly controlled rotations.

required
ctrl Qubits | int

Register to control on. Defaults to 0.

0

MultiplexedSingleQubitRotationViaQROM

MultiplexedSingleQubitRotationViaQROM(
    qrom: QROM,
    rotation_qbk: SuperpositionRotations,
    controlled_on: bool | None = None,
    lambda_val: int | None = None,
    **kwargs,
)

Bases: Qubrick

Multiplexor using data-lookup oracles.

Detailed in arXiv:1812.00954 (circuit described in Appendix D).

This technique for multiplexed rotations works by first loading a truncated, integerized, b-bit approximation of rotation angles onto an ancillary register and then performing the rotations coherently in superposition controlled on this register.

Parameters:

Name Type Description Default
qrom QROM

Data-loader for loading angles to b_of_p-bits of precision.

required
rotation_qbk SuperpositionRotations

Qubrick to implement the actual rotations (e.g. via phase gradient addition).

required
controlled_on bool | None

whether the prep circuit is controlled on, default to None.

None
lambda_val int | None

the SEL-SWAP tunable parameter, default to None and optimized Toffoli version is used.

None
**kwargs dict[str, Any]

Other arguments to pass to the init.

{}

controlled_on property

controlled_on: Qubrick

Flag to determine which component to control the Qubrick on, QROM or the rotations.

compute

compute(
    index_reg: Qubits,
    target_reg: Qubits,
    rot_data: MultiplexedRotationDataInterface,
    ctrl: Qubits | int = 0,
)

Compute circuit for Data-lookup multiplexor.

Parameters:

Name Type Description Default
index_reg Qubits

Index register.

required
target_reg Qubits

Register to apply rotations onto.

required
rot_data MultiplexedRotationDataInterface

Dataclass that containerizes the classical input data needed for the multiplexed rotations.

required
ctrl Qubits | int

Control register.

0

NaiveMultiplexedSingleQubitRotation

NaiveMultiplexedSingleQubitRotation(
    multiplexor: Multiplexor = None, **kwargs
)

Bases: Qubrick

Controlled rotations from arXiv:0407010.

Parameters:

Name Type Description Default
multiplexor Multiplexor

Qubrick for implementing the multiplexing over the rotations.

None
**kwargs dict[str, Any]

Other arguments to pass to the init.

{}

multiplexor property

multiplexor

Getter for the multiplexor.

compute

compute(
    index_reg: Qubits,
    target_reg: Qubits,
    rot_data: MultiplexedRotationDataInterface,
    ctrl: Qubits | int = 0,
)

Compute the multiplexed rotation.

Parameters:

Name Type Description Default
index_reg Qubits

Index qubits.

required
target_reg Qubits

Target qubits.

required
rot_data MultiplexedRotationDataInterface

Dataclass that containerizes the classical input data needed for the multiplexed rotations.

required
ctrl Qubits | int

Register to control on.

0