Visualization

The divi.viz module provides loss-landscape scans, analysis tools, and plotting utilities for variational programs.

Scan functions cover one-dimensional (scan_1d()), two-dimensional (scan_2d()), PCA-based (scan_pca()), and interpolation (scan_interp_1d(), scan_interp_2d()) slices through the loss landscape. Analysis tools include compute_hessian() for curvature information, fourier_analysis_2d() for frequency decomposition, and run_neb() for nudged elastic band transition paths. ProgramViz wraps a variational program and exposes all of the above as convenient methods.

Loss-landscape visualization for variational programs.

Provides one- and two-dimensional objective scans and a PCA-based plane scan. Evaluations use Divi’s batched cost path. On VariationalQuantumAlgorithm subclasses, the same entry points are available as program.viz.

Attribution for orqviz-aligned geometry is recorded in LICENSES/ORQViz-Apache-2.0-acknowledgement.txt.

Functions

compute_hessian(program, center, *[, ...])

Compute the Hessian matrix at center.

fourier_analysis_2d(scan_result)

Compute the 2D Fourier power spectrum of a scan grid.

periodic_trajectory_wrap(trajectory[, period])

Unwrap a trajectory so consecutive rows are within half a period.

periodic_wrap(point, reference[, period])

Wrap point to the closest periodic copy relative to reference.

run_neb(program, theta_1, theta_2, *[, ...])

Find a minimum-energy path between two parameter vectors via NEB.

scan_1d(program, *[, center, direction, ...])

One-dimensional loss-landscape scan for a variational program.

scan_2d(program, *[, center, direction_x, ...])

Two-dimensional loss-landscape scan for a variational program.

scan_interp_1d(program, theta_1, theta_2, *)

One-dimensional interpolation scan between two parameter vectors.

scan_interp_2d(program, theta_1, theta_2, *)

Two-dimensional interpolation scan between two parameter vectors.

scan_pca(program, *, samples[, center, ...])

Evaluate a 2D scan in PCA score space (orqviz-compatible layout).

Classes

Fourier2DResult(frequencies_x, ...)

Result of a 2D Fourier analysis on a scan grid.

GradientMethod()

Strategy for computing gradients in viz analysis functions.

HessianResult(hessian, eigenvalues, ...)

Result of a Hessian computation at a parameter point.

NEBResult(path, energies, path_distances, ...)

Result of a NEB relaxation.

PCAScanResult(x_offsets, y_offsets, values, ...)

ProgramViz(program)

Thin convenience wrapper for program.viz access.

Scan1DResult(offsets, values, ...)

Scan2DResult(x_offsets, y_offsets, values, ...)