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()asalg.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()andexecute(). Callingset_observables()orset_initial_state()causes the next call toevolve_state()orexecute()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 ofansatz_depth * total_paramsparameters, 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, withabs(gamma)of order one,t > 0, and0 < beta < 1[1]. The scale oftdepends on the mixing unitaries. These ranges are not enforced by the map, so use of an appropriately configured optimiser is recommended (seeset_optimiser()).For ansatz depth
p > 1and iterationl = 1, ..., p, letx = (l - 1) / (p - 1):gamma_l = (gamma / sigma) * (beta + (1 - beta) * x)t_l = t * (1 + (beta - 1) * x).Here
sigmais the population standard deviation of the observables. The map requires a positive, finitesigma. 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
algwith 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.