MRChemSoft/vampyr

Haar missing implementations

Opened this issue · 0 comments

#ScalingProjector cannot be defined by precision
#Next piece of code shows the problem

from vampyr import vampyr1d as vp
import matplotlib.pyplot as plt
import numpy as np

x_min = 0
x_max = 1
order = 0 #Haar order
precision = 10**(-10)

mra = vp.MultiResolutionAnalysis(box=[x_min, x_max], order=order)
P_eps = vp.ScalingProjector(mra, prec = precision) #projects only on zero scale

def f(x):
return np.sin( np.pi * x[0] )

f_eps = P_eps(f) #create a tree with only one node

print(f_eps)

x_vec = np.linspace(0, 0.9999, 1000)
f_plt = np.array([f([x]) for x in x_vec ])
f_eps_plt = np.array([f_eps([x]) for x in x_vec ])
plt.plot(x_vec, f_plt , "black") # one function to plot
plt.plot(x_vec, f_eps_plt , "blue") # one function to plot
plt.show()