Skip to content
Construct PsiQDK Algorithms

presets

presets

Presets for different common QPE cases.

generic_unitary

generic_unitary(*, op: Qubrick | Callable, bits_of_precision: int | None = None, num_time_samples: int | None = None, signal_source_state: SignalSourceStateFactory | Iterable[complex] | int | None = None, window_function: WindowFunction | None = None, time_frequency_transformation: TimeFrequencyTransformation | None = None, bound_arguments: dict[str, Any] | None = None) -> QPEBuilder

Helper function to get a generic-unitary-based QPEBuilder.

The op can have any signature, as long as every argument other than the signal source register and the time sample register is supplied through bound_arguments. Those two are then filled in at runtime: the time sample register goes to ctrl, cond or condition_mask if the op has one, otherwise to the next free parameter, and the signal source register goes to the first free parameter.

Parameters:

Name Type Description Default
op Qubrick | Callable

The unitary to sample the signal from, as either a Qubrick or a callable.

required
bits_of_precision int | None

Number of qubits used to represent the phase.

None
num_time_samples int | None

Total number of times sampled.

None
signal_source_state SignalSourceStateFactory | Iterable[complex] | int | None

The state to estimate the phase of, or a factory for it.

None
window_function WindowFunction | None

Window function applied to the time frequency register.

None
time_frequency_transformation TimeFrequencyTransformation | None

Transformation between the time and frequency domains.

None
bound_arguments dict[str, Any] | None

Values for every argument of op other than the two registers, for example bound_arguments={"angle": 90, "extra_arg": Qubits(3, qpu=qpu)}.

None

phase_debug

phase_debug(*, angle: float | RotationAngle | None, bits_of_precision: int | None = None, num_time_samples: int | None = None, window_function: WindowFunction | None = None, time_frequency_transformation: TimeFrequencyTransformation | None = None) -> QPEBuilder

Helper function to get a fast-forward-phase-based QPEBuilder.

diagonal_unitary

diagonal_unitary(*, matrix_diag: Iterable[complex], bits_of_precision: int | None = None, num_time_samples: int | None = None, signal_source_state: SignalSourceStateFactory | Iterable[complex] | int | None = None, window_function: WindowFunction | None = None, time_frequency_transformation: TimeFrequencyTransformation | None = None) -> QPEBuilder

Helper function to get a QPEBuilder for simulations based on diagonal unitaries.