qdk_chemistry.algorithms.hadamard_test.circuit_builder.base module

QDK/Chemistry Hadamard test circuit builder abstractions.

class qdk_chemistry.algorithms.hadamard_test.circuit_builder.base.HadamardTestCircuitBuilder(controlled_circuit_mapper=None, test_basis=HadamardTestBasis.X)[source]

Bases: Algorithm

Abstract base class for Hadamard test circuit builders.

A circuit builder turns a prepared state and a target unitary into a single backend-specific Hadamard test circuit. It owns the controlled circuit mapper used to synthesize the controlled evolution.

Parameters:
__init__(controlled_circuit_mapper=None, test_basis=HadamardTestBasis.X)[source]

Initialize the Hadamard test circuit builder.

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

  • test_basis (HadamardTestBasis) – Measurement basis for the control qubit (HadamardTestBasis.X or HadamardTestBasis.Y).

type_name()[source]

Return the algorithm type name as hadamard_test_circuit_builder.

Return type:

str

class qdk_chemistry.algorithms.hadamard_test.circuit_builder.base.HadamardTestCircuitBuilderFactory[source]

Bases: AlgorithmFactory

Factory class for creating Hadamard test circuit builder instances.

__init__()[source]

Initialize the HadamardTestCircuitBuilderFactory.

algorithm_type_name()[source]

Return the algorithm type name as hadamard_test_circuit_builder.

Return type:

str

default_algorithm_name()[source]

Return ‘qdk’ as the default algorithm name.

Return type:

str

class qdk_chemistry.algorithms.hadamard_test.circuit_builder.base.HadamardTestCircuitBuilderSettings[source]

Bases: Settings

Settings for the Hadamard test circuit builder algorithm.

__init__()[source]

Initialize the settings for the Hadamard test circuit builder.