qdk_chemistry.algorithms.controlled_circuit_mapper package

QDK/Chemistry controlled circuit mapper module.

class qdk_chemistry.algorithms.controlled_circuit_mapper.ControlledCircuitMapperFactory

Bases: AlgorithmFactory

Factory class for creating ControlledCircuitMapper instances.

algorithm_type_name()

Return controlled_circuit_mapper as the algorithm type name.

Return type:

str

default_algorithm_name()

Return pauli_sequence as the default algorithm name.

Return type:

str

class qdk_chemistry.algorithms.controlled_circuit_mapper.ControlledCircuitMapperSettings

Bases: Settings

Settings for the ControlledCircuitMapper.

control_indices

The control qubit indices. Defaults to [0].

target_indices

The target qubit indices. An empty list means auto-fill based on the unitary’s qubit count and control indices.

__init__()

Initialize the settings for ControlledCircuitMapper.

class qdk_chemistry.algorithms.controlled_circuit_mapper.ControlledPSPMapper

Bases: ControlledCircuitMapper

Controlled circuit mapper using the PREPARE-SELECT-PREPARE pattern.

Composes a controlled block encoding from:

  1. PREPARE — amplitude-loading into the ancilla register, resolved via the prepare setting. Defaults to DensePureStatePreparation.

  2. 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# PrepSelPrep operation:

\[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]\]
__init__()

Initialize the ControlledPSPMapper.

name()

Return the algorithm name.

Return type:

str

Returns:

The name "prepare_select_prepare".

Return type:

str

type_name()

Return the algorithm type name.

Return type:

str

Returns:

The type name "controlled_circuit_mapper".

Return type:

str

class qdk_chemistry.algorithms.controlled_circuit_mapper.ControlledPSPMapperSettings

Bases: ControlledCircuitMapperSettings

Settings for the ControlledPSPMapper.

prepare

Algorithm reference for the PREPARE oracle state preparation. Defaults to DensePureStatePreparation.

__init__()

Initialize the settings for ControlledPSPMapper.

class qdk_chemistry.algorithms.controlled_circuit_mapper.ControlledPauliSequenceMapper

Bases: ControlledCircuitMapper

Controlled evolution circuit mapper using Pauli product formula term sequences.

Given a time-evolution operator expressed as a Pauli product formula \(U(t) \approx \left[ U_{\mathrm{step}}(t / r) \right]^{r}\), this mapper constructs a controlled version of \(U(t)\) using the following pattern:

  1. Each Pauli operator \(P_j\) is basis-rotated into the \(Z\) basis.

  2. Qubits involved in \(P_j\) are entangled into a sequence using CNOT gates.

  3. A controlled \(R_z\) rotation implements

    \(e^{-i\,\theta_j\,P_j} \;\rightarrow\; \text{CRZ}(2 \theta_j)\).

  4. The basis rotations and entangling operations are uncomputed.

Notes

  • Currently supports only single-control-qubit scenarios.

  • Requires a PauliProductFormulaContainer for the time evolution unitary.

__init__()

Initialize the PauliSequenceMapper.

name()

Return the algorithm name.

Return type:

str

type_name()

Return controlled_circuit_mapper as the algorithm type name.

Return type:

str

Submodules