I am trying to interpolate for the intermediate parameters using the GrassmannInterpolation() method as shown below.
parameters = np.linspace(0.1, 5, 6)
matrices = give_snapshot(parameters)
manifold_projection = SVDProjection(matrices, p="max")
projection_kernel = ProjectionKernel()
# Compute kernel for U (left singular vectors)
projection_kernel.calculate_kernel_matrix(x=manifold_projection.u, s=manifold_projection.u)
kernel_psi = projection_kernel.kernel_matrix
# Compute kernel for V (right singular vectors)
projection_kernel.calculate_kernel_matrix(x=manifold_projection.v, s=manifold_projection.v)
kernel_phi = projection_kernel.kernel_matrix
singular_vectors = [GrassmannPoint(u.data) for u in manifold_projection.u]
print(f"Shape of singular vectors: {[s.data.shape for s in singular_vectors]}")
distance_metric = AsimovDistance()
coordinates = parameters.reshape(-1, 1)
interpolator = GrassmannInterpolation(
interpolation_method=None, # Default to multi-linear interpolation
manifold_data=singular_vectors, # Singular vectors (Grassmann points)
coordinates=coordinates, # Frequencies where matrix snapshots are available
distance=distance_metric
)
freq_interp = np.array([[2.1]])
interpolated_point = interpolator.interpolate_manifold(freq_interp)
I am trying to interpolate for the intermediate parameters using the GrassmannInterpolation() method as shown below.
The last line gives following error
