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_2for t in[0, 1], which is the orqvizperform_1D_interpolationpattern. Att = 0the parameter vector equals theta_1, att = 1it 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) – OptionalProgressReporter.
- Returns:
offsetsare the t values;centeris theta_1;directionistheta_2 - theta_1.- Return type:
- Raises:
TypeError – If
programis not a supported variational program.NotImplementedError – If
programis anIterativeQAOAinstance.ValueError – If shapes do not match or
n_pointsis invalid.