Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Help with grassmanian interpolation #246

Open
KapilKhanal opened this issue Oct 1, 2024 · 0 comments
Open

Help with grassmanian interpolation #246

KapilKhanal opened this issue Oct 1, 2024 · 0 comments

Comments

@KapilKhanal
Copy link

KapilKhanal commented Oct 1, 2024

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)

The last line gives following error
image

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant