qdk_chemistry.algorithms.phase_estimation.circuit_builder.base module

QDK/Chemistry phase estimation builder abstractions.

class qdk_chemistry.algorithms.phase_estimation.circuit_builder.base.IterativeQpeCircuitBuilder(num_bits=-1, unitary_builder=None, controlled_circuit_mapper=None)[source]

Bases: QpeCircuitBuilder

Abstract base class for iterative phase estimation circuit builders.

Serves as a type-checking abstraction for implementations of the iterative (Kitaev-style) quantum phase estimation algorithm.

Parameters:
class qdk_chemistry.algorithms.phase_estimation.circuit_builder.base.QpeCircuitBuilder(num_bits=-1, unitary_builder=None, controlled_circuit_mapper=None)[source]

Bases: Algorithm

Abstract base class for phase estimation circuit builders.

Parameters:
__init__(num_bits=-1, unitary_builder=None, controlled_circuit_mapper=None)[source]

Initialize the QpeCircuitBuilder with default settings.

Parameters:
  • num_bits (int) – The number of phase bits to estimate. Default to -1; user needs to set a valid value.

  • unitary_builder (AlgorithmRef | None) – Optional algorithm reference for the unitary builder.

  • controlled_circuit_mapper (AlgorithmRef | None) – Optional algorithm reference for the controlled circuit mapper.

type_name()[source]

Return the algorithm type name as qpe_circuit_builder.

Return type:

str

run(*args, **kwargs)

Run the algorithm with the provided arguments.

This method wraps the internal _run_impl method to provide a consistent interface for executing the algorithm.

Parameters:
  • args – The arguments required to run the algorithm.

  • kwargs – The keyword arguments required to run the algorithm.

Returns:

The results of the algorithm

Return type:

Any

class qdk_chemistry.algorithms.phase_estimation.circuit_builder.base.QpeCircuitBuilderFactory[source]

Bases: AlgorithmFactory

Factory class for creating QpeCircuitBuilder instances.

__init__()[source]

Initialize the QpeCircuitBuilderFactory.

algorithm_type_name()[source]

Return the algorithm type name as qpe_circuit_builder.

Return type:

str

default_algorithm_name()[source]

Return qdk_iterative as default algorithm name.

Return type:

str

class qdk_chemistry.algorithms.phase_estimation.circuit_builder.base.QpeCircuitBuilderSettings[source]

Bases: Settings

Settings for the Phase Estimation Builder algorithm.

__init__()[source]

Initialize the settings for the Phase Estimation Builder.

Includes nested algorithm references for the evolution builder and the circuit mapper used to construct phase estimation circuits.

class qdk_chemistry.algorithms.phase_estimation.circuit_builder.base.StandardQpeCircuitBuilder(num_bits=-1, unitary_builder=None, controlled_circuit_mapper=None)[source]

Bases: QpeCircuitBuilder

Abstract base class for standard (QFT-based) phase estimation circuit builders.

Serves as a type-checking abstraction for implementations of the standard (non-iterative) quantum phase estimation algorithm using QFT.

Parameters: