scan_interp_1d

scan_interp_1d(program, theta_1, theta_2, *, n_points=51, reporter=None)[source]

One-dimensional interpolation scan between two parameter vectors.

Scans the line (1 - t) * theta_1 + t * theta_2 for t in [0, 1], which is the orqviz perform_1D_interpolation pattern. At t = 0 the parameter vector equals theta_1, at t = 1 it equals theta_2.

Parameters:
  • program (_SupportsVizScan) – Variational program to scan.

  • theta_1 (TypeAliasType) – Starting parameter vector.

  • theta_2 (TypeAliasType) – Ending parameter vector.

  • n_points (int) – Number of sample points along the interpolation line. Must be at least 2.

  • reporter (ProgressReporter | None) – Optional ProgressReporter.

Returns:

offsets are the t values; center is theta_1; direction is theta_2 - theta_1.

Return type:

Scan1DResult

Raises:
  • TypeError – If program is not a supported variational program.

  • NotImplementedError – If program is an IterativeQAOA instance.

  • ValueError – If shapes do not match or n_points is invalid.