qdk_chemistry.algorithms.circuit_mapper.psp_mapper module
QDK/Chemistry PREPARE-SELECT-PREPARE circuit mapper.
- class qdk_chemistry.algorithms.circuit_mapper.psp_mapper.PSPMapper[source]
Bases:
CircuitMapperCircuit mapper using the PREPARE-SELECT-PREPARE pattern.
Composes a block encoding from:
PREPARE — amplitude-loading into the ancilla register, resolved via the
preparesetting. Defaults toDensePureStatePreparation.SELECT — Pauli SELECT oracle applied on the system register, constructed directly from the block-encoding container’s SELECT data.
The two callables are stitched together by the Q#
PrepSelPrepoperation:\[B[H] = \mathrm{PREPARE}^\dagger \cdot \mathrm{SELECT} \cdot \mathrm{PREPARE}\]When the input is an
LCUWalkContainer, the block encoding is additionally wrapped with the reflection operator to form a quantum walk:\[W = (2|0\rangle\langle 0| - I) \cdot B[H]\]- resolve_lcu(container)[source]
Unwrap a container into its LCU data and whether it is a quantum walk.
- Parameters:
container (
UnitaryContainer) – The container held by the unitary representation.- Return type:
- Returns:
The LCU data and whether the container is a quantum walk.
- Raises:
ValueError – If the container is neither an LCU nor an LCU walk.
- build_prepare_select_ops(container)[source]
Return the PREPARE and SELECT Q# oracles and the system register size.
- Parameters:
container (
UnitaryContainer) – The container held by the unitary representation.- Return type:
- Returns:
The PREPARE Q# callable, the SELECT Q# callable, and the system register size.