qdk_chemistry.algorithms.phase_estimation.circuit_builder.unary_phase_estimation_builder module
Unary-iteration phase estimation circuit builder.
- class qdk_chemistry.algorithms.phase_estimation.circuit_builder.unary_phase_estimation_builder.QdkUnaryQpeCircuitBuilder(num_queries=-1, unitary_builder=None, circuit_mapper=None)[source]
Bases:
QpeCircuitBuilderPhase estimation circuit builder driven by unary iteration.
Standard QPE applies controlled \(U^{2^k}\) once per phase qubit and therefore consumes a power-of-two number of walk queries. This builder instead emits a single chain of
num_queriesself-inverse walk blocks and uses unary iteration over the phase register to select which interleaved reflection is omitted, so any positive query count is supported.The phase register is prepared in a cosine window state to suppress the spectral leakage of the truncated schedule. The unitary builder must set
quantum_walk=Truefor the post-processing formula.References
- Parameters:
num_queries (int)
unitary_builder (AlgorithmRef | None)
circuit_mapper (AlgorithmRef | None)
- __init__(num_queries=-1, unitary_builder=None, circuit_mapper=None)[source]
Initialize the unary-iteration QPE circuit builder.
- Parameters:
num_queries (
int) – Number of queries to the block encoding. Default to -1; user needs to set a valid value.unitary_builder (
AlgorithmRef|None) – Optional algorithm reference for the unitary builder.circuit_mapper (
AlgorithmRef|None) – Optional algorithm reference for the block-encoding circuit mapper.
- Return type:
None
- resolve_num_queries()[source]
Return the query count to apply and the phase-register size addressing it.
- Return type:
- Returns:
The number of walk blocks the schedule applies, and the number of phase qubits needed to address its
num_queries + 1reflection slots.- Raises:
ValueError – If the configured
num_queriesis not a positive integer.
- class qdk_chemistry.algorithms.phase_estimation.circuit_builder.unary_phase_estimation_builder.QdkUnaryQpeCircuitBuilderSettings[source]
Bases:
QpeCircuitBuilderSettingsSettings for the unary-iteration phase estimation circuit builder.
- qdk_chemistry.algorithms.phase_estimation.circuit_builder.unary_phase_estimation_builder.cosine_window_state(num_queries)[source]
Return the phase-register amplitudes, zero-padded to a whole number of qubits.
The cosine window is the Heisenberg-limited control state of [BGB+18] (Eq. 17), \(\psi_t \propto \sin(\pi (t + 1) / (p + 2))\) over the \(p + 1\) reflection slots.