0

I wish to solve the Schordinger equation using Haar matrices as shown on equation 3.15 on the link https://scholarworks.calstate.edu/downloads/1g05fd58t When I differentiate the H4 matrice, I get the error

TypeError: only size-1 arrays can be converted to Python scalars.

import numpy as np
from scipy.integrate import quad
def integrand(x, H):
    return np.dot(H, x)

H = np.array([[1, 1, 1, 1], [1, 1, -1, -1], [1, -1, 0, 0], [0, 0, 1, -1]])

result, error = quad(integrand, 0, 1, args=(H,))

print("Integration Result:")
print(result)

print("Integration Error:")
print(error)
toyota Supra
  • 3,181
  • 4
  • 15
  • 19

0 Answers0