Parameter Maps

Predefined Parameter Map Functions convert vectors of free parameters to variational parameters. Register a map with set_parameter_map().

Module Reference

Predefined Parameter Map Functions.

quop_mpi.parameter_maps.linear_ramp(weight_by_initial_state=False)

Create a parameter map for the non-variational QWOA linear schedule [1].

Pass the returned Parameter Map Function to set_parameter_map() as alg.set_parameter_map(linear_ramp()). Each ansatz iteration must contain one phase-shift unitary parameter followed by one or more mixing unitary time parameters. Mixing unitaries may have multiple time parameters; all receive the same value within an iteration.

The observable standard deviation is computed once and reused by evolve_state() and execute(). Calling set_observables() or set_initial_state() causes the next call to evolve_state() or execute() to recompute it. Use a separate map for each ansatz.

Parameters:
weight_by_initial_statebool, optional

Whether to weight the observable variance by initial-state probabilities, by default False (equal weight per basis state).

Returns:
callable

Map from (gamma, t, beta) to a 1-D array of ansatz_depth * total_params parameters, ordered by ansatz iteration as [gamma_1, t_1, ..., gamma_2, t_2, ...]. Each mixing unitary in an iteration receives the same time.

Notes

Typical choices are gamma < 0, with abs(gamma) of order one, t > 0, and 0 < beta < 1 [1]. The scale of t depends on the mixing unitaries. These ranges are not enforced by the map, so use of an appropriately configured optimiser is recommended (see set_optimiser()).

For ansatz depth p > 1 and iteration l = 1, ..., p, let x = (l - 1) / (p - 1):

gamma_l = (gamma / sigma) * (beta + (1 - beta) * x)

t_l = t * (1 + (beta - 1) * x).

Here sigma is the population standard deviation of the observables. The map requires a positive, finite sigma. At depth one the schedule is [gamma / sigma, t, ...]; beta is ignored and (gamma, t) is also accepted.

References

[1] (1,2)

T. Bennett, L. Noakes and J. B. Wang, “Analysis of the Non-variational Quantum Walk-based Optimisation Algorithm”, 2024. https://arxiv.org/abs/2408.06368

Examples

For an algorithm alg with observables, an initial state and compatible unitaries configured:

from quop_mpi.parameter_maps import linear_ramp

alg.set_depth(3)
alg.set_parameter_map(linear_ramp())
alg.evolve_state([-0.8, 0.4, 0.2])  # gamma, t, beta

Pass the same vector to execute() to optimise the three schedule values.